Menu

Virtual Geek

Tales from real IT system administrators world and non-production environment

How to update a patch on an ESXi host via command line

When it comes to upgrade/update patches or ESXi version my preferred method is VMware Lifecycle manager / VMware update manager vum. But there are scenarios or issues while updating ESXi using VUM / LifeCyle manager or also this procedure helps if ESXi server is standalone and not managed by vCenter server. 

Source KB: https://kb.vmware.com/s/article/2008939 & VMware LifeCycle Manager import updates bundle and patch ESXi server

To start I have downloaded and uploaded to offline esxi patch bundle depot zip to ESXi datastore either using vSphere client or SCP tool (ie: WinScp, Note you will require to enable SSH on ESXi first).

vmware vsphere vcenter esxi datastore vmfs volumes guid upload files vmware esxi depot zip patch lifecycle manager update manager vum uploa winscp.png

This article can be also use to resolve below issues. 
VMware LifeCycle Manager There are conflicts from the patches selected for staging or remediation 
The host returns esxupdate error codes: -1. Check the Lifecycle Manager log files and esxupdate log files for more details.

Next step is to make sure you put ESXi server into Maintenance Mode, if ESXi server is a standalone shut down the VMs. You can use esxcli command to put server in maintenance mode.

esxcli system maintenanceMode get

esxcli system maintenanceMode set --enable=true

vmware vsphere esxi vcenter put esxi into maintenance mode esxcli system maintenanceMode get set --enabled=true enabled disabled esxi patching esx-update.png

Next verify the ESXi patch bundle depot zip file and what are the profiles (vib set) included in the patch bundle, I have two profiles one is standard and another is no-tools. 

esxcli software sources profile list -d /vmfs/volumes/guid/vmware-depot.zip 

vmware vsphere esxi vcenter esxcli software sources profile list -d esxi patch bundle depot list no-tools esxi upgrade cli esxcli update patch security critical.png

I will take no-tools profile to patch/upgrade Esxi host, once ESXi is upgraded successfully restart it.

esxcli software profile update -d /vmfs/volumes/guid/vmware-depot.zip -p esxi-profile

reboot -f

vmware vsphere esxi ssh esxcli software profile update -d vmfs volumes vmware esxi depot zip profile list upgrade update esxi cli ssh console automate.png

Useful Article
Deploy install VCSA (vCenter server appliance 6.5) on VMWare Workstation
Enable or disable SSH on VMWare vCenter Server Appliance (VCSA)
The top 10 reasons to upgrade to VMware vSphere 6.5
vCenter server appliance 6.5 deployment Error The supplied system is not valid
How to deploy vCenter server appliance on VMware Workstation
Enable Access to the VCSA Bash shell or Appliance Shell
Patching the vCenter Server Appliance VCSA
Install and Configure VMware UMDS on Linux

Go Back

Comment

Blog Search

Page Views

12278741

Follow me on Blogarama