ESXi Host update commands with vCLI

ESXi 5.0 and newer, local with SSH

esxcli software vib update -d "/vmfs/volumes/Datastore/"
ESXi 5.0 and newer remote

esxcli --server= --username=root software vib update --depot=/vmfs/volumes/datastore1/
ESXi 4.1 and older

Updating a standalone ESXi host with vSphere CLI and vihostupdate

If you not using VMware Update Manager but you have mulitple ESX/ESXI servers managed by vCenter server you should install and configure it, as it will save you a so much time and its so simple.
However if you have hosts that are not managed by vCenter server or the odd standalone host you need a way of installing updates from VMware as they are released to ensure security compliance and system reliability.

The best way I find of updating a standalone host is to use the VMware vSphere CLI.

1. If you dont have VMware vSphere CLI, download and install it onto your client PC

2. Download your required patches (Always only get direct from VMware)
You can also subscribe to email alerts when updates are released.

3. Put the ESX/ESXi host into Maintenance Mode
If there are any VMs running on the host you will need to shut them down and power them on another host (If possible). I assume they cannot be vMotioned to another host as this would require vCenter, in which case why aren’t you using VMware Update Manager?! Its free with vCenter.

3. Open a VMware vSphere CLI command prompt
C:\Program Files (x86)\VMware\VMware vSphere CLI\bin>

4. Run the script to update the host with the downloaded file.
C:\Program Files (x86)\VMware\VMware vSphere CLI\bin> -i -b c:\Temp\ --server=thunder
Enter username: root
Enter password:
Please wait patch installation is in progress …
The update completed successfully, but the system needs to be rebooted for the changes to be effective.

5. Your will see in the vSphere client the update is installed on the host.

6. Reboot your ESX/ESXi host
Job done. You will now see the build number has changed on that host to confirm the update the update has been installed.

NOTE: If you fail to put the host into maintenance mode you will see the error below and it will not allow the update to install: -i -b c:\Temp\ --server=thunder
Enter username: root
Enter password:
Please wait patch installation is in progress …
Maintenance mode is not enabled or could not be determined.The following VIBs require this host to be in maintenance mode: deb_vmware-esx-firmware_4.1.0-0.1.320092. Please put the host in maintenance mode to proceed.

C:\Program Files (x86)\VMware\VMware vSphere CLI\bin> -help

Synopsis: C:\Program Files (x86)\VMware\VMware vSphere CLI\bin\ OPTIONS

Command-specific options:

Parameter to specify the selective bulletin(s) to install. Use
comma to specify multiple bulletins (eg. bulletin1,bulletin2).
All bulletins will be installed if this option is not specified.


Parameter to specify the location of the offline bundle. For install operation, multiple
offline bundles can be specified using comma separator with no space (eg. bundle1,bundle2).


Install the host with selective bulletins from the bundle, the depot or local offline bundle.


List the bulletins in the bundle or in the depot.


Parameter to specify the location of the depot


Ignore integrity checking during install operation (unsupported).


Query the bulletins that are already installed in the host.


Remove selective bulletins from the host.


Scan the host against the bundle or the depot for applicable bullet

Common VI options:
--config (variable VI_CONFIG)
Location of the VI Perl configuration file
--credstore (variable VI_CREDSTORE)
Name of the credential store file defaults to <HOME>/.vmware/credstore/vicredentials.xml on Linux and <APPDATA>/VMware/credstore/vicredentials.xml on Windows
--encoding (variable VI_ENCODING, default ‘utf8’)
Encoding: utf8, cp936 (Simplified Chinese), iso-8859-1 (German), shiftjis(Japanese)
Display usage information for the script
--passthroughauth (variable VI_PASSTHROUGHAUTH)
Attempt to use pass-through authentication
--passthroughauthpackage (variable VI_PASSTHROUGHAUTHPACKAGE, default ‘Negotiate’)
Pass-through authentication negotiation package
--password (variable VI_PASSWORD)
--portnumber (variable VI_PORTNUMBER)
Port used to connect to server
--protocol (variable VI_PROTOCOL, default ‘https’)
Protocol used to connect to server
--savesessionfile (variable VI_SAVESESSIONFILE)
File to save session ID/cookie to utilize
--server (variable VI_SERVER, default ‘localhost’)
VI server to connect to. Required if url is not present
--servicepath (variable VI_SERVICEPATH, default ‘/sdk/webService’)
Service path used to connect to server
--sessionfile (variable VI_SESSIONFILE)
File containing session ID/cookie to utilize
--url (variable VI_URL)
VI SDK URL to connect to. Required if server is not present
--username (variable VI_USERNAME)
--verbose (variable VI_VERBOSE)
Display additional debugging information
Display version information for the script

  1. Somehow Worldpress doesn’t display code default very well 👿
    Changed it with the code switch 😉

Leave a Comment

NOTE - You can use these HTML tags and attributes:
<a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <s> <strike> <strong>