About two weeks back I migrated a large amount of VMs out of a DRS group, then for some reason my script stopped being able to find members of that group. It happened in two different datacenters, both clusters & drs-groups are named the same. It didn't happen to the other clusters with similar naming conventions & data. Screenshots to clarify:
You can see via the GUI that the DRS group has almost 900 VMs in it, but it shows as entirely blank in CLI. In contrast, the other cluster in the same datacenter:
It has no problem finding VMs in the group.
I've tried rebooting the VCSA thinking it was just a glitch, but I can't find any logical reason why this would be affecting just my "R04-Genpop" cluster in two different datacenters and only the VMGroup named "Genpop_VMs". If anyone sees something I'm missing, please let me know
It might be that you have hit a PowerCLI bug.
Since it seems to work in the Web Client and using the API, it obviously points to PowerCLI.
You might first try to upgrade your PowerCLI version.
If that doesn't help I suggest opening an SR.
If GSS claims PowerCLI is not supported without a Developer Support contract, point them to Online Documentation - PowerCLI 12.3.0 User’s Guide - VMware {code}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Which vSphere and PowerCLI version are you using?
Can you check via the API what is actually there?
Something like this for example
$clusterName = 'cluster' # <== change name
$cluster = Get-Cluster -Name $clusterName
$cluster.ExtensionData.ConfigurationEx.Group |
where{$_ -is [VMware.Vim.ClusterVmGroup]} |
ForEach-Object -Process {
New-Object -TypeName PSObject -Property ([ordered]@{
Groupname = $_.Name
VMCount = $_.Vm.Count
VM = (Get-View -Id $_.VM -Property Name).Name -join '|'
})
}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
vsphere:
Version: 7.0.3
Build: 19480866
powercli:
Get-Module -Name VMware* | select name, version
Name Version
---- -------
VMware.Vim 7.0.2.17839075
VMware.VimAutomation.Cis.Core 12.3.0.17839331
VMware.VimAutomation.Common 12.3.0.17838947
VMware.VimAutomation.Core 12.3.0.17839688
VMware.VimAutomation.Sdk 12.2.0.17531155
given command:
That version you sent worked, any idea why it would work in that format but not the original?
It might be that you have hit a PowerCLI bug.
Since it seems to work in the Web Client and using the API, it obviously points to PowerCLI.
You might first try to upgrade your PowerCLI version.
If that doesn't help I suggest opening an SR.
If GSS claims PowerCLI is not supported without a Developer Support contract, point them to Online Documentation - PowerCLI 12.3.0 User’s Guide - VMware {code}
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference