Setting all virtual machines to automatically upgrade VMware Tools at next power-on
search cancel

Setting all virtual machines to automatically upgrade VMware Tools at next power-on

book

Article ID: 332533

calendar_today

Updated On:

Products

VMware vCenter Server VMware vSphere ESXi

Issue/Introduction

This article explains using VMware Infrastructure (VI) Toolkit and Windows PowerShell to set all virtual machines to automatically upgrade VMware Tools at next power-on.


Environment

VMware ESX 4.0.x
VMware ESXi 3.5.x Embedded
VMware ESX Server 3.5.x
VMware ESXi 4.0.x Embedded
VMware ESXi 3.5.x Installable
VMware vCenter Server 4.0.x
VMware ESXi 4.0.x Installable
VMware VirtualCenter 2.5.x

Resolution

Before you begin

Before you perform the steps in this article, ensure that you have applied these prerequisite patches:

Note: Ensure to choose the patch for the product you are running.
The steps in this article require these components:

Note: VMware recommends that you install NET 2.0 SP1 to avoid slow operations.

Setting all virtual machines to automatically upgrade VMware Tools

To use VI Toolkit and PowerShell to set all virtual machines to automatically upgrade VMware Tools:
  1. Start VI Toolkit from Start > Programs > VMware > VMware VI Toolkit > VMware VI Toolkit.
  2. Connect to the VirtualCenter Server with the command:

    connect-viserver -server <VirtualCenter Server IP address> -user <VirtualCenter User> -password <VirtualCenter password>
     
  3. Copy the following command into the Windows VI Toolkit window:

    Foreach ($v in (get-vm)) {
    $vm = $v | Get-View
    $vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
    $vmConfigSpec.Tools = New-Object VMware.Vim.ToolsConfigInfo
    $vmConfigSpec.Tools.ToolsUpgradePolicy = "UpgradeAtPowerCycle"
    $vm.ReconfigVM($vmConfigSpec)
    }

    The VI Toolkit window does not display any output until the command has completed for each virtual machine. When the command is done running, a reconfigure task displays in VirtualCenter for every virtual machine.
Note: To disable this setting, follow steps 1 and 2, then copy this command into the VI Toolkit window:

Foreach ($v in (get-vm)) {
$vm = $v | Get-View
$vmConfigSpec = New-Object VMware.Vim.VirtualMachineConfigSpec
$vmConfigSpec.Tools = New-Object VMware.Vim.ToolsConfigInfo
$vmConfigSpec.Tools.ToolsUpgradePolicy = "manual"
$vm.ReconfigVM($vmConfigSpec)
}


Additional Information

VMware ESX 3.5, Patch ESX350-200811401-SG: Updates VMkernel, hostd, and Other RPMs