Highlighted
Contributor
Contributor

Upgrading VMware tools without rebooting

Jump to solution

I need a script to upgrade VMware Tools without rebooting.

Please give me a script to upgrade one VM only, so that I can test first

0 Kudos
1 Solution

Accepted Solutions
Highlighted
User Moderator
User Moderator

To upgrade the VMware Tools of a virtual machine named VM1 without rebooting you can use the Update-Tools cmdlet:

Update-Tools -VM VM1 -NoReboot


The -NoReboot parameter is supported only for Windows operating systems.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
25 Replies
Highlighted
User Moderator
User Moderator

To upgrade the VMware Tools of a virtual machine named VM1 without rebooting you can use the Update-Tools cmdlet:

Update-Tools -VM VM1 -NoReboot


The -NoReboot parameter is supported only for Windows operating systems.

Regards, Robert

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition

View solution in original post

0 Kudos
Highlighted
Contributor
Contributor

Tried that but got the error below

Update-Tools : 4/15/2011 10:16:35 AM    Update-Tools        The operation for the entity VirtualMachine-1360 failed with the
following message: "The operation is not allowed in the current state."
At line:1 char:13
+ Update-Tools  <<<< -VM vnnxx -NoReboot
0 Kudos
Highlighted
User Moderator
User Moderator

Does the VM have a CD-ROM or ISO file connected?

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
Highlighted
Virtuoso
Virtuoso

Here is a great article that goes more in depth on the command, especially when using 2008 R2 as a guest.

http://www.theselights.com/2011/02/avoid-server-2008-vmtools-and-vum-woes.html

VCDX #104 (DCV, NV) ஃ WahlNetwork.com ஃ @ChrisWahl ஃ Author, Networking for VMware Administrators
0 Kudos
Highlighted
Contributor
Contributor

Update-Tools -VM VM1 -NoReboot, works very well for Windows 2003, is there someting like this for Windows 2008?

0 Kudos
Highlighted
Contributor
Contributor

Does not work for Windows 2008, how can i run this on a single Windows 2008 VM?

0 Kudos
Highlighted
Virtuoso
Virtuoso

Well, the command works fine with 2008 guests (I've used it on several occasions).

The VM is powered on with an available CD-ROM drive, correct? The tools is installed via an ISO that is inserted into the virtual CD-ROM drive of a powered on VM.

VCDX #104 (DCV, NV) ஃ WahlNetwork.com ஃ @ChrisWahl ஃ Author, Networking for VMware Administrators
0 Kudos
Highlighted
Virtuoso
Virtuoso

Hm.. how is that possible ?

From my understanding, ESX/ESXi host upgrade must be followed by major VM restart since the Vmware tools need to be upgraded eventhough the upgrade is minor eg. from ESX 4.0 into u1

so does this method applies for any VMware tools install from VUM or manually initiated or powerCLI based upgrade with script "Get-VM | Update-Tools"

/* Any kind of comment or input would be greatly appreciated */
0 Kudos
Highlighted
User Moderator
User Moderator

Afaik you have to reboot a virtual machine after a VMware Tools upgrade. The -NoReboot parameter of the Update-Tools cmdlet is a way to upgrade the tools now and suspend the reboot to a later moment. The -NoReboot parameter help says:

Indicate that you don't want to reboot the system after updating VMware Tools. This parameter is supported only for Windows operating systems. NoReboot passes the following set of options to the VMware Tools installer on the guest OS:

/s /v"/qn REBOOT=ReallySuppress"

However, the virtual machine might still reboot after updating VMware Tools, depending on the currently installed VMware Tools version, the VMware Tools version to which you want to upgrade, and the vCenter Center/ESX versions.

Blog: https://rvdnieuwendijk.com/ | Twitter: @rvdnieuwendijk | Author of: https://www.packtpub.com/virtualization-and-cloud/learning-powercli-second-edition
0 Kudos
Highlighted
Virtuoso
Virtuoso

yes, that does make sense Robert 🙂

many thanks for the clarification because VMwareTools upgrade after upgrading Host OS must be followed by guest OS update.

/* Any kind of comment or input would be greatly appreciated */
0 Kudos
Highlighted
Hot Shot
Hot Shot

I'm writing a PowerCLI script to do this for 80 VMs (Must deploy & suppress the reboot).


Is there a way to write the script so it executes the command Update-Tools command on all the VMs at once?

0 Kudos
Highlighted
User Moderator
User Moderator

This should do the trick

Get-VM | Update-Tools -NoReboot


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Hot Shot
Hot Shot

LucD,  sorry I should have been more specific.  Smiley Happy

I only want to do it on a specific set of VMs.  I have thousands of VMs, and I only want to update the tools (at this time) on 80 of them and w/o rebooting.

My intent is to time this so that the tools get upgraded (w/o reboot) about 30 minutes before my scheduled Windows OS Patch reboot cycle.

0 Kudos
Highlighted
User Moderator
User Moderator

And how do you select those 80 VMs ?

Or are they just 80 random VMs ?


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Hot Shot
Hot Shot

I have a specific list with specific names.  They're part of an application system that has a unique downtime window.

I'm thinking of creating a custom attribute just for these 80, then in my powershell run something like:

Get-VM {Where custom attribute eq xxx) | Update-Tools -NoReboot

Syntax notwithstanding-- something like that, if it would work.  Am I on the right track, or is there a better idea?

0 Kudos
Highlighted
User Moderator
User Moderator

Sure, assume the Custom Attribute is called "Application" and the value for the 80 VMs is "app1", then you can do

Get-VM | where{(Get-Annotation Entity $_ -CustomAttribute "Application").Value -eq "app1"} | Update-Tools -NoReboot


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Hot Shot
Hot Shot

Sweet-  Thanks for the syntax too!  Save a guy from google.  Smiley Happy

So then would this allow the Update-Tools to run asynchronously on those 80 VMs, or will it still hit them one at a time?

0 Kudos
Highlighted
User Moderator
User Moderator

You can add the RunASync parameter on the Update-Tools cmdlet.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

0 Kudos
Highlighted
Hot Shot
Hot Shot

OMG I feel silly I never noticed that the 10 times I did the Get-Help Update-Tool -full....

As always, you're the best.  Thanks again!

0 Kudos