• Anwar Khan

How to Patch an ESXi Host Using esxcli

Objective: The objective will be to show you how to perform a patch on your ESXi host. Some of the preliminary work was done in prism element and vSphere UIs but the patch update is performed in esxcli. If you have additional questions not answered in this how-to, please refer to VMware release notes and interoperability matrices listed below.  



Purpose: ESXi patch update


vSphere: https://vSphere_URL


Prism Element: https://PRISM_ELEMENT_URL:9440 (lite management tool)

Current ESXi version: VMware ESXi 6.7, Patch Release ESXi670-201914001

Target ESXi  version: VMware ESXi 6.7, Patch Release ESXi670-202006001

Release notes: https://docs.vmware.com/en/VMware-vSphere/6.7/rn/esxi670-202006001.html

Interoperability Matrices: https://www.vmware.com/resources/compatibility/sim/interop_matrix.php

Review interoperability matrices and release notes prior to the upgrade to ensure your upgrade path is supported by VMware.  

  1. Once you’ve ensured your upgrade path is supported by VMware, perform a health check (NCC) and ensure Data Resiliency (should be in GREEN and rebuild capacity should display YES) on the cluster before performing any upgrades\updates. 

  2. Log into Prism Element UI. 

  3. Ensure Data Resiliency status. You should see the green OK and rebuild capacity available should say YES. 



4. Run NCC.

5. To understand more on running Nutanix Consistency Checks, click HERE. 


6. Migrate VMs to another host: Highlight Node>VMs Tab>Highlight VMs>Right click selected VMs>Migrate>Follow the vMotion wizard

7. Log into the host via SSH (I use MobaXterm)


8. Run this command and make sure that the bootbank should not point to tmp folder:

ls -ltrh

9. Upload the .zip file to the datastore.

10. Power off the CVM on the host:

Highlight Node>VMs Tab>Right Click CVM>Power>Power Off

11. Put the host in maintenance mode:

Right Click Node>Maintenance Mode>Enter Maintenance Mode

12. Take backup of the host configuration using:

vim-cmd hostsvc/firmware/sync_config vim-cmd hostsvc/firmware/backup_config

Note: The command should output a URL in which a web browser may be used to download the file. For example:

Bundle can be downloaded at : http://*/downloads/123456/configBundle- xx.xx.xx.xx.tgz Where * denotes the host IP/FQDN. The backup file is also located in the /scratch/downloads directory as configBundle- HostFQDN.tgz

13. Browse to that datastore location using the following command:

cd /vmfs/volumes/datastore_name/folder_name/file.zip

14. Run this command to list the profiles:

esxcli software sources profile list -d <absolute path of the .zip file>

esxcli software sources profile list -d /vmfs/volumes/datastore_name/folder_name/file.zip


15. Choose profile that says -standard and run this command against it:

esxcli software profile update   -d <absolute path of the .zip file> -p <output from 14>

For example:

esxcli software profile update   -d  /vmfs/volumes/5h33n444/ESXi-6.7.0- 20200606001.zip  -p ESXi-6.7.0-20200604001-standard


16. When the upgrade is successful, you will see the following:

17. Run this command to reboot the host.

Reboot


18. Exit Maintenance mode:

Right Click Node>Maintenance Mode>Exit Maintenance Mode


20. If you encountered dependency errors or conflicting vibs errors during the patch update, then you may run the below commands to check whether the vibs are in use or not:

sxcfg-scsidevs -a

esxcfg-nics -l


21. If you encountered dependency errors or conflicting  vibs errors during the patch update, then you may run the below commands to check whether the vibs are in use or not:

sxcfg-scsidevs -a

esxcfg-nics -l


22. If the vibs are not in use then we can try the following:

esxcli software profile install -d /vmfs/volumes/583f4e1c-a5c53f88-56ef-

0025b57cac15/VMware_ESXi_6.7.0_10719125_Custom_Cisco_6.5.2.3_Bundle .zip -p VMware-ESXi-6.5.0-10719125-Custom-Cisco-6.5.2.3 --ok-to-remove


23. Migrate VMs back onto the host:

Highlight Node>VMs Tab>Highlight VMs>Right click selected VMs>Migrate>Follow the vMotion wizard


24. Ensure Data Resiliency status. You should see the green OK and rebuild capacity available should say YES.


25. Run NCC.

53 views0 comments