Somehow we noticed a few machines where it was not possible to auto-update the VMware tools from vCenter. After a time-out of 30 minutes the task failed. Result, no VMware tools installed and a task that failed (according to vCenter) but a task keeps remaining on the ESXi host/VM.
We never encountered this issue, after looking through log files, eventvwr etc. I didn’t find a proper explanation. Somehow I suddenly got a clear moment and thought about looking in the advancedsettings from the VM because a while ago I changed the template settings according to our yearly hastle with the security baseline 🙂
Easy with powerCLI:
get-vm <vm>|Get-AdvancedSetting
Mmz I found a tools setting:
Name: isolation.tools.autoinstall.disable
Value:true
This just means that the auto-install is disabled. That explains why it won’t work automatically, and manually we didn’t encounter any issue.
Hah, this easily can be edited also with powerCLI.
get-vm <VM>|Get-AdvancedSetting -Name isolation.tools.autoinstall.disable|Set-AdvancedSetting -Value:$false -confirm:$false
DAMN!
I throw this script in our test cluster, but somehow not all machines can be edited. A little investigation leaded me to the fact that the machines which failed got a “Time-out VMware tools install task”
So what about killing the task, it was not possible through vCenter, I tried to restart the management agents on the host but that wasn’t a success also.
Then I came accross this VMware article :
http://kb.vmware.com/selfservice/microsites/search.do?language=en_US&cmd=displayKC&externalId=1038542
- Run this command to identify the virtual machine ID:
# vim-cmd vmsvc/getallvms
You see an output similar to:
2256 testvm [datastore] testvm/testvm.vmx winNetStandardGuest vmx-07
- Note the ID of the virtual machine with the ongoing VMware Tools installation. In this example, the virtual machine ID is 2256.
- Run this command to stop the VMware Tools installation:
# vim-cmd vmsvc/tools.cancelinstall <vm_ID>
Where <vm_ID> is the ID of the virtual machine noted in Step
Now the Tools upgrade task is killed, now it is possible again to vMotion, change advanced settings etc.
So now it’s possible to edit the settings. I started the script again and it went flawlessly. Next step is to try the VMware tools installation again.
I picked a machine, started install VMware tools through vCenter and waited….after 30 minutes again: TIME-OUT!
Mmmmm maybe we need to power-off/power-on the VM to pick the new setting. So again, cancelled task, checked setting. All OK.
Shutdown vmguest, power-on and reinstall VMware tools through vCenter this seems to be the magical combination.
To wrap it up:
– Cancel any running tasks on the ESX host/VM
– Change the isolation.tools.autoinstall.disable setting
– Power off/on the VM
– Reinstall VMware tools
Best is of course to change the setting while the machine is powered off.
Or just do a manual install 🙂
Last but not least I created a little script to retrieve the key, and if the key exists, and the value not equals “true”, it sets the setting to
foreach ($VM in get-cluster *199* | Get-VM){
$Setting = $VM|Get-AdvancedSetting -Name isolation.tools.autoinstall.disable|select name, value
if ($Setting -ne $null){
if ($Setting.value -ne "false"){
$VM|Get-AdvancedSetting -Name isolation.tools.autoinstall.disable|Set-AdvancedSetting -Value:$false -Confirm:$false
}
}
}