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
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
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.
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.
Log into Prism Element UI.
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:
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:
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>
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.
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:
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:
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_18.104.22.168_Bundle .zip -p VMware-ESXi-6.5.0-10719125-Custom-Cisco-22.214.171.124 --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.