Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 206069

Re: List VMs in DRS Group

$
0
0

For anyone referring in the future, here is some fairly primitive code that should work (nearly) out of the box. This was quickly pulled and edited from a larger script, but should be ok.

 

foreach my $vmsInCluster (@{$cluster_view->configurationEx->group}) {

                       if (ref($vmsInCluster) eq "ClusterVmGroup") {

                                print "DRS rule name is: ", $vmsInCluster->name, "\n";

                                foreach my $vmNames (@{$vmsInCluster->vm}) {

                                        my $vmMor = Vim::get_view(mo_ref => $vmNames);

                                        print $vmMor->config->name, "\n";

                                }

                         }

}


Viewing all articles
Browse latest Browse all 206069

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>