Hi All,
I am trying to display the list of VM's in a resource pool.
Input variables:-
localparameter:- rpool
Type:- VC:ResourcePool
Script:-
if (rpool.name == "ABC"){
var vms = VcPlugin.getAllVirtualMachines();
for(i in vms){
var vm = vms[i];
System.log("VM name : " + vm.name );
logtext = "VM name : " + vm.name ;
}
}
But the script is displaying list of VM's in the vCenter but i need only VM's listed in the ABC resource pool. Please correct me, if i am wrong. Thank you in advance for the help.
getAllVirtualMachines get all vCenters VM. This is expected.
To get vms from a resourcepool just use var vms = rpool.vm;
Hi,
Thank you for the help.
var vms = rpool.vm;
The above helps in retrieving the list of VM in the resource pool. But this parameter is not listing the VM's under the nested repool or the VM's in the vApp.
For example:-
I have resource pool which contains only one vApp, the vApp contains two VM's. the rpool.vm is not able to display the vm's information.
Thank you in advance for the help.
