Table of Contents
ESXi - Update ESXi Host on CLI
This page describes the update procedure of a standalone ESXi host on command line. The commands can be performed over SSH or on the ESXi Shell.
Check current Version
Get the version and build information about the host just to know what you are working on.
~ # esxcli system version get Product: VMware ESXi Version: 6.0.0 Build: Releasebuild-2494585 Update: 0 Patch: 0
Configure firewall for outgoing HTTP connections
To update your host with VIB's from the internet you have to allow httpClient in the firewall. You can check if the connections are alowed with the following command.
~ # esxcli network firewall ruleset list -r httpClient Name Enabled ---------- ------- httpClient true
If the command returns false you can allow it with the following command.
~ # esxcli network firewall ruleset set -r httpClient -e true
Get the latest profile name
Now you have to determine the profile you want to update to.
You can perform this action on command line.
~ # esxcli software sources profile list -d https://hostupdate.VMware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep ESXi-6 ESXi-6.0.0-20150404001-standard VMware, Inc. PartnerSupported ESXi-6.0.0-20150704001-standard VMware, Inc. PartnerSupported ESXi-6.0.0-20150704001-no-tools VMware, Inc. PartnerSupported ESXi-6.0.0-20150404001-no-tools VMware, Inc. PartnerSupported ESXi-6.0.0-2494585-standard VMware, Inc. PartnerSupported ESXi-6.0.0-20150504001-no-tools VMware, Inc. PartnerSupported ESXi-6.0.0-20150701001s-no-tools VMware, Inc. PartnerSupported ESXi-6.0.0-20150701001s-standard VMware, Inc. PartnerSupported ESXi-6.0.0-20150504001-standard VMware, Inc. PartnerSupported ESXi-6.0.0-2494585-no-tools VMware, Inc. PartnerSupported
There is a web page with detailed information about the updates, including VIB names with link, short description, imageprofile name and a lot more. I really like it. It is more comfortable to get the profile name on the web page than on CLI. VMware ESXi Patch Tracker
Stop running VM's
To update the host, you have to enter the maintenance mode which requires no running machines. So let's stop the running machines.
Show which VM's are running:
~ # esxcli vm process list my_vm_x World ID: 35930 Process ID: 0 VMX Cartel ID: 35699 UUID: 56 4d 67 bf 2c 52 e1 e0-33 1b 57 42 02 d8 d8 3b Display Name: my_vm_x Config File: /vmfs/volumes/5463f5fa-e9e1b35a-983d-6451066626e8/my_vm_x/my_vm_x.vmx my_vm_y World ID: 36398 Process ID: 0 VMX Cartel ID: 36397 UUID: 56 4d f9 f5 10 4e fa e0-42 e8 80 17 a2 bf b5 93 Display Name: my_vm_y Config File: /vmfs/volumes/5463f5fa-e9e1b35a-983d-6451066626e8/my_vm_y/my_vm_y.vmx
Now get the Vmid's of this VM's:
~ # vim-cmd vmsvc/getallvms Vmid Name File Guest OS Version Annotation 1 my_vm_x [my_host_storage1] my_vm_x/my_vm_x.vmx windows8Server64Guest vmx-11 11 my_vm_z [my_host_storage1] my_vm_z/my_vm_z.vmx solaris10_64Guest vmx-11 13 my_vm_y [my_host_storage1] my_vm_y/my_vm_y.vmx debian8_64Guest vmx-11
Repeat the following command with every Vmid of your running VM's:
~ # vim-cmd vmsvc/power.shutdown 1
I use the following one-liner to shutdown all my running vm's. Use it at your own risk.
~ # for vmid in $(vim-cmd vmsvc/getallvms | egrep "$(esxcli vm process list | grep "^[^ ]" | xargs | sed 's/ /|/g')" | awk '{ if($1 ~ /^[0-9]*$/ ) { print $1} }'); do vim-cmd vmsvc/power.shutdown $vmid; done
Set host to maintenance mode
Now set the host to maintenance mode:
~ # esxcli system maintenanceMode set -e true
If the command won't return, there are some problems entering maintenance mode. Probably some VM's are still running. Check and shutdown them on another SSH session or with VMware vSphere Client.
If the command returns you can check the current mode with the following command.
~ # esxcli system maintenanceMode get Enabled
Start upgrade process
Now you are ready to upgrade. Replace the profile name of the following command (ESXi-6.0.0-20150704001-standard) with your prefered profile name to upgrade to. It takes some minutes until the Update Result is displayed.
~ # esxcli software profile update -d https://hostupdate.VMware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.0.0-20150704001-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_esx-base_6.0.0-0.11.2809209, VMware_bootbank_lsu-lsi-lsi-mr3-plugin_1.0.0-2vmw.600.0.11.2809209, ... VIBs Removed: Hewlett-Packard_bootbank_scsi-hpsa_5.5.0.106-1OEM.550.0.0.1331820, LSI_bootbank_scsi-mpt2sas_15.10.06.00.1vmw-1OEM.550.0.0.1198610, ... VIBs Skipped: VMWARE_bootbank_mtip32xx-native_3.8.5-1vmw.600.0.0.2494585, VMware_bootbank_ata-pata-amd_0.3.10-3vmw.600.0.0.2494585, ...
Upgrade HP software and drivers
If you are using an HPE Server, you may want to upgrade all HP VIB's too.
The simplest way to do this, is to directly fetch the HP VIB repo data.
~ # esxcli software vib update -d https://vibsdepot.hpe.com/hpe/hpe-index.xml [MetadataDownloadError] Could not download from depot at https://vibsdepot.hpe.com/hpe/hpe-index.xml, skipping (('https://vibsdepot.hpe.com/hpe/hpe-index.xml', '', '[Errno 14] HTTP Error 404: Not Found')) url = https://vibsdepot.hpe.com/hpe/hpe-index.xml Please refer to the log file for more details.
But I bet it won't work for you, too. HP and VMware seemes to share their website developers and hosters, because the availability and performance of both sites is really bad.
Another way to upgrade is to download the depot and do an offline installation.
Download the depot ZIP file on https://my.VMware.com/. You will find it in the section “Custom ISOs”. It's name will be similar to “VMware-ESXi-6.0.0-Update2-3620759-HPE-600.U2.9.4.7.13-Mar2016-depot.zip”. Now you have to extract the ZIP file on a datastore which is accessible by your ESX (myDataStore).
Update the HP VIB's with the local depot.
~ # esxcli software vib update --depot=file:///vmfs/volumes/myDataStore/VMware-ESXi-6.0.0-Update2-3620759-HPE-600.U2.9.4.7.13-Mar2016-depot/index.xml Installation Result Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective. Reboot Required: true VIBs Installed: BRCM_bootbank_net-tg3_3.137l.v60.1-1OEM.600.0.0.2494585, EMU_bootbank_elxnet_10.5.121.7-1OEM.600.0.0.2159203, ... VIBs Removed: Broadcom_bootbank_misc-cnic-register_1.710.70.v55.1-1OEM.550.0.0.1331820, Broadcom_bootbank_net-bnx2_2.2.5f.v55.16-1OEM.550.0.0.1331820, ... VIBs Skipped: Hewlett-Packard_bootbank_char-hpcru_6.0.6.14-1OEM.600.0.0.2159203, Hewlett-Packard_bootbank_char-hpilo_600.9.0.2.8-1OEM.600.0.0.2159203, ...
Exit maintenance mode
You may want to exit the maintenance mode so your VM's will start automatically after reboot. This can be especially useful if your management machine is on this ESXi host and you update to another major version because it can occur that SSH is disabled after reboot.
Exit maintenance mode:
~ # esxcli system maintenanceMode set -e false
Check status:
~ # esxcli system maintenanceMode get Disabled
Reboot host
Reboot your host. You will loose your SSH connection to it.
~ # reboot ~ # Connection to my_host closed by remote host. Shared connection to my_host closed.
Reconnect to host
Restart your SSH connection to your host if it is back.
manu@automatix:~$ ssh my_host The time and date of this login have been sent to the system logs. VMware offers supported, powerful system administration tools. Please see www.VMware.com/go/sysadmintools for details. The ESXi Shell can be disabled by an administrative user. See the vSphere Security documentation for more information. ~ #
Check running version
Now check again your current ESXi host version. The output should differ from the last execution.
~ # esxcli system version get Product: VMware ESXi Version: 6.0.0 Build: Releasebuild-2809209 Update: 0 Patch: 11
Credits
- William Lam A Pretty Cool Method of Upgrading to ESXi 5.1.
- Andreas Peetz VMware ESXi Patch Tracker.
Update ESXi 6.0 HPE Custom Image to 6.5
Prerequisites
- ESXi 6.0 installed
- HPE Custom ESXi 6.5 Image downloaded and extracted to /vmfs/volumes/myDatastore/Sources/
- Host is in Maintenance Mode
Update Process
Get Image Profile
Get the name of the image profile in the downloaded depot (in this example: HPE-ESXi-6.5.0-OS-Release-650.9.6.0.28).
~ # esxcli software sources profile list --depot=file:///vmfs/volumes/myDatastore/Sources/VMware-ESXi-6.5.0-OS-Release-4564106-HPE-650.9.6.0.28-Nov2016-depot/index.xml Name Vendor Acceptance Level -------------------------------------- -------------------------- ---------------- HPE-ESXi-6.5.0-OS-Release-650.9.6.0.28 Hewlett Packard Enterprise PartnerSupported
Start Update
Execute the update command and replace the string after -p with the image profile name.
~ # esxcli software profile update --depot=file:///vmfs/volumes/myDatastore/Sources/VMware-ESXi-6.5.0-OS-Release-4564106-HPE-650.9.6.0.28-Nov2016-depot/index.xml -p HPE-ESXi-6.5.0-OS-Release-650.9.6.0.28 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: ELX_bootbank_elx-esx-libelxima.so_11.1.216.0-03, EMU_bootbank_elxiscsi_11.1.216.0-1OEM.650.0.0.4240417, .... VIBs Removed: EMU_bootbank_elxnet_11.1.145.0-1OEM.600.0.0.2768847, EMU_bootbank_lpfc_11.1.145.18-1OEM.600.0.0.2768847, EMU_bootbank_scsi-be2iscsi_11.1.145.8-1OEM.600.0.0.2494585, ... VIBs Skipped: Avago_bootbank_scsi-mpt2sas_15.10.06.00-1OEM.550.0.0.1331820, HPE_bootbank_conrep_6.0.0.01-02.00.1.2494585, HPE_bootbank_hpbootcfg_6.0.0.02-02.00.6.2494585, ...
Reboot the Host
~ # reboot
Update HPE Tools & Drivers - May 2017
~ # esxcli software vib update -d http://vibsdepot.hpe.com/hpe/may2017/index.xml Installation Result Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective. Reboot Required: true VIBs Installed: HPE_bootbank_hpe-ilo_650.10.0.2-2.4240417 VIBs Removed: HPE_bootbank_hpe-ilo_650.10.0.1-24.4240417 VIBs Skipped: HPE_bootbank_amshelper_650.10.6.0-24.4240417, HPE_bootbank_conrep_6.0.0.01-02.00.1.2494585, HPE_bootbank_hpbootcfg_6.0.0.02-02.00.6.2494585, HPE_bootbank_hpe-cru_650.6.5.8.24-1.4240417, HPE_bootbank_hpe-esxi-fc-enablement_650.2.6.10-4240417, HPE_bootbank_hpe-nmi_600.2.4.16-2494575, HPE_bootbank_hpe-smx-provider_650.03.11.00.17-4240417, HPE_bootbank_hponcfg_6.0.0.4.4-2.4.2494585, HPE_bootbank_hptestevent_6.0.0.01-01.00.5.2494585, HPE_bootbank_ssacli_2.60.18.0-6.0.0.2494585
Update to ESXi 6.5.0 U1 and HPE Drivers - InstallationError: No space left on device
The installation of version 6.5.0 update 1 stopped with the error “No space left on device”. I found some information to resolve this problem. reddit: Error trying to update an ESXi 6.5 Host to the brandnew release
[root@mfr-vx00:~] esxcli software profile update -d https://hostupdate.VMware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.5.0-20170702001-standard [InstallationError] [Errno 28] No space left on device vibs = VMware_locker_tools-light_6.5.0-0.23.5969300 Please refer to the log file for more details.
Download the VMware-Tools VIB file and copy it to a datastore which can be accessed by the esx host.
[root@my-client:~] cd /mnt/NASDatastore [root@my-client:/mnt/NASDatastore] wget "https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/esx/vmw/vib20/tools-light/VMware_locker_tools-light_6.5.0-0.23.5969300.vib"
Install the downloaded VIB file.
[root@my-host:~] esxcli software vib install -v /vmfs/volumes/NASDatastore/VMware_locker_tools-light_6.5.0-0.23.5969300.vib Installation Result Message: Operation finished successfully. Reboot Required: false VIBs Installed: VMware_locker_tools-light_6.5.0-0.23.5969300 VIBs Removed: VIBs Skipped:
Retry the installation. It should work now.
[root@my-host:~] esxcli software profile update -d https://hostupdate.VMware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml -p ESXi-6.5.0-20170702001-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: VMW_bootbank_i40en_1.3.1-5vmw.650.1.26.5969303, VMW_bootbank_igbn_0.1.0.0-14vmw.650.1.26.5969303, VMW_bootbank_ixgben_1.4.1-2vmw.650.1.26.5969303, ... VIBs Removed: QLogic_bootbank_qlnativefc_2.1.50.0-1OEM.600.0.0.2768847, VMW_bootbank_i40en_1.1.0-1vmw.650.0.0.4564106, VMW_bootbank_igbn_0.1.0.0-12vmw.650.0.0.4564106, ... VIBs Skipped: VMW_bootbank_ata-libata-92_3.00.9.2-16vmw.650.0.0.4564106, VMW_bootbank_ata-pata-amd_0.3.10-3vmw.650.0.0.4564106, ...
Update the HPE tools and drivers.
[root@my-host:~] esxcli software vib update -d http://vibsdepot.hpe.com/hpe/jul2017/index.xml Installation Result Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective. Reboot Required: true VIBs Installed: HPE_bootbank_amsd_650.11.1.0-24.4240417, HPE_bootbank_bootcfg_6.0.0.02-03.00.5.2494585, HPE_bootbank_conrep_6.0.0.02-00.00.12.2494585, ... VIBs Removed: HPE_bootbank_amshelper_650.10.6.0-24.4240417, HPE_bootbank_conrep_6.0.0.01-02.00.1.2494585, HPE_bootbank_hpbootcfg_6.0.0.02-02.00.6.2494585, ... VIBs Skipped:
Reboot the host.
[root@my-host:~] reboot
Update form ESXi 6.7U1 to 6.7U2 with the offline bundle
The offline bundle was downloaded and extracted to myDatastore/Sources/update-from-esxi6.7-6.7_update02/ on a NAS which is attached to the ESXi host.
[root@my-host:~] esxcli software vib update -d /vmfs/volumes/myDatastore/Sources/update-from-esxi6.7-6.7_update02/