The attached script demonstrates how to automate host updates when using the Auto Deploy feature in vSphere 5. Here's an excerpt from the comment at the top (take a look at the script for more details.)
# This script will help automate patching/updating large numbers of
Here's an example of what using this script might look like:
Connect-VIServer MyVcHostName
Add-EsxSoftwareDepot https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
Get-EsxImageProfile
# Scan through the list and pick the one you want
Get-DeployRule
# Note the name of your image profile assignment rule
.\ad-update.ps1 MyClusterName ESXi-5.0.0-XXXXXX-no-tools MyDeployRule
# Replace XXXXXX with the build number, or alternative image profile name as the second argument
You can also use your own custom image profiles by leveraging the image builder cmdlets.
Daniel
Awesome script Daniel.
Hi,
Great job on this script. One quesiton I have, Is it possible to use $OEMString for identifying hosts instead of MAC or BIOS UUID?
UCS can supply ESX service Profile name via $OEMString that can be used to associate ESX image.
I would like to attach answer file to ESX UCS service Profile name $OEMString instead of MAC or BIOS UUID.
Much appreciated!
Eugene
Hello,
Script is cool unfortunately all my hosts are not coming back mentioning that they are running the desired image. And if I run the Test-Deplo yRuleSetCompliance at any host it comes back as compliant.
Found out that if I reboot the hosts before running your script all works well.
Any clue why Test-DeployRuleSetCompliance does not verify compliance correct or is there any way to enforce this test? What gets changed after a reboot so this command does the job?
Thanks.