VMware Cloud Community
Schaedle
Enthusiast
Enthusiast
Jump to solution

walk through all vms and show if advanced setting is present or not

Hi,

I want to get a list of all vms which shows a configuration options and it's value. AND if there is a vm without that configuration I'd like to see these too.

Get-VM -name * | Get-AdvancedSetting | where {$_.Name -eq "monitor_control.enable_softResetClearTSC"} |  Select Entity, Name, Value

The one-liner above works pretty fine, but only shows the machines which have this configuration present in the vmx file. But I miss the not configured vms.

How will I get them in the list too ?

Regards Wolfgang

0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

Leave out the Where-clause, something like this

Get-VM |

Select Name,

    @{N='monitor_control.enable_softResetClearTSC';E={

        Get-AdvancedSetting -Entity $_ -Name monitor_control.enable_softResetClearTSC | Select -ExpandProperty Value}}


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

View solution in original post

0 Kudos
6 Replies
LucD
Leadership
Leadership
Jump to solution

Leave out the Where-clause, something like this

Get-VM |

Select Name,

    @{N='monitor_control.enable_softResetClearTSC';E={

        Get-AdvancedSetting -Entity $_ -Name monitor_control.enable_softResetClearTSC | Select -ExpandProperty Value}}


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

0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

perfect ! Many thanks !

Is it safe to change such settings while a vm is running ? I never used PowerCli before for administration of vSphere.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

I don't know for sure, but KB2092807 seems to assume the VM is powered off while you change the setting.


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

0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

Sorry my question was not pointed to the value mentioned in the example above.

I meant is it okay to change some settings in the vmx file with the powercli while the vm is running? It's okay when it does not take any effect for the moment. I only want to be sure that on next reboot the settings are present.

Or should changes only be done when a vm is powered off. Because if you use the GUI you are not able to change these while the machine is running.

0 Kudos
LucD
Leadership
Leadership
Jump to solution

There are settings that are overwritten in the VMX when you power off a VM.

So a best practice would be to do those changes while the VM is powered off.


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

0 Kudos
Schaedle
Enthusiast
Enthusiast
Jump to solution

OK that's good to know ! Many thanks for your quick help !

Regards Wolfgang

0 Kudos