Disclaimer: This method assumes you can install the default ESXi Image Profile with no additional drivers or packages, else you may have connectivity issue after the upgrade. If you still need to customize the ESXi Image Profile before installation, you will still need to use something like Image Builder and then upload that to your online depot.
Note: There are many ways that you can patch/upgrade your ESXi hosts, here is another article that provides more details for command-line only methods.
Before you get started, you will need to make sure that your ESXi host has the httpClient firewall rule enabled, else you will not be able to connect to VMware's online depot. To enable this, run the following ESXCLI command:
esxcli network firewall ruleset set -e true -r httpClientAlso make sure that your ESXi host can reach the following URL (you can specify a proxy if needed):
https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
To view the available ESXi Image Profiles, run the following ESXCLI command (use the --proxy if you need to specify a proxy to reach VMware's online depot):
esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xmlIf you are able to successfully connect to the online depot, you see a list of all the ESXi Image Profiles that are available to you. You will see two ESXi 5.1 Image Profiles (these were recently published), one with VMware Tools and one without VMware Tools.
Note: Before you begin, make sure you do not have any running VMs and put your host into maintenance mode.
Let's go ahead and upgrade our ESXi 5.0 Update 1 host to latest ESXi 5.1. To install the new Image Profile, run the following command:
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.1.0-799733-standard

I saw that on the release notes (https://www.vmware.com/support/vsphere5/doc/vsphere-esx-vcenter-server-51-release-notes.html#upgrading) and found that really cool too :)
ReplyDelete"You can upgrade and apply patches to ESXi 5.0.x hosts by using the esxcli command-line utility for ESXi to install ESXi 5.1 from a download depot on vmware.com or from a downloaded ZIP file of a depot that is prepared by a VMware partner."
I needed to add --ok-to-remove to my command line because the host had an older host profile to get the update going.
ReplyDeleteWilliam you rock dude. Thanks for the cool post
ReplyDeleteHello, william!
ReplyDeletei´m using ESXi5 (free version of VMware vSphere Hypervisor 5 on a Acer AC100 with 16Gig RAM) and try to update my existing server. The standard method using
esxcli software vib update –depot /vmfs/volumes/4f2aad46-***/ESXi500-201207001.zip
finished with the errors: "VIB .... cannot be removed live"
ESXi is running in maintenence mode.
Glad to see your blog with another method to upgrade, I got the same errors.
Do you have any suggestions, how to continue the update ?
Chris
Vienna
ESXi free edition is read-only through cli that's maybe why
ReplyDeleteI'm getting the "cannot remove live" that Anonymous got... but its not the free edition...
ReplyDelete@Anonymous,
DeleteCan you try "--ok-to-remove" as noted by @David Barker?
Great post!
ReplyDeleteWith Nexus 1000v
~ # esxcli software profile install -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.1.0-799733-standard
[Exception]
You attempted to install an image profile which would have resulted in the removal of VIBs ['Cisco_bootbank_cisco-vem-v142-esx_4.2.1.1.5.1a.0-3.0.1']. If this is not what you intended, you may use the esxcli software profile update command to preserve the VIBs above. If this is what you intended, please use the --ok-to-remove option to explicitly allow the removal.
Please refer to the log file for more details.
~ #
Thank you :) ... this helped alot !!!
ReplyDeleteI know this is an older posting (earlier this year) but it absolutely rocked and is not only a different way to upgrade but an awesome way to upgrade. Worked flawlessly on my ESXi box (SH67H3) after struggling with some other methods. It took a while... but when it completed... all was golden. Thanks again.
ReplyDeleteTNX works like a champ :D save me a lot of time
ReplyDeleteThis was my first shot at patching my first ESXi box and it was flawlessly! This is an all-in-one home NAS box, so I guess it's the free version. Took about 1 minute after entering three lines:
ReplyDelete- Place ESXi into maintainence mode
- run VMware vSphere CLI
>>> esxcli -s network firewall ruleset set -e true -r httpClient
>>> esxcli -s esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
- find the latest patch in the list and copy the name (i.e. ESXi-5.1.0-20121201001s-standard)
>>> esxcli -s software profile install -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.1.0-20121201001s-standard
Thanks!
Sorry, try again:
ReplyDelete# esxcli -s (ip) network firewall ruleset set -e true -r httpClient
# esxcli -s (ip) software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
# esxcli -s (ip) software profile install -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.1.0-20121201001s-standard
No third party apps
ReplyDeleteesxcli software profile install -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.0.0-20121202001-standard
Clobber third party apps
esxcli software profile install --ok-to-remove -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.0.0-20121202001-standard
Don't clobber third party apps
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.0.0-20121202001-standard
Worked like a charm on my free edition whitebox build! A ton easier than burning an ISO.
ReplyDelete+1
ReplyDeleteDoes the command applies to ESXi 5.1 Update 1?
ReplyDeleteSo if I understand correct, you can update any build version of ESXi 5.0 directly to 5.1 U1?
ReplyDeleteI have server running version ESXi 5.0 build 474610 and I can update it directly to ESXi 5.1 build 1065491 with one simple command sxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.1.0-20130402001-standard or I have to update it step by step, I mean build after build?