Set Up PXE Boot for VMs
Run a PXE server on a tenant network in Private Cloud Director and use VM rescue mode with an iPXE image to PXE boot other VMs from it.
Overview
Private Cloud Director supports PXE booting VMs by running a PXE server on a VM that you operate. The PXE server VM provides DHCP, TFTP, and (optionally) HTTP on a tenant network where the PCD managed DHCP service is disabled, and serves boot files to other VMs on the same network. To PXE boot a target VM, you launch it on that same network and put it into rescue mode with an iPXE image. iPXE then chains to the PXE server and the target VM boots the installer or operating system delivered by the PXE server.
You can also use a provider network with a specific VLAN instead of a tenant network.
In this guide, you will create a network with DHCP disabled, launch a PXE server VM on it, and PXE boot a target VM from that server using rescue mode.
Prerequisites
Before you start, make sure you have the following:
A PXE server image or a running VM that you have already configured with:
A DHCP server (for example,
isc-dhcp-server) set to serve IPs on the network's subnet range and to advertise itself as thenext-server.A TFTP server (for example,
tftpd-hpa) hosting the bootloader (pxelinux.0) and the OS kernel and initrd.An HTTP server (for example, Apache) hosting the OS installer files, if you are using HTTP-based installation.
An iPXE ISO. You can download it from
https://boot.ipxe.org/ipxe.iso.Admin access to the PCD UI, or
pcdctlinstalled and configured. See PCD CLI - pcdctl.The
pcdctlexamples in this guide all include--insecure, because the default self-signed certificate otherwise causes an SSL verification failure on every API call (for example,pcdctl network listfails outright without it). Omit the flag if your environment uses a CA-signed certificate.
Step 1: Create the Tenant Network with DHCP Disabled
The PCD managed DHCP service and the PXE server's DHCP cannot both serve the same network. Disable DHCP on the subnet so that PXE clients receive their IPs from the PXE server VM.
Using the UI
In the PCD UI, choose Networks and Security, then Networks.
Choose Create Network and enter a name, for example
pxe-network.In the subnet section, enter a CIDR for the subnet, for example
192.168.48.0/24.Select the Disable Gateway checkbox (it sits right above Enable DHCP). An isolated PXE network has no router, so the subnet's default gateway address does not exist; a guest that installs a route to it loses outbound connectivity.
Clear the Enable DHCP checkbox.
Choose Create to create the network.
Using pcdctl
If your environment uses a provider network with a specific VLAN, you can use that instead. Disable DHCP on the subnet the same way.
Even with DHCP disabled, the Networking Service still allocates each port a fixed IP from the subnet's full allocation pool (192.168.48.2 to 192.168.48.254 by default for this example CIDR), independent of the PXE server's own DHCP range. If the two ranges overlap, the Networking Service can hand a port an address that the PXE server also tries to lease. Narrow the Networking Service allocation pool with --allocation-pool start=<start-ip>,end=<end-ip> on pcdctl subnet create, and keep the PXE server's DHCP range outside that pool.
Step 2: Upload the PXE Server Image
Upload the operating system image that you have prepared as the PXE server. The image must already include the DHCP, TFTP, and (if used) HTTP services and their configuration.
Using the UI
Choose Virtual Machines, then Images.
Choose Add Image and select the image file.
Set the disk format to match the file you are uploading (for example,
qcow2for a customized cloud image).Choose Create to upload the image.
Using pcdctl
Step 3: Launch the PXE Server VM
Launch a VM from the PXE server image on the tenant network you created in Step 1.
Using the UI
Choose Virtual Machines, then Virtual Machines.
Choose Create VM.
Select the
pxe-serverimage and a flavor with enough resources to run DHCP, TFTP, and HTTP.Attach the VM to
pxe-network.Launch the VM.
On the Virtual Machines page, locate
pxe-server-vm, open its actions menu (the three-dot icon on the right), choose Network Actions, then choose Edit Port Security.In the Edit Port Security dialog, select the VM's port from the VM Port dropdown, clear the Enable Port Security Groups checkbox, and choose Update Port Security. This single control both disables port security and removes any security groups from the port. With port security enabled, PCD drops DHCP server responses coming from a VM port.
Using pcdctl
If the VM was created through the UI (attached with --network instead of a pre-created port), disable port security on its existing port:
After the VM boots, log in and configure the VM's network interface with the same static IP as the port's fixed IP (192.168.48.10 in this example), for example using Netplan. The IP configured inside the guest must match the port's fixed IP; a mismatched address is dropped by anti-spoofing rules. Other VMs reach this IP as the next-server advertised in DHCP responses.
Disabling port security removes security-group protection from the PXE server VM. Port security must also be disabled on each target VM's port (see Step 5); otherwise the DHCP handshake between the target VM and the PXE server never completes. Because both VMs lose security-group protection, keep the whole PXE network isolated and do not attach any VM on it to networks with untrusted workloads.
Step 4: Upload the iPXE Image and Enable It for Rescue Operations
The PCD rescue dialog only accepts images that have the hw_rescue_device and hw_rescue_bus properties set. The image upload form has an option that sets these properties for you.
Using the UI
Choose Virtual Machines, then Images.
Choose Add Image and select the
ipxe.isofile you downloaded.Set Disk Format to iso.
Enable the Use for rescuing VMs option. This sets
hw_rescue_device=diskandhw_rescue_bus=scsion the image automatically.Choose Create to upload the image.
Using pcdctl
Step 5: PXE Boot a Target VM with Rescue Mode
Launch the target VM on pxe-network. The target VM can use any base image; rescue mode overrides its boot source with the iPXE image for one boot cycle.
Launch the Target VM
Create the VM on pxe-network the same way as in Step 3, using your chosen base image and flavor, then disable port security on its port using the same Edit Port Security dialog (or the CLI) described in Step 3.
Port security must be off on the target VM's port too, not just the PXE server's. With it enabled on the target VM's port, the PXE server logs repeated DHCPDISCOVER / DHCPOFFER exchanges but never receives a DHCPREQUEST or sends a DHCPACK, so no TFTP transfer ever starts. Pinning the PXE server's DHCP reservation to the port's Networking Service-allocated fixed IP does not work around this; the fix is to disable port security on the port itself.
Put the VM into Rescue Mode
On the Virtual Machines page, locate the target VM.
In the target VM's row, choose the actions menu (the three-dot icon on the right), choose Power Actions, then choose Rescue.
In the Rescue VM dialog:
For an image-backed VM, select Rescue with Different Image to reveal the image picker.
For a volume-backed VM, the image picker is shown by default.
In Select a rescue image, select the
ipxeimage. The Properties column shows only one property by default; choose show more to confirm bothhw_rescue_deviceandhw_rescue_busare set.Choose Rescue VM. Note the one-time password the dialog displays for logging in to the rescued VM; it is not shown again.
The VM reboots into iPXE, which broadcasts a DHCP request on pxe-network. The PXE server VM responds with an IP and the location of the boot files, and the target VM boots the installer or operating system that the PXE server serves.
Using pcdctl
Step 6: Exit Rescue Mode
After the install or boot workflow on the target VM completes, exit rescue mode so the VM boots from its primary disk.
Using the UI
On the Virtual Machines page, locate the target VM.
In the target VM's row, choose the actions menu (the three-dot icon on the right), choose Power Actions, then choose Unrescue.
In the Unrescue VM dialog, confirm that you want to exit rescue mode and return the VM to normal operation, booting from its original disk image.
Choose Unrescue VM.
Using pcdctl
Get Installer Files onto the PXE Server Without External Connectivity
Because the PXE network's subnet has no gateway (Step 1), the PXE server VM has no route to the internet by design. Deliver the OS installer ISO to it through a volume instead of downloading it on the VM:
Upload the OS ISO as an image:
In the PCD UI, create a volume from the
ubuntu-isoimage and attach it to the PXE server VM.On the PXE server VM, identify the attached volume's device node:
Mount the attached volume and copy the kernel and initrd into the TFTP directory. Replace
/dev/vdbwith the device node reported bylsblk, and replace/var/lib/tftpbootwith whatever TFTP root your server is actually configured to use (checkTFTP_DIRECTORYin/etc/default/tftpd-hpa; on Ubuntu 24.04,tftpd-hpadefaults to/srv/tftp, not/var/lib/tftpboot):
Troubleshooting
The Rescue VM dialog shows the error `hw_rescue_device` property missing in the selected image.
The iPXE image was not uploaded with the rescue option enabled. Re-upload with the rescue option enabled, or set the hw_rescue_device=disk property on the existing image.
The Rescue VM dialog shows the error `hw_rescue_bus` property missing in the selected image.
Same as above for the hw_rescue_bus=scsi property.
The target VM does not receive an IP after entering rescue mode.
Verify that Enable DHCP is clear on the subnet, that the PXE server VM is running with a static IP that matches its port's fixed IP, that the DHCP service on the PXE server VM is active, and that port security is disabled on both the PXE server VM's port and the target VM's port. With port security enabled on either port, the DHCP handshake never completes (the PXE server logs repeated DHCPDISCOVER / DHCPOFFER pairs with no DHCPREQUEST / DHCPACK).
The target VM receives an IP but does not start the boot workflow.
Verify that the next-server value in the PXE server's DHCP configuration matches the PXE server VM's static IP, and that the TFTP service on the PXE server VM is reachable on the subnet.
A rescued VM does not respond to pcdctl server reboot.
The VM is still in rescue state; rebooting a rescued VM returns an HTTP 409 error. Run pcdctl server unrescue, then pcdctl server rescue --image ipxe again to retry the PXE boot.
The PXE server VM now serves boot files to any VM launched on pxe-network, and you can repeat Step 5 for each target VM you want to PXE boot.
Related Pages
Virtual Network: network, subnet, and port management in the PCD UI and CLI.
Layer 2 Networking: running an external DHCP or IPAM service on a segment, including MAC-to-IP reservations.
Virtual Machine Actions: rescue and unrescue reference, including the
hw_rescue_deviceandhw_rescue_busimage properties.
Last updated
Was this helpful?
