Updating your ESXi host using VMware vSphere 5 Auto deploy

There are two ways of getting the new builds for your ESXi image.

The well known way is to go to the VMware download pages, logon, access your download for vSphere and download the zip image.

However, there is an easier way.

Logon to your vCenter where you have your Software Depot. Open the VMware PowerShell command line, connect to vCenter and add the VMware HostUpdate URL to the EsxSoftwareDepot.

 

Then retrieve a list of the available images:

Connect-viserver –server vcenter.domain.local
Add-EsxSoftwareDepot -DepotUrl https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
Get-EsxImageProfile

The result should look like this:

Name                           Vendor          Last Modified   Acceptance Level
----                           ------          -------------   ----------------
ESXi-5.0.0-20110904001-notools VMware, Inc.    8/26/2011 1:... PartnerSupported
ESXi-5.0.0-469512-no-tools     VMware, Inc.    8/19/2011 1:... PartnerSupported
ESXi-5.0.0-20110904001-stan... VMware, Inc.    8/26/2011 1:... PartnerSupported
ESXi-5.0.0-469512-standard     VMware, Inc.    8/19/2011 1:... PartnerSupported

To see if these are really newer than the existing images list the current deployrules and the images that are being deployed.

Get-DeployRule
Name        : CL01
PatternList : {ipv4=192.168.0.100-192.168.0.141}
ItemList    : {ESXi-5.0.0-469512-standard, CL01, HostProfile001}

This will list all deploy rules created, not necessarily active rules. Looking at the result I see that the “ESXi-5.0.0-20110904001-standard” image is newer and I would like to deploy this to my hosts. To see what has changed between the existing image and the new image I want to deploy, I do a comparison:

Compare-EsxImageProfile ESXi-5.0.0-469512-standard ESXi-5.0.0-20110904001-standard

This shows that the modules VMware_locker_tools-light_5.0.0-0.3.474610 and VMware_bootbank_esx-base_5.0.0-0.3.474610 have changed between these two builds.

Adding the new build

Lets assume that “ESXi-5.0.0-20110904001-standard” is the new build and I want to update my existing rule named “CL01-New”. This can be done through the following command:

Copy-DeployRule -DeployRule CL01-New -ReplaceItem "ESXi-5.0.0-20110904001-standard"

After running this command, you should see the start of the image download:

Downloading esx-base 5.0.0-0.3.474610
Download finished, uploading to AutoDeploy...
Upload finished.
Downloading tools-light 5.0.0-0.3.474610
Download finished, uploading to AutoDeploy...
Upload finished.

Check what the deploy ruleset looks like now. First the deployrules available and next the active deployrules:

Get-deployRule
Get-deployRuleSet

One last check that needs to be performed is to see if your hosts are still compliant.

On initial boot the Auto Deploy server parses the host attributes against the rules engine to determine the Image Profile, Host Profile, and vCenter Cluster/Folder and saves this info. On subsequent reboots, it uses this saved info.

When copying the rule and updating the Image Profile, the hosts of that rule are no longer compliant because the image listed in the rule no longer matches the image the Auto Deploy server has saved for the host.

To fix this you need to run a Test/Repair for all hosts.

To check for compliance:

Get-VMHost * | Test-DeployRuleSetCompliance 

VMHost               ItemList
------               --------
esx02.vanzant... {}
esx03.vanzant... {}
esx01.vanzant... {Non-compliant: ESXi-5.0.0-441354-standard != E...

The results above show that host esx01 is not compliant. To fix this:

Get-VMHost * | Test-DeployRuleSetCompliance | Repair-DeployRuleSetCompliance

And of course check the result again by running the check again. If things look OK you may proceed rebooting the server hosts to test the new auto deploy image.