I recently came across an interesting article by Andreas Peetz which shows you how to patch an ESXi host using an image profile that is directly available on VMware's online depot within the ESXi shell. I knew that VMware had online depots for use with VUM and Auto Deploy but I was not aware of this particular method, especially directly from the host.
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 httpClient
Also 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.xml
If 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
This can take a few minutes to complete depending on how fast you can pull down the Image Profile. Once it is done, you will see all the new VIBs that have been updated and you will be asked to reboot for the changes to go into effect and then you will be running ESXi 5.1! Pretty cool IMO!
NiTRo says
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 🙂
"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."
David Barker says
I needed to add --ok-to-remove to my command line because the host had an older host profile to get the update going.
Anonymous says
William you rock dude. Thanks for the cool post
Anonymous says
Hello, william!
i´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
NiTRo says
ESXi free edition is read-only through cli that's maybe why
Anonymous says
I'm getting the "cannot remove live" that Anonymous got... but its not the free edition...
William says
@Anonymous,
Can you try "--ok-to-remove" as noted by @David Barker?
Anonymous says
Great post!
With 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.
~ #
sujith says
Thank you 🙂 ... this helped alot !!!
J says
I 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.
Anonymous says
TNX works like a champ 😀 save me a lot of time
Anonymous says
This 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:
- 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!
Anonymous says
Sorry, try again:
# 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
n/a says
Thanks, the list command was just what i needed!
Anonymous says
No third party apps
esxcli 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
Joe T. says
Worked like a charm on my free edition whitebox build! A ton easier than burning an ISO.
blaz praper says
+1
Anonymous says
Does the command applies to ESXi 5.1 Update 1?
Anonymous says
So if I understand correct, you can update any build version of ESXi 5.0 directly to 5.1 U1?
I 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?
Anonymous says
Thanks for this post. Way easier then running around with media to our school sites running ESXi Free.
I ran the following to install the latest 5.1 Update 1 release and it worked awesome. Took about 45 minutes for the updates to download install and reboot.
Ran on Dell PowerEdge R620 running ESXi Free 5.0 Dell Customized ESXi installation.
esxcli network firewall ruleset set -e true -r httpClient
esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.1.0-20130504001-standard
reboot
Anonymous says
Excellent guide... has helped me out massively. Thank you immensely.
Anonymous says
This is a great way to update your ESXi.. Question is, how often does the depot get updated? Looking to update to 5.5 but only see 5.0/1 in the list.
Anonymous says
nm, I found it in the middle of the list
bartek z falent says
Upgraded ESXi 5.0 to ESXi 5.5
esxcli network firewall ruleset set -e true -r httpClient
~ # esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
Name Vendor Acceptance Level
-------------------------------- ------------ ----------------
ESXi-5.5.0-1331820-no-tools VMware, Inc. PartnerSupported
ESXi-5.5.0-20131204001-no-tools VMware, Inc. PartnerSupported
ESXi-5.5.0-20131204001-standard VMware, Inc. PartnerSupported
ESXi-5.5.0-1331820-standard VMware, Inc. PartnerSupported
ESXi-5.5.0-20131201001s-no-tools VMware, Inc. PartnerSupported
~ #
~ # esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.5.0-20131204001-standard
Update Result
Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Reboot Required: true
VIBs Installed: VMware_bootbank_ata-pata-amd_0.3.10-3vmw.550.0.0.1331820, VMware_bootbank_ata-pata-atiixp_0.4.6-4vmw.550.0.0.1331820, VMware_bootbank_ata-pata-cmd64x_0.2.5-3vmw.550.0.0.1331820, VMware_bootbank_ata-pata-hpt3x2n_0.3.4-3vmw.550.0.0.1331820, VMware_bootbank_ata-pata-pdc2027x_1.0-3vmw.550.0.0.1331820, VMware_bootbank_ata-pata-serverworks_0.4.3-3vmw.550.0.0.1331820, VMware_bootbank_ata-pata-sil680_0.4.8-3vmw.550.0.0.1331820, VMware_bootbank_ata-pata-via_0.3.3-2vmw.550.0.0.1331820, VMware_bootbank_block-cciss_3.6.14-10vmw.550.0.0.1331820, VMware_bootbank_ehci-ehci-hcd_1.0-...
Jesse Stacey says
This unfortunetly did not work for me, and no one else in google seems to be experiencing the same problem. All I can do is populate the list of available profiles, and the one that should be showing under Vsphere -> Summary -> Host Profile : is ESXi-5.5.0-1331820-standard, but instead it just says VERY FRUSTRATING!!
~ # esxcli software profile install -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.5.0-13318
20-standard
[InstallationError]
The installation transaction failed.
vibs = No ImageProfile found for live image
Please refer to the log file for more details.
~ # esxcli software profile update -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-5.5.0-133182
0-standard
[InstallationError]
No image profile is found on the host or image profile is empty. An image profile is required to install or remove VIBs. To install an image profile, use the esxcli image profile install command.
Please refer to the log file for more details.
~ #
Jesse Stacey says
sorry typo there. Vsphere -> Summary -> Host Profile says Unknown - no profile defined.
THP says
I have just seen this issue on 1 out of 23 host in a cluster I patched, this is about the only result I got from various web searches so I am assuming it is quite rare!
Even querying the profile via esxcli gets a null response back.
When I listed out the vibs it only had one vib installed even though the host boots fine.
If anyone knows of a resolution here I'd be very interested, I do have a case with VM so if it comes back with anything other than 'just rebuild' I'll come back and update this.
Ram says
Jess , did you had any solution for this ?
Well Loaded says
esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
does not produce any result dated 2015 despite the Jan and Feb patch releases. Has anything changed with the new year?
Thanks
lamw says
Really? It works for me, I see couple of patches for 2015
ESXi-5.5.0-20150104001-no-tools VMware, Inc. PartnerSupported
ESXi-5.5.0-20150204001-standard VMware, Inc. PartnerSupported
ESXi-5.5.0-20150101001s-no-tools VMware, Inc. PartnerSupported
ESXi-5.5.0-20150204001-no-tools VMware, Inc. PartnerSupported
ESXi-5.5.0-20150104001-standard VMware, Inc. PartnerSupported
ESXi-5.5.0-20150101001s-standard VMware, Inc. PartnerSupported
Well Loaded says
I swear they were not there last day (I had also used grep to avoid mistakes) and found nothing.
However I can see them today!
Thank you
misscloud says
hi
when patch an esxi, i got after esxcli software profile update -d, Message: host not changed.
Reboot Required: false
that proof the vib exist already?