Upgrading VMware Tools on critical VMs

|

,
Update (December 2026): vSphere Update Manager baselines were deprecated in vSphere 8 and their main functions were removed in vSphere 9 / VCF 9, where host patching uses vSphere Lifecycle Manager images only (Broadcom KB 379388). VMware Tools and VM hardware upgrades are done from the Updates tab of a VM, host or cluster, or with PowerCLI as shown below. The planning steps in this post still apply.

Upgrading VMware Tools on critical VMs is a sensitive operation that demands meticulous planning and execution to mitigate risks of downtime or other complications. Here’s a structured approach to help you plan and execute the upgrade using vSphere Lifecycle Manager (vLCM) in vSphere 8 (formerly Update Manager), plus PowerCLI.

Rollout pattern for critical VMs 1. Prepare backup + snapshot 2. Pilot one test VM 3. Verify apps, services 4. Waves small groups 5. Clean up delete snapshots verification fails: revert to snapshot, fix, retry
Figure: staged VMware Tools rollout with a rollback point before every wave.

1. Preparation & Planning

  • Identify VMs: List all critical VMs that require VMware Tools upgrades.
  • Communicate: Notify all relevant stakeholders and users about the planned upgrade and expected downtime, if any.
  • Schedule: Allocate a suitable time frame preferably during off-peak hours or a maintenance window.
  • Backup & Snapshot: Backup critical VMs and take snapshots to allow rollback in case of any issues.
  • Review Dependencies: Assess dependencies between services running on the VMs and plan the sequence of upgrades accordingly.
  • Test: If possible, test the upgrade process on non-critical or duplicate VMs to ensure there are no unexpected problems.

2. Setup Baselines in Update Manager (vSphere 7 and 8 only)

  • Use the predefined baseline: Lifecycle Manager ships a predefined “VMware Tools Upgrade to Match Host” baseline, so you normally do not need to create one. In vSphere 9 skip this step and use the VM or cluster Updates tab.
  • Attach Baseline: Attach the created baseline to the critical VMs or to the cluster/hosts where the VMs reside.

3. Implementation & Monitoring

  • Monitor VM Health: Prior to initiating the upgrade, ensure that the VMs are in a healthy state and that there are no underlying issues.
  • Initiate Upgrade: Start the upgrade process for one VM or a small group of VMs and closely monitor the progress.
  • Verify Functionality: After the upgrade, confirm that all services and applications on the upgraded VMs are running as expected.
  • Rollback if Necessary: If any issues are detected, use the snapshots taken earlier to roll back the VMs to their previous state.

4. Documentation & Communication

  • Document: Log the details of the upgrade, including the date, time, affected VMs, and any issues encountered and resolved during the upgrade.
  • Communicate: Once the upgrade is successful and you have verified the functionality of the critical VMs, inform all stakeholders and users about the completion of the upgrade and any subsequent steps they may need to take.

5. Cleanup & Review

  • Remove Snapshots: Once you have confirmed that the VMs are stable, remove the snapshots to free up storage space.
  • Review: Hold a review meeting to discuss any issues encountered during the upgrade process and how they were resolved, and identify any areas for improvement in the upgrade process.
  • Update Documentation: Update any documentation or configuration management databases with the new VMware Tools versions.

Example of Initiating the Upgrade in the vSphere Client

  • Go to the “Updates” tab of the VM, host or cluster in the vSphere Client and open the “VMware Tools” section.
  • Select the VMs whose Tools status is “Upgrade available” and click “Upgrade to Match Host” (in vSphere 7/8 you can also remediate the attached baseline).
  • Follow the wizard to start the upgrade process.

Conclusion:

Performing VMware Tools upgrades for critical VMs in a structured, cautious manner is crucial. Ensuring meticulous planning, regular communication, and thorough testing can help in minimizing the impact and ensuring a smooth upgrade process.

# Connect to the vCenter Server
$server = "<VCENTER_FQDN>"
Connect-VIServer -Server $server     # prompts for credentials

# Get all the VMs
$vms = Get-VM

foreach ($vm in $vms) {
    try {
        Write-Output "Processing VM: $($vm.Name)"
        
        # Check if the VM is powered on
        if ($vm.PowerState -eq "PoweredOn") {
            
            # Check if VMware Tools are out-of-date
            if ((Get-VMGuest -VM $vm).ToolsVersionStatus -eq 'GuestToolsNeedUpgrade') {
                
                Write-Output "Upgrading VMware Tools on $($vm.Name) ..."
                
                # Upgrade VMware Tools to the latest version
                Update-Tools -VM $vm -NoReboot -Confirm:$false
                
                Write-Output "Successfully initiated upgrade of VMware Tools on $($vm.Name)."
            } else {
                Write-Output "VMware Tools on $($vm.Name) are already up-to-date."
            }
        } else {
            Write-Output "$($vm.Name) is not powered on. Skipping ..."
        }
    } catch {
        Write-Error "Error processing $($vm.Name): $_"
    }
}

# Disconnect from the vCenter Server
Disconnect-VIServer -Server $server -Confirm:$false -Force

Another option is to let the VM upgrade its own Tools at the next power cycle, using the vSphere Client:

  1. Navigate to the VM: In the vSphere Client, navigate to the virtual machine you want to configure.
  2. VM Options: Go to the VM’s settings, and under “VM Options,” look for “VMware Tools.”
  3. Upgrade Settings: Enable “Check and upgrade VMware Tools before each power on” (the Tools upgrade policy upgradeAtPowerCycle).
  4. Save: Save the changes and exit.
# Connect to the vCenter Server
Connect-VIServer -Server <VCENTER_FQDN>

# Get the VM object
$vm = Get-VM -Name "Your_VM_Name"

# Configure VMware Tools upgrade at power cycle
# The upgrade policy is part of the VM's Tools config, not an advanced setting
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.Tools = New-Object VMware.Vim.ToolsConfigInfo
$spec.Tools.ToolsUpgradePolicy = "upgradeAtPowerCycle"     # "manual" to switch it off again
$vm.ExtensionData.ReconfigVM($spec)

# Disconnect from the vCenter Server
Disconnect-VIServer -Server * -Confirm:$false

Notes:

  • Replace <VCENTER_FQDN> and Your_VM_Name with your vCenter Server and the VM name. The earlier version piped Get-AdvancedSetting -Name "tools.upgrade.policy" into Set-AdvancedSetting; because that key normally does not exist as an advanced setting, the command silently did nothing.
  • After setting this, VMware Tools will be upgraded the next time the VM is power cycled. No snapshot is taken by this mechanism, so take your own if you need a rollback point.
  • Make sure to inform the relevant parties that the VM will be experiencing a reboot, especially if it hosts critical applications or services.
  • Ensure the reboot and VMware Tools upgrade don’t interfere with the normal operation of applications and services on the VM.
  • It is always a good practice to have a backup or snapshot of the VM before performing any upgrade.

Leave a Reply