Managing VMware Tools advanced options in PowerShell

Here is a quick way of selecting the VMware Tools Advanced option: “Check and upgrade Tools during power cycling” for all VMs in a cluster. Here is a screen shot of the option in question:

vmware_tools_upgrade

And here is the script:

$vms = get-cluster "Cluster Name" | get-vm

foreach($vm in $vms) 
{ 
$spec = New-Object VMware.Vim.VirtualMachineConfigSpec
$spec.changeVersion = $vm.ExtensionData.Config.ChangeVersion
$spec.tools = New-Object VMware.Vim.ToolsConfigInfo
$spec.tools.toolsUpgradePolicy = "upgradeAtPowerCycle"
 
$_this = Get-View -Id $vm.Id
$_this.ReconfigVM_Task($spec)
}

Debian – VMware Tools

Open VM Tools

Open VM Tools is the open source implementation of VMware Tools and consist of a suite of virtualization utilities that improves the functionality, administration, and management of virtual machines on VMware hypervisors. VMware recommends using the Open VM Tools redistributed by the operating system vendors. For additional information, see knowledge base article 2073803, VMware support of open-vm-tools, at http://kb.vmware.com/kb/2073803.

Install Open VM Tools

  1. Add the following line to the /etc/apt/sources.list file.
    deb http://ftp.debian.org/debian/ wheezy main contrib
  2. Run the commands:
    $ sudo apt-get update
     $ sudo apt-get install open-vm-tools

Source: vmware.com