Leo’s Ramblings Rotating Header Image

Upgrading VI tools on all VMs without reboot

Usually, I don’t post powershell code, simply because there’s so much good stuff out there to write about – but this one caught my eye considering how useful this feature would be just before scheduled downtime.

You’ll need the VI powershell toolkit for this:

$cluster = "< >" # Enter the required cluster name
$installerArgs = 'REBOOT="ReallySuppress"'
Get-Cluster -Name $cluster | Get-VM | % { (Get-View $_).UpgradeTools_Task($installerArgs) }

Hat-tip to VM Guru (Russian)

Cheers,

Leo

7 Comments

  1. Andrea says:

    So, does “all” mean “all” or just “all Windows”?

  2. [...] posted a brief snippet of code to upgrade the VMware Tools on VMs without a reboot. It looks like it might come in handy. And [...]

  3. mdking says:

    Hey! Have you tried this? I tried in our test enviroment and recieved the following:

    Get-View : 12/19/2008 5:20:49 PM Get-View Invalid object specified for parameter Id – ‘VirtualMachineImpl’. Valid types are
    ManagedObjectReference and string.
    At line:1 char:53
    + Get-Cluster -Name testintel | Get-VM | % { (Get-View <<<< $_).UpgradeTools_Task($installerArgs) }
    You cannot call a method on a null-valued expression.
    At line:1 char:75

    Thanks!
    Michael

  4. Leo says:

    Hi Michael,

    It looks like the command you’ve tested seems to have an invalid Get-View suffix with the <<<<

    That’s not in the command…

  5. [...] Upgrading VI tools on all VMs without reboot | Leo's Ramblings VI powershell toolkit (tags: vmware powershell) [...]

  6. [...] Upgrading VI tools on all VMs without reboot | Leo's Ramblings VI powershell toolkit (tags: vmware powershell) [...]

  7. [...] Mettre à jour les vmtools sans reboot en script [...]

Leave a Reply