Reply to Message

View discussion in a popup

Replying to:
haripetrov
Contributor
Contributor

How to use Get-View instead of Get-VM for Advanced Settings of a VM

I have a question related with the advanced settings of a VM and how to use Get-View instead of Get-VM for this particular case:

Get-VM * | Get-AdvancedSetting -Name "scsi*sharing" | Select Entity, Name, Value

My idea is to use:

Get-View -ViewType VirtualMachine | Where {-not $_.Config.Template} | Where {$_.Advanced.Setting -eq "scsi*sharing"} | Select Entity, Name, Value

but as far as I can see there is nothing for advance configuration of "VirtualMachine" here: https://pubs.vmware.com/vsphere-51/index.jsp?topic=%2Fcom.vmware.powercli.cmdletref.doc%2FVirtualMac...

I also took a look at https://www.vmware.com/support/developer/vc-sdk/visdk41pubs/ApiReference/vim.vm.ConfigSpec.html but I cannot figure it out how to use "extraConfig" in the PowerCLI script to extract this particular information for "SCSI Sharing".

There is information how to use the API to add or change advanced key in .vmx file of a VM here: http://blogs.vmware.com/PowerCLI/2008/09/changing-vmx-fi.html but still it is not clear for me how to use this just to extract information without changing anything.

Reply
0 Kudos