Kanji5575
Contributor
Contributor

How to pull all the properties for Vmware tools advanced settings through power cli

Jump to solution

Only on some of the windows Vm's in our production environment,  We noticed that restarting the vmware tools service within the guestOs updates the vmware tools and then reboots the machine automatically.

Interestingly we don't see all the Vm's reporting this behaviour although atleast from Gui level we can settings remain the same for affected and not-affected machines.

We are unable to repro this on a stock windows Vm with all the tools version available. There is absolutely no pattern seen at all. 

The only workaround is to uncheck the option that says " Check and upgrade tools during powercycle" before the service is restarted and then check this once the service is up. 

Fyi.We have VCO in the environment which auto checks the box for all the VM's in the environment.,

Why this question on power-cli blog ? 

>> What would be the script to pull all the advanced settings (every single thing)  related to Vmware tools so that we can compare the affected and not-affected machine settings and see if there is any additional flag on the affected machine which got to be removed to stop this issue.

  By the way we have exhausted enabling debug logging, opening support case with Vmware etc

1 Solution

Accepted Solutions
RvdNieuwendijk
Leadership
Leadership

The following PowerCLI script will retrieve all of the information related to VMware Tools from the configuration of all of your virtual machines:

Get-VM -PipelineVariable VM |

ForEach-Object {$VM.ExtensionData.Config.Tools} |

Select-Object @{Name='VM';Expression={$VM}},ToolsVersion,AfterPowerOn,AfterResume,

BeforeGuestStandby,BeforeGuestShutdown,BeforeGuestReboot,

ToolsUpgradePolicy,PendingCustomization,SyncTimeWithHost,

@{Name='LastInstallInfoCounter';Expression={$_.LastInstallInfo.Counter}},

@{Name='LastInstallInfoFault';Expression={$_.LastInstallInfo.Fault}}

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

View solution in original post

4 Replies
RvdNieuwendijk
Leadership
Leadership

The following PowerCLI script will retrieve all of the information related to VMware Tools from the configuration of all of your virtual machines:

Get-VM -PipelineVariable VM |

ForEach-Object {$VM.ExtensionData.Config.Tools} |

Select-Object @{Name='VM';Expression={$VM}},ToolsVersion,AfterPowerOn,AfterResume,

BeforeGuestStandby,BeforeGuestShutdown,BeforeGuestReboot,

ToolsUpgradePolicy,PendingCustomization,SyncTimeWithHost,

@{Name='LastInstallInfoCounter';Expression={$_.LastInstallInfo.Counter}},

@{Name='LastInstallInfoFault';Expression={$_.LastInstallInfo.Fault}}

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

Thanks . Appreciate it . It works.

How did you know about the below 2 properties of VMware tools ? i couldnt find it anywhere on the cmdlet reference. So far from all my research on this issue these are the only parameters that's different between affected and non-affected machines.

WHere to get details about these properties. Would appreciate if you could share those links

LastInstallInfoCounter

LastInstallInfoFault

0 Kudos
RvdNieuwendijk
Leadership
Leadership

I didn’t find those two counters in the documentation. I just executed the following commands and looked at the output:

$VM = Get-VM -Name VM1

$VM.ExtensionData.Config.Tools

$VM.ExtensionData.Config.Tools.LastInstallInfo

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

Thank you so much for taking time to answer my query.

0 Kudos