Author: Ingmar Verheij
With Citrix Provisioning Services (PVS) the content of a disk can be streamed to a (virtual / physical) machine via the network. A (virtual) machine that boots needs a bootstrap to locate a PVS server (that has a vDisk available) and the ability to stream the disk to the machine.
The bootstrap, the Boot Device Manager (BDM), needs to be delivered to the machine. It is common to deliver the BDM bootstrap via a Pre Execution Environment (PXE) network boot, but it’s not required. Although the PXE method seems the most straight forward method (and most advocated), it it difficult to make it resilient.
The PXE method
The Pre Execution Environment (PXE) method depends on a DHCP request, a PXE and a Trivial File Transfer Protocol (TFTP) server. After the machine sends a DHCP request it receives a DHCP response that contains the PXE server to contact. The PXE server streams the Boot Device Manager (BDM) to the machine via TFTP. After the machine has loaded the Boot Device Manager (BDM) the actual streaming of the vDisk via PVS starts.
Achieving resilience, making the PXE and TFTP server high available, is a rather complex task and requires additional components like a NetScaler (or other load balancer) and (optionally) a third party TFTP server (to prevent streaming the vDisk through the NetScaler) and as a result two additional virtual machines per site. As described in Load Balancing TFTP – Anything But Trivial
It is possible to deliver the Boot Device Manager (BDM) bootstrap directly to the machine, without using PXE and TFTP.
With the ‘Provisioning Services Boot Device Manager’ tool you can easily create an ISO image (of 300K) which you can mount to your virtual machines. Especially in a virtual environment it is very easy to mount a ISO to a virtual machine. By mounting the ISO in the virtual machine template used in XenDesktop the correct boot image is always used. Alternatively the BDM bootstrap can be burned on a CD that you’ll leave in a physical machine or store the bootstrap on the physical disk.
Image from Citrix eDocs
The best thing is that if there is an unforeseen circumstance and the machine is unable to boot, it can failover to the next boot device. This means you can use PXE as a failover method, where resiliency is less required. But to be honest, I don’t think you should have to solutions in place ‘just in case something goes wrong’. Built it right and keep it right
What are the benefits?
There are mainly two big benefits;
- The environment can be build with resiliency (or high available) with common off-the-shelf (COTS) products
- The complexity is reduced
- There are no PXE and TFTP servers required
- DHCP scope configuration doesn’t have to be changed
- IP helpers (for PXE boot across subnets) are not required
- Less broadcasts packages over the network
The BDM bootstrap is run in a limited environment and therefore has a limited support for Network Interface Cards (NIC). There are some compatibility issues with certain virtual adapters in common hypervisors (Hyper-V 2.0 requires legacy NIC adapter, vSphere requires VMXNet3, etc.).
So mounting the BDM via an ISO, instead of providing via PXE, does not make it easier to use it on Hyper-V 2.0. Sorry Remko!
After releasing this article a few people on Twitter suggested it would be very nice if a PowerShell script existed that could mount the ISO (containing the Boot Device Manager) to a virtual machine. The much appreciated and fellow blogger Andrew Morgan (LinkedIn, Twitter, Website) picked up the glove and accepted the challenge! Andrew wrote a PowerShell script that automatically mounts the ISO to a specified list of virtual machines. You can download the script here.
Before you can use the script you need to change the following settings:
- $vms – A list of virtual machines where you want to mount the ISO (typically the PVS target list)
- $viserver – The FQDN of the VMware Infrastructure server
- $datastorepath – The location of the ISO containing the Boot Device Manager (BDM) on the VMware datastore
- $silent – If set to $true the script will be run silently, no input is required
The decisional tree of the script
- Can i connect to the VMware Infrastructure server ($viserver)?
- Yes > Continue
- No > Error out
- Does the virtual machine ($vms) have cd drive?
- Yes > Continue
- No > Offer to power off the virtual machine, add a cd drive and then boot again
- Is the virtual machine ($vms) powered on?
- Yes > Continue
- No > Offer to power on the virtual machine
- Map the CD drive to the ISO on the datastore ($datastorepath)
Andrew wrote the script for a VMware Infrastructure (VI) environment. If you created a similar script for a different hypervisor (XenServer / Hyper-V) and want to share it here, contact me.
Was once an enthusiastic PepperByte employee but is now working at Citrix. His blogs are still valuable to us and we hope to you too.