mycloudcake.com Rotating Header Image

Install or update VMware tools without immediate reboot

I recently came across a requirement to install an updated version of VMware Tools without rebooting the guest OS. It became apparent very quickly that passing arguments to the MSI installer was the way forwarded. But how to do this automatically for a large number of guests was unclear.

I did some searching on the VMware community’s Site and came across this nifty little VI toolkit (powershell) script.

If you don’t have The VI toolkit installed you can see my blog posting here on how to install it.

So here is the script and you can download it here..

Remember to set $updlist to your cluster name. If your not using a cluster and just ESX hosts you could use ‘get-vmhost -name ESXHOSTNAME’ instead of get-cluster.

$cluster = 'SETCLUSTERNAME'
$insParm = '/s /v"/qn /norestart"'
$updList = get-cluster -name $cluster | get-vm | where-object {$_.powerstate -eq "PoweredON"} | foreach-object { get-view $_.ID } | where { $_.guest.toolsstatus -match "toolsOld" }
 
foreach ($uVM in $updList)
 
{
$uVM.name
$uVM.UpgradeTools_Task($insParm)
#Wait 30 seconds before starting another update task
Start-sleep -s 30
}

Once the tools have been installed to the guests the guests need to be rebooted in order for the updated drivers to take effect.

8 Comments

  1. Me says:

    Nice ;) xxx

  2. Nichola says:

    I hear you’re the clever one in the Titan Infrastructure Team.
    Come up & see me sometime big boy, I’ll be waiting for you under a car in portugal, bring some luggage…

  3. KrisBelucci says:

    I really liked this post. Can I copy it to my site? Thank you in advance.

  4. Great post! Just wanted to let you know you have a new subscriber- me!

  5. admin says:

    Yeah no dramas as long as you reference me!! :)
    Cheers

  6. admin says:

    Blog on!!

    Cheers
    Don

  7. virtuel says:

    this sounds too good to be true. unfortunately I’m new to powershell so not sure how to proceed. I just connected successfully to the VC now how do I run this script? do I just call it from a directory within the install path? Is the script above + vi toolkit the only thing I need?

    Thanks in advance

  8. admin says:

    am sure you have sorted your problem by now, but just in case anybody else is wondering. Yes you only need VI toolkit and powershell, you can just paste it into the vi tookit command window or you can write it to a file with an extension of .ps1 and call it from inside vi toolkit. Hope this helps

    Cheers

Leave a Reply