Updating or patching ESXi hosts through the command line

Patches and updates for ESXi are combined in a bundle provided by VMware in a .zip format that includes some VIBs (ESXi software packages) containing fixes and updates. To proceed with the update, you need to obtain the latest available patches from the VMware website at the URL https://my.vmware.com/group/vmware/patch. Patches and upgrades are cumulative and the patch bundle is provided including all the previous security and critical updates.

Once the patch bundle has been downloaded, proceed with the following steps:

  1. From vSphere Client, log in to the ESXi host in order to upload the downloaded bundle to a local datastore reachable by the host. In the Navigator area, select Storage then select Datastores on the right side.
  2. From the available datastores, select the location on which you want to upload the patch and click Datastore browser.
  3. Create a new folder or select an existing folder then click the Upload button to upload the patch. Click Close when the upload has completed.

Alternatively, you can use a tool such as WinSCP to copy the patch bundle directly to a local datastore on the ESXi host. This may be an option if ESXi hosts to be patched in the network don't have access to the same shared storage.

  1. SSH the host using a tool such as PuTTY and log in to the host by entering the root credentials. If the SSH shell is not enabled, from vSphere Client, right-click the Host item and select Services | Enable Secure Shell (SSH) or enable the SSH service directly from the DCUI as discussed in Chapter 5, Configuring and Managing vSphere 6.5.
  2. Before patching the host, it can be useful to identify the currently installed build version by running the following command:
esxcli system version get
esxcli command used to get the system version
  1. Before applying the patch, the host must be put in Maintenance Mode in order to migrate running VM off the host and preventing new VMs to be placed in the hypervisor. To enter the host in Maintenance Mode, from the command line, run the following command:
esxcli system maintenanceMode set --enable true
  1. Make sure the ESXi is in Maintenance Mode, then proceed with the update procedure by running the following command:
esxcli software vib update -d /vmfs/volumes/datastore/patch_bundle.zip
 ESXi can be updated using esxcli commands
  1. When the patch has been applied successfully, you may need to reboot the host. Run the following command to reboot the host:
reboot
  1. When the ESXi host has rebooted, exit the host from Maintenance Mode with the following command:
esxcli system maintenanceMode set --enable false

The ESXi is now patched and available to host VMs.

To quickly put the host in Maintenance Mode using vSphere Client, right-click the Host item and select Enter Maintenance Mode.

  1. Check the host version after the update to confirm the update was successful by running the following command:
esxcli system version get
..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.144.77.71