Hello,
I would like to get lists of the VMs being in DRS Groups (ESXi 5.0).
Does anybody have already written something to get that kind of information?
Thank you,
Hi,
Welcome to the VMware VMTN Communities.
You can use the following PowerCLI script to get a list of all your clusters, VM Drs groups and VM's in this groups:
& {ForEach ($Cluster in (Get-Cluster)) { $Cluster.ExtensionData.ConfigurationEx.Group | Where-Object {$_.GetType().Name -eq "ClusterVmGroup"} | ForEach-Object { if ($_) { $DrsGroup = $_ Get-View $DrsGroup.Vm | ForEach-Object { New-Object -TypeName PSOBject -Property @{ Cluster = $Cluster DrsGroup = $DrsGroup.Name VM = $_.Name } } } } } }
This is the kind of code I was looking for.
Thank you very much.