Step-by-step guide: How to Upgrade an ESXi host from the Command Line
Are you looking for an easy way how to upgrade ESXi host from the command line? Or maybe you’re just looking for a quick guide to get started. In either case, you came to the right place.
Upgrading ESXi hosts is pretty straightforward, but you can speed up the process using the command line. This guide shows you how to upgrade an ESXi host from the command line and save time while increasing your chances of success.
When is an upgrade via the command line the only way?
Example / Details
Sometimes, your server or RAID controller is no longer supported with the latest ESXi ISO. This means Vmware has more likely removed the VIB driver of your RAID controller. When you try installing from the ISO, ESXi will not recognize your RAID controller and therefore have no way to install ESXi to your server.
An option is to install an older ESXi version that still supports the RAID controller. After that, you can upgrade ESXi via the command line to the latest version.
Of course, you could integrate the VIB driver into the ISO and install the latest version immediately. However, I figured out that going the way with first installing a supported ESXi version is much easier.
The option with the command line is also the preferred method when you don’t have access to the server because it is a remote location. The only requirement is that you have a computer on-site, preferable to a physical machine.
Getting ready to upgrade VMware ESXi host
Upgrade requirements / image profile
There are no update requirements. Your host should, however, still be supported with the latest version of ESXi. However, it is not required since the upgrade process keeps any custom VIB drive installed.
You need to have access to my Vmware portal and have a login to download the latest zip (image profile) version from Vmware.
What steps are involved in how to upgrade ESXi host from the command line?
In a nutshell:
A few steps must be followed to upgrade an ESXi host remotely. First, you’ll need to download the latest version of ESXi from VMware’s patch portal and then upload it to your datastore. Once it’s uploaded, you can put the host into maintenance mode with either the UI or CLI. After that, you can upgrade your host from the command line using a compatible profile. Finally, reboot your host once the update is complete.
and now, in more detail the steps about how to upgrade ESXi host.
Download the ESXi Upgrade file called Offline Bundle from the VMware Portal. You need to have a valid Vmware login. I find the files are not easy to find. Here is the direct download link to VMware vSphere. The ESXi hypervisor is what you are looking for. There isn’t a difference between the Hypervisor Edition and ESXi. It is the same file.
Upload the zip file to your ESXi host. There are two ways, use the web browser or an SCP client like WinSCP. I prefer the web browser method.
Put the host in maintenance mode. The easiest way is to use the web browser. Right-click the host and choose ‘enter maintenance mode’. Prior to that, you need to move all VMs to another host or shutdown all VMs.
Now it is time to ssh into the host for the upgrade process using the command line. I use Putty (Windows) or Terminus (MAC) as my go-to ssh client.
By default, ssh is disabled on ESXi hosts. You need to start the service using the web GUI.
It is also possible to put the host in maintenance mode using ssh, below is the command
esxcli system maintenanceMode set –enable true.
We need to locate the uploaded zip file in step 2 in order to identify the correct path naming. Type
This is the location where ESXi stores the datastores.
In the picture above you notice the ‘datastore’ is a symlink followed by the real path, which you see also at the bottom of the picture. Knowing this information we can now execute the upgrade command.
esxcli software sources profile list -d /vmfs/volumes//62ab518c-47c98334-f7ff-0cc47a6c43c4/VMware-ESXi-7.0U3d-19482537-depot.zip
Here you see now all the profile images in the offline bundle. Which one shall I choose?
- ESXi7-OU3d standard – Contains all patches
- ESXi7-OU3d no-tools – Contains all patches but no VMware Tools
- ESXi7-OU3ds-standard – Contains security patches only
- ESXi7-OU3ds-no-tools – Contains security patches only and no VMware Tools
so the image profile with ‘s” are security patches only.
For a detailed explanation of the ESXi profile image please visit the website of virten.net.
We want to install the standard image profile with all patches, In this case it is ESXi7-OU3d.
Please note for simplicity I didn’t write down the number
esxcli software profile update -d /vmfs/volumes/datastore1/VMware-ESXi-7.0.0-15843807-depot.zip -p ESXi-7.0U3d-19482537-standard
In case you have some hardware, which is no longer supported, you will get a warning message. See the command below to force the upgrade with the ‘–no-hardware-warning’ switch.
esxcli software profile update -d /vmfs/volumes//62ab518c-47c98334-f7ff-0cc47a6c43c4/VMware-ESXi-7.0U3d-19482537-depot.zip -p ESXi-7.0U3d-19482537-standard --no-hardware-warning
When the update is successful you will see this message
The update completed successfully, but the system needs to be rebooted for the changes to be effective.
Step 6 (last step for how to upgrade ESXi host)
Reboot the host using this command
You can also reboot the host from the web GUI. After the reboot, you should notice the new ESXi version number in the Web GUI. Please don’t forget to exit the host from the maintenance mode and also stop the ssh service. The ssh service should never run when you don’t need it. VMware will also indicate a warning in the GUI when the ssh service is running.
What are the Vmware update methods other than from the command line?
Yes, there are a few alternative methods for upgrading an ESXi host. One is to use the ISO image, which you can download from VMware’s website (see picture above). You can then create a USB boot drive and directly boot the host from the USB stick. You need to have physical access to the server. As mentioned above, in some cases, this is not even an option for upgrading the ESXi host.
Another method is to upgrade your host using vSphere Lifecycle Manager (previously vSphere Update manager). It requires Vmware Vcenter. If you have only the Essential Kit licensed, this is not even an option.
What are the benefits of upgrading an ESXi host from the command line?
Some benefits of upgrading an ESXi host from the command line include the ability to more easily automate the process and the ability to avoid potential GUI-related issues. Additionally, upgrading from the command line can be faster and more reliable than using the vSphere Client or vSphere Web Client.
- no need to shut down the host first
- no physical presence is required
- easier management
- enhanced security
What are the ways to upgrade ESXi host to 7 from Vmware 6.7?
There are two ways to upgrade an ESXi host to version 6.7 or 7.0. The first way is by using the VMware Update Manager (VUM). The second way is by using the esxcli command from the vSphere Shell.
What is the command for patching an ESXi host?
esxcli software profile update
Updating an ESXi host is a straightforward process. You will need to use the command esxcli software vib update. Before you run this command, however, you must put your host into maintenance mode. This can be done from the vSphere Client or from the CLI. Once your host is in maintenance mode, you can then run the esxcli software profile update command to install the patch. The process should not take more than a few minutes to complete.
ESXi is a powerful and widely used virtualization platform, and keeping it up to date is important for security and stability. While it’s possible to upgrade ESXi hosts using the vSphere Client or web interface, some environments or situations may require upgrading from the command line.
With just a few simple steps, you can easily keep your ESXi hosts up to date from the command line.
Thanks for reading! Questions or comments? Let me know in the comments below or email me at firstname.lastname@example.org
Any purchases made from clicks on links to products on this page may result in an affiliate commission for me.
As an Amazon Associate I earn from qualifying purchases
Als Amazon-Partner verdiene ich an qualifizierten Verkäufen