Search the VMware Knowledge Base (KB)
Products:
View by Article ID

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

  • 20 Ratings

Purpose

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.

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)
}

See Also

Update History

02/23/2011 - Added ESX.ESXi and vCenter Server 4.0 to Products

Request a Product Feature

To request a new product feature or to provide feedback on a VMware product, please visit the Request a Product Feature page.

Feedback

  • 20 Ratings

Did this article help you?
This article resolved my issue.
This article did not resolve my issue.
This article helped but additional information was required to resolve my issue.

What can we do to improve this information? (4000 or fewer characters)




Please enter the Captcha code before clicking Submit.
  • 20 Ratings
Actions
KB: