VMware Cloud Community
wamatha
Contributor
Contributor
Jump to solution

Upgrading VMware tools without rebooting

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

Reply
0 Kudos
1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
25 Replies
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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
Reply
0 Kudos
wamatha
Contributor
Contributor
Jump to solution

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
Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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
Reply
0 Kudos
chriswahl
Virtuoso
Virtuoso
Jump to solution

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
Reply
0 Kudos
wamatha
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
wamatha
Contributor
Contributor
Jump to solution

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

Reply
0 Kudos
chriswahl
Virtuoso
Virtuoso
Jump to solution

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
Reply
0 Kudos
AlbertWT
Virtuoso
Virtuoso
Jump to solution

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"

/* Please feel free to provide any comments or input you may have. */
Reply
0 Kudos
RvdNieuwendijk
Leadership
Leadership
Jump to solution

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
Reply
0 Kudos
AlbertWT
Virtuoso
Virtuoso
Jump to solution

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.

/* Please feel free to provide any comments or input you may have. */
Reply
0 Kudos
OsburnM
Hot Shot
Hot Shot
Jump to solution

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?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

This should do the trick

Get-VM | Update-Tools -NoReboot


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

Reply
0 Kudos
OsburnM
Hot Shot
Hot Shot
Jump to solution

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.

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

And how do you select those 80 VMs ?

Or are they just 80 random VMs ?


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

Reply
0 Kudos
OsburnM
Hot Shot
Hot Shot
Jump to solution

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?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
OsburnM
Hot Shot
Hot Shot
Jump to solution

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?

Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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


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

Reply
0 Kudos
OsburnM
Hot Shot
Hot Shot
Jump to solution

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!

Reply
0 Kudos