VMware

This Question is Possibly Answered

1 "correct" answer available (10 pts)
1 2 3 4 5 Previous Next 65 Replies Last post: Sep 20, 2009 11:49 AM by AlexLudwig   Go to original post
Click to view justin.emerson's profile Enthusiast 77 posts since
Jan 4, 2008

Using all the permutations of various $insParm configs, I still cannot get the VMtools installer not to pop up the dialog box at the end saying Yes/No to a reboot which eventually times out and reboots the machine. I think the problem may be that the Tools' setup.exe is the part of the installer causing this reboot, so passing these parameters to the MSI that's chained off of it isn't going to do us any good. We need a switch for the actual tools installer which says to forgo a reboot. Does anyone know of one?

I suppose building this into the Upgrade-Tools cmdlet would be ideal, though... has there been a response to your feature request?

Click to view c_shanklin's profile Master 754 posts since
Dec 3, 2007
We plan to add this feature, but if the problem you have is in the tools installer itself that's going to make it quite a bit harder. Do you get the same results if you run it in the guest directly using those switches?
Click to view justin.emerson's profile Enthusiast 77 posts since
Jan 4, 2008
Results:

"C:\Program Files\VMware\VMware Tools\VMwareToolsUpgrader.exe" -p "/s /v\"/qn /norestart\""
FAILED (system rebooted)


Mount VMware Tools CD and run:
msiexec /i "D:\VMware Tools.msi" /qn REBOOT=ReallySuppress REINSTALL=ALL REINSTALLMODE=VOMUS
SUCCESS (no reboot)


Mount VMware Tools CD and run:
setup.exe /S /v"/qn /norestart REBOOT=ReallySuppress REINSTALL=ALL REINSTALLMODE=VOMUS"
SUCCSES (no reboot)


if I set $insParm = '/S /v"/qn /norestart REBOOT=ReallySuppress REINSTALL=ALL REINSTALLMODE=VOMUS"'
FAILURE (vm reboots)


so something with Powershell is not working here.

EDIT: Also tested
"C:\Program Files\VMware\VMware Tools\VMwareToolsUpgrader.exe" -p "/S /v\"/qn /norestart REBOOT=ReallySuppress REINSTALL=ALL REINSTALLMODE=VOMUS\"'
FAILED.

So either the problem is PowerShell or that PowerShell is using VMwareToolsUpgrader on the backend, which doesn't support the noreboot option or at least that option is undocumented.

Re: How to install VMware tools without a reboot?

36. Feb 27, 2009 6:42 AM in response to: meistermn
Click to view VCPGuru's profile Enthusiast 78 posts since
Dec 1, 2008
I would like to have a powershell script which runs at "Hosts & Clusters" level.

What the script should do:
Install VMware Tools whitout reboot on VMs which have "OldTools" or "Tools not Installed"

This script didnt work for me:
$insParm = '/s /v"/qn /norestart"'
$updList = get-cluster -name "My_Cluster_name"|get-vm | where-object {$_.powerstate -eq "PoweredON"} | % {get-view $_.ID} |where {$_.guest.toolsstatus -match "toolsOld" } | where {$_.guest.guestfamily -match "windowsGuest"}
{
$uVM.name
$uVM.UpgradeTools_Task($insParm)

Any help would be appreciated

Re: How to install VMware tools without a reboot?

37. Mar 5, 2009 4:39 AM in response to: VCPGuru
Click to view sunchaser's profile Novice 21 posts since
Dec 20, 2004
May it be that the method "UpgradeTools_Task()" is not anymore included to the actual toolkit (1.5)?

I'll get this error:

VirtualMachineImpl] doesn't contain a method named 'UpgradeTools_Task'.
At :line:14 char:23
+ $uVM.UpgradeTools_Task <<<< ($insParam)

Click to view LucD's profile Champion 2,430 posts since
Oct 31, 2005
UpgradeTools_Task is a method of the VirtualMachine object.
This is an SDK object not a VITK object, so in principle has nothing to do with the VITK.

It looks as if the $uVM variable doesn't contain a VirtualMachine object.
You can check the object type with
$uVM.GetType()

Re: How to install VMware tools without a reboot?

39. Mar 5, 2009 5:57 AM in response to: LucD
Click to view sunchaser's profile Novice 21 posts since
Dec 20, 2004

The Object has the type "VMware.VimAutomation.Client20.VirtualMachineImpl", and get-member shows me there is no such method.

Now I'm a bit confused, I thought the script from jp1960 is for powershell ??


Click to view LucD's profile Champion 2,430 posts since
Oct 31, 2005
That script is indeed for PowerShell but you need to know that you can use 2 types of objects.
First there are the objects from the VITK, their name mostly ends with Impl, and then there are the objects from the SDK.
Have a look at how to reference config.hardware.device for further details on this.

The Get-View cmdlet allows you to go from the VITK objects to the SDK objects.
And that is what jp1960's script does with the "...Get-View $_.ID..." cmdlet (on line 4).
This is required since the UpgradeTools_Task method is only available on the SDK object.

Are you sure you aren't missing that part.

I'll include the script for completeness

$insParm = '/s /v"/qn /norestart"'
$updList = get-cluster -name <clustername> | get-vm | `
where-object {$_.powerstate -eq "PoweredON"} | % {
	get-view $_.ID} |where {$_.guest.toolsstatus -match "toolsOld" } | where {$_.guest.guestfamily -match "windowsGuest"}
{
	$uVM.name
	$uVM.UpgradeTools_Task($insParm)
}

Re: How to install VMware tools without a reboot?

41. Mar 5, 2009 6:15 AM in response to: LucD
Click to view sunchaser's profile Novice 21 posts since
Dec 20, 2004

Thank you for this explanation! indeed i have missed that part because I don't want to look for old tools (..and thought I don't need this :^0 )


Re: How to install VMware tools without a reboot?

42. Mar 12, 2009 6:05 AM in response to: ewannema
Click to view padesjar's profile Lurker 2 posts since
Apr 8, 2005

ewannema wrote:
I have not done this with PowerShell yet, but this is how I do it via shell script on the Windows VMs. VMwareToolsUpgrader just get the tools distribution and passes the rest of the arguments after -p to Setup.exe. You can see that arguments are then passed to msiexec using the /v switch. Not sure if adding /v"/qn /norestar" will help you in this case or not.

"C:\Program Files\VMware\VMware Tools\VMwareToolsUpgrader.exe" -p "/s /v\"/qn /norestart /L*v C:\Windows\Temp\ToolsUpgrade.log\""

I would recommend using something like Process Monitor or Process
Explorer to see what is actually running on the VM when you run your
code (in PM you can filter on vmwaretoolsupgrader.exe, setup.exe, and msiexec.exe). This is how I managed to get a working command string like above. Snapshots are clearly a good thing in this situation so you can repeat the same actions.

Thanks, this worked well for me. I don't have time for installing powershell on every machine. It's good stuff, don't get me wrong, and I'm sure a windows update would install it fine on all machines, but this is more native and worked great for me. Now I can set up a chron on this and have it run periodically to keep my VMs up to date and ready for update manager to do its thing as well. Thanks!

Re: How to install VMware tools without a reboot?

43. Mar 12, 2009 2:14 PM in response to: LucD
Click to view RobMokkink's profile Expert 679 posts since
Jun 7, 2005
@Luc,

I am testing the script, i wan't replace it with our current way of updating the vmware tools (SCCM)

However the script still reboots the vm's

Click to view LucD's profile Champion 2,430 posts since
Oct 31, 2005
Out of curiosity, to which tools version are you upgrading ?
To VC2.5u4 ?

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Incoming Links

Communities