

After each new version of VMware vSphere, you have to do two things. First, upgrade VMware tools in all your Virtual Machines (VMs) and upgrade the VM compatibility.

The VM compatibility is not mandatory, but as you know, every VMware vSphere release brings new features and functions, and those are usually only available for VMs configured with the latest virtual hardware. Current virtual hardware is version 16, and I assume that the next one will be version 17 in the vSphere NEXT.

If you want to benefit from the latest features of vSphere, you have to upgrade the VM hardware and its VM compatibility.

The title of this blog post lets you assume that we will try to automate if we have many VMs and we have to do a lot of repetitive upgrade tasks in order to benefit from the latest features.

However, take note that, as you can imagine, with an automated process, there is a small chance that something might not go as expected. Error or fail during the process, this can happen, but it is rather rare and usually there might be something else which is currently running inside of the VM which prevents the process to finish with success.

Usually, this is not very important as there is only a low risk. The only thing if the automated install fails is that the admin will have to re-install the VMware tools manually.

While this might happen on a couple of VMs within the environment, the majority should be just fine.

The VM which needs the new VMware tools usually looks like this.

Newer version of VMware tools available

The steps to follow are quite simple:

Open the vSphere client by connecting to your vCenter server.

Go to VMs and Templates > find and select your VM.

Do a Right-click on the VM > click Edit Settings .

. At the top of the window, select VM Options .

. Expand VMware Tools section and In Tools Upgrades , check the box called Check and upgrade VMWare Tools before each power on .

, check the box called . Click OK to validate.

Check and upgrade VMware Tools before each power on

Now you tell me, this is not an automation? True, this way we only enable the automatic upgrade of VM tools on per-VM basis.

Automation via PowerCLI

There is a couple of different ways to upgrade the VMware tools via PowerCLI. But before we jump in, I’ll show you how to setup PowerCLI via PowerShell (if you’re connected to the Internet). It takes a couple of minutes only.

Open the PowerShell window on your management machine and type in:

Find-module -name VMware.PowerCLI 1 Find - module - name VMware . PowerCLI

You might see a message that the NuGet provider is required to continue. Type “Y” to continue.

Then type in:

<em>Install-module -name VMware.PowerCLI -scope currentuser</em> 1 < em > Install - module - name VMware . PowerCLI - scope currentuser < / em >

The output looks like this

Install PowerCLI on your management system

Now we can connect to our vCenter server with this command:

Connect-viserver 1 Connect - viserver

Connect to vCenter

If you’re getting an error of certificate, it’s because PowerCLI does not like your self-signed certificate on vCenter server. Run this command to remediate:

<em>Set-PowerCLIConfiguration -InvalidCertificateAction Ignore -Confirm:$false</em> 1 < em > Set - PowerCLIConfiguration - InvalidCertificateAction Ignore - Confirm : $ false < / em >

Now that we are connected to vCenter, we can finally check which VMs need to update their VMware tools.

Here is an example of a PowerCLI code which allows us to see which VMs we have in a particular folder (if we are organized with folders), and we can remediate those VMs to the latest version.

<em>Get-Folder -name MyVMs | Get-VM | % { get-view $_.id } | select name, @{Name=“ToolsVersion”; Expression={$_.config.tools.toolsversion}}, @{ Name=“ToolStatus”; Expression={$_.Guest.ToolsVersionStatus}}|Sort-Object Name</em> 1 < em > Get - Folder - name MyVMs | Get - VM | % { get - view $ _ . id } | select name , @ { Name = “ ToolsVersion ” ; Expression = { $ _ . config . tools . toolsversion } } , @ { Name = “ ToolStatus ” ; Expression = { $ _ . Guest . ToolsVersionStatus } } | Sort - Object Name < / em >

In our example, howeve,r we cannot show the example as our VMs are either Unmanaged or VMware tools are current.

PowerCLI to show VMs and their VM Tools status

If you, however, have some VMs which need to be upgraded, there is a PowerCLI oneliner which can do the job:

<em>Get-Folder -name MyVMs | Get-VM | % { get-view $_.id } |Where-Object {$_.Guest.ToolsVersionStatus -like "guestToolsNeedUpgrade"} |select name, @{Name=“ToolsVersion”; Expression={$_.config.tools.toolsversion}}, @{ Name=“ToolStatus”; Expression={$_.Guest.ToolsVersionStatus}}| Update-Tools -NoReboot -VM {$_.Name} -Verbose</em> 1 < em > Get - Folder - name MyVMs | Get - VM | % { get - view $ _ . id } | Where - Object { $ _ . Guest . ToolsVersionStatus - like "guestToolsNeedUpgrade" } | select name , @ { Name = “ ToolsVersion ” ; Expression = { $ _ . config . tools . toolsversion } } , @ { Name = “ ToolStatus ” ; Expression = { $ _ . Guest . ToolsVersionStatus } } | Update - Tools - NoReboot - VM { $ _ . Name } - Verbose < / em >

All VMs will start updating their VM tools at the same time.

Another way which can help us to mass-update VMware tools at scale is via vSphere Update Manager (VUM).

Use VMware vSphere Update Manager (VUM) for VM Tools Upgrade

We can use the vSphere Update manager and update VMware tools on many VMs at once. If you are already using VUM to patch your hosts, you are only a step away from setting a few options and updating the VMware tools in your VMs.

VUM is able to trigger updates for individual VMs based on baselines. You can use VUM to update multiple VMs, so if a new version is available, the Tools will update whenever a guest reboots.

Let’s have a look at the necessary steps.

VMware Tools and VM Hardware can be both mass-updated from within VUM. You can access VUM from the shortcuts within the vSphere web client or from as the side menu.

Here are two examples:

VM Tools Update via vSphere Update Manager

And for VM hardware, you have an option right next to it. Make sure to select the right cluster as you certainly have several clusters, each based on different hardware version depending on your hardware where you run ESXi.

VM Hardware Upgrade via vSphere Update Manager

And this is basically it. As you can see, there is also the option to “upgrade to match host” (see the arrow), allowing you to mass upgrade the VM tools immediately.

You should know that the VMs will reboot immediately after you click Upgrade to match if you have selected immediately.

Note: Keep in mind that with Windows Server 2016 and higher, the system does not need to reboot after the VMware tools installations. It’s due to a design.

First you should update the VMware tools to the latest version and then only you should upgrade the VM hardware on the VMs which you judge that they need it.

VMware actually does not recommend to systematically upgrade the VM hardware unless the VMs needs a particular feature which is not present in the previous release of that VM hardware.

Changing VM hardware to the VM is like changing a motherboard on a PC or server. The OS will be presented to different set of features and there might be some necessary adjustments to be made afterwards.

If your VMs have VM hardware version 7 at least, you’ll be fine. Version 7 has introduced Changed Block Tracking (CBT) which is necessary for incremental backups.

VSAN from StarWind eliminates any need for physical shared storage just by mirroring internal flash and storage resources between hypervisor servers. Furthermore, the solution can be run on the off-the-shelf hardware. Such design allows VSAN from StarWind to not only achieve high performance and efficient hardware utilization but also reduce operational and capital expenses. Learn more about ➡ VSAN from StarWind

Final Words

PowerCLI is a very powerful option to mass-upgrade the VMware tools on many VMs at once. vSphere update manager (VUM) is another option which allows us to do so. VMware tools and VM hardware are the principal components to watch. While VMware tools have to be updated every time, the VM hardware does not.

Related materials:

Views All Time Views All Time 2 Views Today Views Today 14

Appreciate how useful this article was to you?

5 out of 5, based on 1 review 5 out of 5, based on 1 review

Loading... Loading...