Windows OS Hub
  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu
  • Home
  • About

Windows OS Hub

  • Windows Server
    • Windows Server 2022
    • Windows Server 2019
    • Windows Server 2016
    • Windows Server 2012 R2
    • Windows Server 2008 R2
    • SCCM
  • Active Directory
    • Active Directory Domain Services (AD DS)
    • Group Policies
  • Windows Clients
    • Windows 11
    • Windows 10
    • Windows 8
    • Windows 7
    • Windows XP
    • MS Office
    • Outlook
  • Virtualization
    • VMWare
    • Hyper-V
    • KVM
  • PowerShell
  • Exchange
  • Cloud
    • Azure
    • Microsoft 365
    • Office 365
  • Linux
    • CentOS
    • RHEL
    • Ubuntu

 Windows OS Hub / Virtualization / VMWare / Updating VMware ESXi Host from the Command Line

May 10, 2023 VirtualizationVMWare

Updating VMware ESXi Host from the Command Line

In this article, we’ll show how to manually patch a VMware host from the command line, and how to upgrade your ESXi version (in this example, we will upgrade a VMware ESXi 6.7 host to version 7.0).

You can manually update VMware ESXi from the esxcli console on standalone ESXi hosts (or free VMware vSphere Hypervisor), small installations, or test environments. To update a large VMware vSphere infrastructure with vCenter, it is better to use VMware Update Manager/VMware Lifecycle Manager.

Contents:
  • How to Install Updates (Patches) on VMware ESXi with ESXCLI Command?
  • Upgrading VMware ESXi Version Using ESXCLI

Check the current ESXi version installed on your server. You can do it in the vSphere Web Client:

vSphere Web Client - get esxi version

Or from the ESXi console using the command:

vmware -v

vmware -v : check version with cli

In this example, VMware ESXi 6.7.0 build-1716773 is installed on the server.

How to Install Updates (Patches) on VMware ESXi with ESXCLI Command?

If you want to install security updates/bug fixes/patches on your ESXi host, download the latest patch release for your OS version.

ESXi patches are cumulative, which means they include all previous updates. Always install the latest available update for your ESXi release.

To install the ESXi rollup update offline:

  1. Sign in to the VMware website (you can use a personal account) and go to https://my.vmware.com/group/vmware/patch;
  2. Select a product: ESXi (Embedded and Installable) and your ESXi build;
  3. The latest available update is ESXi670-202201001 (Build Number: 19195723) with the release date 2022-01-25; download patch (update) for esxi from vmware website
  4. Download a ZIP file with the update;
  5. Use the Datastore Browser to copy the archive to any datastore available to your host (it may be a local disk, an NFS folder, a VMFS LUN connected over iSCSI or Fiber Channel, or an external USB drive connected to your ESXi host). If there is not enough free space, expand the VMFS datastore; copy esxi patch to datastore
  6. Connect to your ESXi host via SSH and put the host in the maintenance mode: esxcli system maintenanceMode set --enable=true
  7. To install the patch, run the command: esxcli software vib update --depot /vmfs/volumes/87654321-12345678-7a20-000c12345678/update/ESXi670-202111001.zip esxcli install esxi update from command line
    Message: The update completed successfully, but the system needs to be rebooted for the changes to be effective.
    Reboot Required: true
  8. Reboot your ESXi host: reboot -f
  9. Disable the maintenance mode: esxcli system maintenanceMode set --enable=false
  10. Make sure that the OS version has been updated: vmware –v
You can also use the PowerCLI module to install updates on ESXi:

Install-VMHostPatch -HostPath /vmfs/volumes/volume/esxi_patch.zip

Upgrading VMware ESXi Version Using ESXCLI

You can manually upgrade the ESXi version on your host. In this example, I will upgrade ESXi from v6.7 to v7.0.

  • If you are going to upgrade your ESXi version, make sure that your server hardware is supported by the newer OS version. Use VMware Compatibility Guide and VMware Product Interoperability Matrix to do it.
  • If the host is connected to a vCenter, do not upgrade the ESXi version before upgrading the vCSA version.

There are two ways to upgrade the ESXi version from the esxcli command line:

  • An offline upgrade — you must manually download an ESXi installation image to the local datastore;
  • An online upgrade — may be used if your ESXi can access the VMware repository via the Internet.

First of all, let’s look at how to perform an offline upgrade. Download an offline ESXi image:

  1. Go to https://customerconnect.vmware.com/downloads/info/slug/datacenter_cloud_infrastructure/vmware_vsphere/7_0;
  2. Find the VMware ESXi version you want to upgrade to. If you are using a custom ESXi image from the vendor, go to the Custom ISOs tab. In my example, I will use the HPE — HPE Custom Image for ESXi 7.0 U2 Install CD image. Download HPE Custom Image for ESXi 7.0 U2 Offline Bundle. download custom esxi install image for hpe servers
  3. Copy the image to any datastore available from your ESXi host;
  4. Display the list of available profiles in the image: esxcli software sources profile list -d /vmfs/volumes/datastore1/update/VMware-ESXi-7.0.2-17867351-HPE-702.0.0.10.7.0.52-May2021-depot.zip
  5. In our example, there is only one profile: HPE-Custom-AddOn_702.0.0.10.7.0-52;
  6. Put the host into maintenance mod: esxcli system maintenanceMode set --enable=true
  7. Upgrade the ESXi version using the selected profile: esxcli software profile update -d /vmfs/volumes/datastore1/update/VMware-ESXi-7.0.2-17867351-HPE-702.0.0.10.7.0.52-May2021-depot.zip -p HPE-Custom-AddOn_702.0.0.10.7.0-52
    If [Errno 28] No space left on device error appears, follow this guide.
  8. In my case, the command returned that the CPU model is not supported in the following versions:
  9. [HardwareError]
    Hardware precheck of profile HPE-Custom-AddOn_702.0.0.10.7.0-52 failed with warnings: <CPU_SUPPORT WARNING: The CPU in this host may not be supported in future ESXi releases. Please plan accordingly.>
    

    xcli software profile update via internet

  10. To ignore this warning, add the —no-hardware-warning option to the command: esxcli software profile update -d /vmfs/volumes/datastore1/update/VMware-ESXi-7.0.2-17867351-HPE-702.0.0.10.7.0.52-May2021-depot.zip -p HPE-Custom-AddOn_702.0.0.10.7.0-52 --no-hardware-warning
    If any dependency errors appear, you can ignore them using -f option. However, it may result in unexpected issues later when running ESXi. It is better to resolve dependencies and add a driver you need to the ESXi installation image.
    [DependencyError]
    VIB VMW_bootbank_vmkusb_0.1-4vmw.670.3.159.18828794 requires vmkapi_incompat_2_5_0_0, but the requirement cannot be satisfied within the ImageProfile. 
    

  11. Reboot the host after the upgrade is complete;
  12. Check that the server is now running the new ESXi 7.0 Update 2; upgrade vmware esxi to new version
  13. Install the vSphere license and configure the inactivity timeout.

To upgrade an ESXi version online:

  1. Allow HTTP traffic in the ESXi firewall: esxcli network firewall ruleset set -e true -r httpClient
  2. View a list of available ESXi profiles in the VMware online depot: esxcli software sources profile list -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml | grep -i ESXi-7.0
  3. Find the name of the profile you need and upgrade the ESXi version: esxcli software profile update -p HPE-Custom-AddOn_702.0.0.10.7.0-52 -d https://hostupdate.vmware.com/software/VUM/PRODUCTION/main/vmw-depot-index.xml
  4. Disable HTTP Internet access: esxcli network firewall ruleset set -e false -r httpClient

In this article, we looked at how to install patches on a VMware ESXi host and update an OS version on your server from ESXi 6.7 to vSphere 7.0U2.

3 comments
0
Facebook Twitter Google + Pinterest
previous post
Enable or Disable MFA for Users in Azure/Microsoft 365
next post
Deploying Software (MSI Packages) Using Group Policy

Related Reading

Reset Root Password in VMware ESXi

October 12, 2023

How to Fix ‘An Operating System Wasn’t Found’...

July 14, 2023

Unmounting an NFS Datastore from VMware ESXi

April 21, 2023

How to Increase Virtual Machine Disk Size in...

April 6, 2023

How to Install Free VMware Hypervisor (ESXi)

January 24, 2023

3 comments

M November 18, 2022 - 7:34 am

A great write up. Downn to the point without any fuss.
Thank you very much!

Reply
Mortaza Kamal Nourestani December 8, 2022 - 7:40 pm

how old is your HP Server? mine is G8 and I am bit hesitant to use V7

Reply
Lane February 19, 2023 - 6:09 am

Great article. Very clear and to the point (and it worked for us!!)

Reply

Leave a Comment Cancel Reply

Categories

  • Active Directory
  • Group Policies
  • Exchange Server
  • Microsoft 365
  • Azure
  • Windows 11
  • Windows 10
  • Windows Server 2022
  • Windows Server 2019
  • Windows Server 2016
  • PowerShell
  • VMWare
  • Hyper-V
  • Linux
  • MS Office

Recent Posts

  • How to Connect VPN Before Windows Logon

    November 14, 2023
  • Removing Azure Arc Setup Feature on Windows Server 2022

    November 9, 2023
  • Using WPAD (Web Proxy Auto-Discovery Protocol) on Windows

    November 7, 2023
  • Send Emails with Microsoft Graph API and PowerShell

    November 6, 2023
  • Zabbix: How to Get Data from PowerShell Scripts

    October 27, 2023
  • Tracking Printer Usage with Windows Event Viewer Logs

    October 19, 2023
  • PowerShell: Configure Certificate-Based Authentication for Exchange Online (Azure)

    October 15, 2023
  • Reset Root Password in VMware ESXi

    October 12, 2023
  • How to Query and Change Teams User Presence Status with PowerShell

    October 8, 2023
  • How to Increase Size of Disk Partition in Ubuntu

    October 5, 2023

Follow us

  • Facebook
  • Twitter
  • Telegram
Popular Posts
  • Adding Drivers into VMWare ESXi Installation Image
  • How to Fix ‘An Operating System Wasn’t Found’ Error on Windows
  • Shrinking VMDK Virtual Disk Size on VMWare ESXi
  • How to Access VMFS Datastore from Linux, Windows, or ESXi
  • Hyper-V Virtual Machine Stuck in Stopping/Starting State
  • Recovering a Deleted VMFS Datastore on VMware ESXi/vSphere
  • Updating Windows VM Templates on VMWare with PowerShell
Footer Logo

@2014 - 2023 - Windows OS Hub. All about operating systems for sysadmins


Back To Top