Upgrading, updating or applying a patch to ESXi host using esxcli command
search cancel

Upgrading, updating or applying a patch to ESXi host using esxcli command

book

Article ID: 390985

calendar_today

Updated On:

Products

VMware vSphere ESXi

Issue/Introduction

Providing the way to upgrade, update or apply a patch to ESXi with esxcli command.

Environment

  • vSphere ESXi 7.x
  • vSphere ESXi 8.x

Resolution

[ Before Start ]

[ Preparation ]


[ Steps for upgrading, updating or applying a patch to ESXi ]

All commands in the below steps should be done in the target ESXi shell.

  1. Put the target ESXi host into maintenance mode.
    In vSphere Client, right click the ESXi host > Maintenance Mode > Enter Maintenance Mode

    You need to shutdown or migrate off all the VMs running on the target ESXi host to put it maintenace mode.
    If the target ESXi host is a part of DRS enabled cluster, DRS will automatically migrate off all the VMs after initiating putting the ESXi host into maintenace mode.
    When vCLS is running on the target ESXi host, vCenter Server will automatically migrate off or shutdown the vCLS VM. You should not manually migrate off or shutdown/power off vCLS VMs unless Broadcom VCF Global Support instructs to do so.


  2. Confirm that the ESXi host is in the maintenance mode by the following command.
    vim-cmd hostsvc/hostsummary |grep inMaintenanceMode


  3. Check the profile names in the offline bundle by the following command.
    esxcli software sources profile list -d /vmfs/volumes/DATASTORE_NAME/OFFLINE_BUNDLE.zip

    Replace DATASTORE_NAME and OFFLINE_BUNDLE.zip with the corresponding ones in your environment.

    • When there are multiple profiles in the VMware original offline bundle, the differences are described in the release notes.
      Example) VMware ESXi 8.0 Update 3b Release Notes

      Common explanations for profiles in VMware original offline bundles
      Name format Profile name example  Explanation
      ESXi-#.#U#[a-z]-buildnumber-standard ESXi-8.0U3b-24280767-standard Security and Bugfix image
      with updates of VMware Tools imanges in ESXi host (most common)
      ESXi-#.#U#[a-z]-buildnumber-no-tools ESXi-8.0U3b-24280767-no-tools Security and Bugfix image
      without updates of VMware Tools images in ESXi host 
      ESXi-#.#U#s[a-z]-buildnumber-standard ESXi-8.0U3sb-24262298-standard Security only image
      with updates of VMware Tools images in ESXi host
      ESXi-#.#U#s[a-z]-buildnumber-no-tools ESXi-8.0U3sb-24262298-no-tools Security only image
      without updates of VMware Tools images in ESXi host


    • When there are multiple profiles in the custome offline bundle, please contact the hardware vendor for the difference of them if needed. 

  4. Apply the profile to the ESXi by the following command.
    esxcli software profile update -d /vmfs/volumes/DATASTORE_NAME/OFFLINE_BUNDLE.zip -p PROFILE_NAME

    Replace DATASTORE_NAME and OFFLINE_BUNDLE.zip with the corresponding ones in your environment.
    Replace PROFILE_NAME with the name of profile you apply to the ESXi, which you checked in step 3.

    Note, this command might take a few minutes to complete.

     

  5. When there is no error in the step 4 command, reboot the ESXi host to complete the upgrading, updating or applying a patch to the ESXi.
    You can use the following command to reboot the ESXi host.
    reboot


  6. Wait for the completion of the ESXi boot.

    Do not power off the ESXi or the physical server ESXi is installed before the completion of the boot.
    Upgrading, updating or applying a patch to ESXi is not finished until the completion of the ESXi booting of the reboot done in step 5.


  7. Exit the maintenace mode.
    In vSphere Client, right click the target ESXi host > Maintenance Mode > Exit Maintenance Mode

 

 

 

Additional Information

For information about rollback, see Reverting to a previous version of ESXi 6.x, 7.x and 8.x
Note, the rollback by the above KB sometimes cannot be used in some enviromnents. See Cannot revert ESXi version when upgrading from 7.0 to 8.0

When you cannot use the rollback, you can still re-install the old ESXi version and restore the configuration from its backup taken in the preparation section.
For information about restoring the configuration, see How to back up and restore the ESXi host configuration