VMware Auto Deploy: ESXi installation made easy

Installing ESXi is time consuming, but you can automate the ESXi installation and configuration process with VMware Auto Deploy in vSphere 5.

VMware vSphere 5 includes a new feature called Auto Deploy, which automates ESXi installation and host configuration. Through PXE booting, VMware Auto Deploy delivers the entire ESXi hypervisor across the wire, meaning the host can be completely diskless.

I’ve been tinkering with VMware Auto Deploy for a new book I’m working on, and I think VMware admins will find it easier to configure than storage area network-based booting. This vSphere 5 feature can really streamline the ESXi installation and configuration process.

VMware Auto Deploy installs as a service in the Windows version of vCenter, as well as in the Linux version that ships as a virtual appliance. It then copies the boot files to your TFTP server. In your DHCP scope configuration options, you have to enter the IP address of the TFTP server so the PXE client can locate it and access the correct files.

Scope option 066/067 can tell the PXE client where to find the TFTP server and which file to load for the boot process.

Scope option 066/067 can tell the PXE client where to find the TFTP server and which file to load for the boot process.

Installing ESXi hosts with Auto Deploy rules
Once you install VMware Auto Deploy, it’s time to define image profiles and deployment rules for the ESXi installation. You can do this with PowerCLI cmdlets, although I’m hoping VMware will build a vCenter plug-in.

VMware Auto Deploy rules are like a shopping bag of components that you bundle together and apply to a group of servers.  These rules can specify which site or cluster the host should be added to during your ESXi installation, for instance. You can also choose whether to attach a host profile to the new host and create conditions that ensure that the right deployment rule gets applied to the right server.

All rules contain what’s called an image build. These builds come in .zip format with “depot” in the name, and are not to be confused with the .iso version you would normally use to do a manual install. By default, a .zip file contains two images -- one with the VMware Tools .iso included and one without, so you can decide whether to install VMware Tools on your new ESXi host or not. (Some users have their own methods of installing and upgrading VMware Tools in their virtual machines.)

Here’s what a typical ESXi installation script looks like in vSphere 5:

Line 1: Add-ESXSoftwareDepot d:\vmware-ESXi-5.0.0-381646-depot.zip

Line 2: $channel = Get-ESXSoftwareChannel

$ip = Get-ESXImageProfile -SoftwareChannel $channel

Line 3: $inventory = get-datacenter CorpHQ | get-cluster Gold

Line 4: New-DeployRule -Name "CORPHQ - Gold Cluster" -item $ip[1] , "CorpHQ - Gold Cluster" , $inventory -Pattern "ipv4="

Line 5: Add-DeployRule “CORPHQ - Gold Cluster”

Line 1 in this script indicates which build I want to use for this ESXi installation using the .zip file. Lines 2 and 3 retrieve the build and image profile information from the file, creating a variable called $IP that you can use later to specify which image build you want to use. Line 4 creates a variable called $inventory that indicates where in vCenter the host is added after the boot process completes.

The fun part of installing ESXi hosts is the fifth line, which creates a deployment rule called CorpHQ Cluster using the second image in the .zip depot with the $IP variable. This rule includes what host profile to use and the $inventory variable from Line 4.

Finally, the rule has an option to indicate what conditions must be true for an ESXi host to receive this build. I use Client Reservations on the DHCP scope to guarantee that my host gains an IP address in the range of to (I’ve only got four hosts, so it’s a small range.)  There are a whole bunch of settings you can add in Machine Attributes, which appear on the VMware Auto Deploy welcome screen when the host first boots. Other conditions you could specify when installing ESXi hosts include the model, MAC and UUID values.

Switching ESXi installation image builds
Another great thing about VMware Auto Deploy is the ability to easily swap out one build image with another. You can replace the image and run a remediate reboot command, and when the host comes back up, your new build image is magically there. That will be especially helpful for administrators that want to upgrade hosts from earlier versions of ESX to ESXi in vSphere 5.

Here’s an example of how to switch image builds (without including VMware Tools):

Line 1: Add-ESXSoftwareDepot d:\vmware-ESXi-5.0.0-381646-depot.zip

Line 2: $channel = Get-ESXSoftwareChannel

$ip = Get-ESXImageProfile -SoftwareChannel $channel

Line 3: Copy-DeployRule -DeployRule "CORPHQ - Gold Cluster" -ReplaceItem $ip[0]

Line 4: Add-DeployRule “CORPHQ - Gold Cluster”

Line 5: $tr = Test-DeployRuleSetCompliance esx03nj.corp.com

Line 6: Repair-DeployRuleSetCompliance $tr

Line 7: Set-VMHost esx03nj.corp.com -State maintenance

Line 8: Restart-VMhost esx03nj.corp.com -Confirm:$false

In Line 3, the entry $IP[0] indicates to use ESXi-5.0.0-381646-no-tools from the .zip depot file. Lines 3 and 4 check whether the deploy rule has been applied, and the rest carries out a remediate process to apply $IP[0] rather than $IP[1].

VMware Auto Deploy gotchas
Although VMware Auto Deploy makes ESXi installation easier, the feature comes with a few gotchas. Auto Deploy assigns a host profile, but you have to manually apply the profile after you first boot the host. Once you apply the host profile, you have to enter a lot of IP address and subnet masks for each VMKernel port (vMotion, FT-Logging, IP storage, high availability, heartbeat).

You should also know that Host Profiles saves these per-host settings in separate .xml answer files. That means you need one answer file for each host. If you have 128 blades, for instance, that’s 128 answer files. Installing ESXi with PowerCLI and .csv files, on the other hand, requires very little manual work compared to this process in VMware Auto Deploy.

Remember, with a diskless ESXi installation, there is also no place to store log files and the ESXi Core Dump. That means you need to set up a Syslog server for log files and the VMware Core Dump Collector service.

VMware Auto Deploy can greatly improve the ESXi installation process, but it would benefit from a more graphical front end. I had to tussle with Auto Deploy for a few hours (or was that days) before I cracked it, but I would urge VMware admins to bear with it. If you already use PowerShell or PowerCLI, it’s fairly easy to develop VMware Auto Deploy rules and simplify ESXi configuration.

Dig Deeper on VMware new releases and updates