In order to minimize overhead on enabling R&D while maintaining control of company IP, I wanted to ensure any team member would be able to spin up a R&D environment with zero or marginal delay. We could just spend the money on AWS instances, however I wanted the benefits of maintaining a small on premise cluster of servers to host those environments, such as:
- Lower long term costs with sufficient utilization – start with one server and scale up if necessary
- Low cost archive / restore of past projects
- No-cost access to on-premise servers / services for integration
We wanted to balance cost with simplicity and mostly adhere to common practices for portability. As such, we focused on creating a simple netboot configuration on our internal dhcp server to support network installation on a bare-metal VM referencing a minimal Ubuntu ISO with a cloud-config ISO volume attached to trigger custom VM setup.
Initial Configuration
Some articles discuss classifying network devices and implementing more advanced differentiating configurations on the corporate network dhcp and tftp servers. These features sound great, but we wanted the initial rollout to mostly enable scenarios with zero-configuration effort.
We went opted to start very simply and – given the internal support for dhcp and tftp on network configurations in libvirt – implemented netboot on the libvirt R&D network configuration. We made a minimal edit adding the following two XML config nodes:
- child node under the ip node: <tftp root=’/var/lib/tftp’ />
- child node under the dhcp definition: <bootp file=’pxelinux.0‘ />
To complete configuration – we need to create the tftp root directory, download pxelinux.0 there, and follow the guide provided by Ubuntu to extract the necessary files from the ubuntu live ISO to the tftp directory. The Ubuntu guide is derivative of the pxelinux documentation and can be adjusted with some knowledge of pselinux.Note: Fedora Core provides a convenient package, syslinux-tftpboot, that installs the necessary files in a tftpboot directory on the root filesystem that I found to be a bit more convenient for accessing those files.
We chose to maintain boot configurations for Ubuntu, Fedora, and Fedora CoreOS. We achieved this by maintaining a configuration for each OS in the /var/lib/tftp/pxelinux.cfg directory and linking the configuration to a MAC pattern per the pxelinux documentation. Each configuration passes a cloud-init or ignition configuration to provision admin account access and any other universally available features.
We maintain all referenced images locally on the libvirt host to enable offline support and enhance install performance.
First Boot Experience
The experience on first boot is highly dependent on the new VM configuration, which we have settled on as follows:
- Pass the R&D network as a network (isolated to the VM host)
- (optional) Pass a bridged network as an additional network ( we prefer an externally defined VLAN enabled bridge limited to R&D usage )
This configuration allows immediate access to the VM on our pre-configured R&D network and optional isolated access by VLAN.