|Applying Offline Updates to ESXi using PowerCLI|
Yesterday I had the unpleasant experience of having to go through my email to find an email I wrote back in February 2011 in which I detailed the steps required in order to perform an offline update of VMware ESXi hosts via PowerCLI. Had I posted the steps here on this site at the time, it would have saved me a lot of pain in trying to retrieve the email from an Enterprise Vault archive! So, as I have learned my lesson, I am posting the steps required to update ESXi from PowerCLI.
At the time of writing the instructions, the update that I was looking at was ESXi 4.1 Update 1. However, the steps below will work on all newer ESXi versions as well.
VMware provides offline updates that can be downloaded from their website in the form of .ZIP archives. These updates can be downloaded from:
In order to perform the update with PowerCLI, you will need to have Windows PowerShell and PowerCLI installed on a workstation. Most VMware administrators will already have this installed.
Steps to apply an offline update, in this case ESxi4.1 Update 1, to ESXi via PowerCLI:
1. Place the host that is going to be upgraded in Maintenance Mode.
2. Download ESXi 4.1 Update 1 from here:
4. Using the vSphere client, copy the files that were extracted to a folder called “Patches” on any datastore on the SAN that is visible to the host. This can also be placed on a local disk on the ESXi host, however, by placing the updated on shared storage will allow you to update more hosts from the same set of update files, without having to copy the files to each host.
5. Open the PowerCLI Console from your Start menu.
6. When the prompt pops up, connect to the vCenter server where the ESXi host is being managed from using the following command (you can also connect directly to the host if you like):
Connect-VIServer <VCENTER-SERVER NAME OR IP>
7. After the command has been issued, you might be prompted for a username and password.
8. Apply the patch with the following command:
9. Install-VMHostPatch –VMhost <ESXi name or IP Address> -HostPath /vmfs/volumes/<datastore-name>/Patches/metadata.zip
Note: I have seen a lot of cases where administrators try to point Install-VMHostPatch directly to the update zip archive downloaded from the VMware website. This will not work. You have to extract the archive, copy all of the data to a location that is accessible to the host to be updated, and point Install-VMhostPatch to the metadata.zip file.
- Simple VMware vSphere 4 & 5 License Calculator
- Clearing a GUID Partition Table (GPT) in Linux
- Building an iSCSI Openfiler SAN on a USB Stick
- Replace SSL Certificates: Replace vCenter Server SSL Certificates
- Replacing vSphere SSL Certificates
- My experiences with Installing vCenter on Windows Server 2008 R2
- Patching ESX 3.5 Using esxupdate
- Veeam FastSCP on Windows Server 2003 x64
- Restarting vmware-hostd
- A Deeper Look Into VMware vSphere 5 Licensing