Matt Calvert's Blog

Upgrading a VMware ESXi host from the command line

Using Profiles

Standalone ESXi servers can also be updated or upgraded via SSH. You don’t need to have a vCenter server, it just makes it easier ;)

It will require that all of the virtual machines on the ESXi server be powered off however, and the ESXi server will likely require a reboot.

The ESXi server will require an outbound internet connection to retrieve patches, and a full backup of all servers is highly recommended!!

esxcli network firewall ruleset set --enabled true --ruleset-id=httpClient
esxcli software sources profile list -d | grep -i ESXi-6.5
ESXi-6.5.0-20170304001-no-tools   VMware, Inc.  PartnerSupported
ESXi-6.5.0-20170104001-standard   VMware, Inc.  PartnerSupported
ESXi-6.5.0-20170304001-standard   VMware, Inc.  PartnerSupported
ESXi-6.5.0-20170301001s-no-tools  VMware, Inc.  PartnerSupported
ESXi-6.5.0-20170301001s-standard  VMware, Inc.  PartnerSupported
ESXi-6.5.0-20170104001-no-tools   VMware, Inc.  PartnerSupported
ESXi-6.5.0-4564106-standard       VMware, Inc.  PartnerSupported
ESXi-6.5.0-4564106-no-tools       VMware, Inc.  PartnerSupported
esxcli software profile update -p ESXi-6.5.0-20170304001-standard -d
esxcli system maintenanceMode set --enable true
esxcli system shutdown reboot --reason "Software update to ESXi-6.5.0-20170304001-standard"

Using individual patches

If you have a specific patch you want to install, this can also be done via SSH. The recommendation is to do this with all of the virtual machines powered down and the host in Maintenance Mode.

You can either SCP the patch to the server, or you can retrieve it using WGET. Here we’ll retrieve it using WGET

esxcli system maintenanceMode set --enable true
wget -P /vmfs/volumes/vhost-01a-local-datastore
esxcli software vib install -d /vmfs/volumes/vhost-01a-local-datastore/
esxcli system shutdown reboot -r 'Replace LSI Logic Megaraid driver to 6.603.55.00.1vmw on the VMware HCL'
esxcli system maintenanceMode set --enable false