Rapid Provisioning vSphere ESXi 5.0 Hosts Using Image Builder and Auto Deploy (Part 1)

Share Button

If you haven’t heard or read some of the new capabilities in vSphere 5 around rapid provisioning hosts, allow me to introduce you to Auto Deploy (previously Fling).  Auto Deploy is a PXE boot process that loads ESXi into memory thereby eliminating any need for local storage, even USB boot thumb drives. This capability is currently limited in that you may only have one Auto Deploy server per vCenter instance. This pretty much rules out the notion of load balancing the TFTP service, providing multiple image distribution points, or otherwise protecting Auto Deploy with methods other than VMware HA. However, with careful planning and appropriate monitoring we can mitigate that risk and protect it carefully as we do with vCenter.  If fact, with the current limitations of Auto Deploy, I would recommend it be deployed on the vCenter server and managed as part of that VM. This way it sits in the VMware Management Cluster (which should not be provisioned using Auto Deploy), and is protected just like vCenter.

In this first part blog post I will cover all of the basics needed to get Auto Deploy up and running and provisioning hosts. In later blog posts I will cover how stateless hosts should be handled differently including Host Profiles, Syslogging, ESXi Dump Collection, etc. To learn more than the basics about Auto Deploy, start here: http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=2005131

Auto Deploy is installed from the vCenter 5 media (VMware-VIMSetup-all-5.0.0-456005.iso). Auto Deploy can also be integrated with the vCenter Appliance, but this how to guide only covers the Windows Server based components. Select VMware Auto Deploy and click Install:

Select English and click OK:

Click Next:

Click Next:

Accept the license agreement and click Next:

Change the installation directory and repository directory if desired. Change the Auto Deploy repository maximum size to 10 GB to allow for growth and click Next:

Enter your fully qualified hostname of your vCenter Server, leave the default HTTP port 80, enter DomainUsername (vCenter service account) and password and click Next:

Leave the default Auto Deploy Server Port (unless the port is in use) and click Next:

If your system has multiple IP addresses, select the address that is on the ESXi management segment and click Next:

Click Install:

Once completed, click Finish:

If you system does not already have it loaded, obtain PowerCLI 5 from http://communities.vmware.com/community/vmtn/server/vsphere/automationtools/powercli and run the installer:

Click OK to agree that VMware VIX will be installed:

Click Continue to ignore the warning regarding the ExecutionPolicy (We’ll address this after the installation):

Click Next:

Click Next:

Accept the license agreement and click Next:

Change the default installation directory if desired and click Next:

Click Install:

Click Finish:

Go to VMware’s download page for the ESXi 5.0 Installer (http://downloads.vmware.com/d/details/esxi50/dHRAYnQldGViZHBqcA==). Login and accept the license agreement. Once you get to the download page with ISOs and ZIPs, select the link for ESXi 5.0 Offline Bundle for systems with software iSCSI configured (See image below). Download this ESXi500-201111001.zip to the root of the C: drive. This path and file name are referenced later in case you rename or put the file elsewhere:

WARNING: The next several commands all involve Image Builder and Auto Deploy using PowerCLI (PowerShell). I will spell out all the necessary commands to make this simple if this is your first exposure to PowerCLI.  Reference the Image Builder or Auto Deploy administrators guides if you want to dig deeper into the commands below.

Launch PowerShell (typically from the taskbar) and enter the following command to disable the ExecutionPolicy on the local machine:

Set-ExecutionPolicy Unrestricted -scope LocalMachine

When prompted, type “y” and hit return to confirm:

Launch PowerCli (typically from the desktop). Enter the following command to connect to vCenter:

Connect-VIServer localhost

Add the ZIP file downloaded earlier to the Software Depot using the following command:

Add-EsxSoftwareDepot C:ESXi500-201111001.zip

Add your vCenter Server to the Software Depot using the following command:

Add-EsxSoftwareDepot http://localhost/vSphere-HA-depot

Create a new ESX Image Profile with the ZIP file as the reference profile using the following command:

New-EsxImageProfile -CloneProfile “ESXi-5.0.0-20111104001-standard” -name “ESXi-5.0.0-withHA”

Add the vmware-fdm Software Package to the ESX Software Package using the following command:

Add-EsxSoftwarePackage -ImageProfile “ESXi-5.0.0-withHA” -softwarePackage vmware-fdm

The following deployment rule can be targeted to specific subnets, etc. but for this guide we are using the -AllHosts syntax to push the package to all requesting hosts. Create a new deployment rule using the modified Image Profile using the following command:

New-DeployRule -Name “ESXi-Base” -Item “ESXi-5.0.0-withHA” -AllHosts

The above command may take some time to complete. When finished you will see a summary similar to below:

Finally, add the deployment rule using the following command:

Add-DeployRule ESXi-Base

Within the Microsoft DHCP Server, modify the Scope Options to add option 66 and 67.  Option 66 should point to the IP address or DNS name of your TFTP/Auto Deploy server:

Option 67 should be exactly the following:


Create DHCP reservations (Using the boot NIC’s MAC address) for each of the hosts to ensure they always receive the same IP address:

Create DNS A Records (Check the box to ensure the PTR record is created) for each of the hosts to ensure they register in vCenter using their FQDNs and not their IP addresses:

Next, we need a TFTP server to push the initial bootstrap files down to the hosts. If your environment already has a TFTP infrastructure, that service may be used. Otherwise TFTPD32 works well and can be installed as a service (http://tftpd32.jounin.net/tftpd32_download.html). Select the link for TFTPD32 Service Edition (Installer):

Download and run the installer. Agree to the license agreement:

Uncheck desktop icon and select ‘Start service Tftpd32_svc’ and ‘Start service monitoring’. Click Next:

Change the default installation path if desired and click Install:

Click OK to the firewall notification:

Click Close:

Create a directory on the root of the C: drive named C:TFTP_Root.  Change the Current Directory to read C:TFTP_Root and click Settings:

Uncheck any options except TFTP Server on the Global Tab:

Enter C:TFTP_Root on the TFTP tab and click OK to save the changes:

Click OK to the restart notification:

Close the Tftpd32 configuration dialog (Still running as a service in the background):

Open Services.msc and restart the Tftpd32 service edition service:

Open the vSphere client and log into the vCenter server:

On the Home navigation page select AdministrationAuto Deploy:

Select Download TFTP Boot Zip:

Open the Zip folder and extract to the C:TFTP_Root directory created earlier:

Examine the C:TFTP_Root directory after extraction. Note the ‘undionly.kpxe.vmw-hardwired’ file as referenced in DHCP Option 67:

At this point you have completed all the necessary configurations to start PXE booting hosts. During boot, you will see the PXE process kick off, the TFTP bootstrap file obtained and the back-end communication to Auto Deploy will begin pushing down the image:

Once booted, the host will appear just like any other ESXi host:

In vCenter the new host will have been added with absolutely zero configuration:

The next step is to take this unconfigured host and perform all the necessary configurations, create a Host Profile and apply that host profile for all new hosts added to the cluster. These steps will be continued in part 2, but at this point the Auto Deploy piece of the configuration has been completed.

If you have any questions, comments, or would like to leave feedback, please do so below. Feel free to follow me on Twitter: @youngtech.



Share Button
  1. bobbydamercerbobbydamercer12-28-2011

    Nice article!!

    Is there a ‘part 2’ coming soon? 🙂


  2. ylzjyuylzjyu12-14-2011

    Oh, just reply, and the picture came out.

  3. ylzjyuylzjyu12-14-2011

    hi,Dane Young
    Sorry, can not see, there are seven pictures can not be displayed.
    Please check.