Create a VRO action to display a drop down of all VM names

Every so often I need to populate a drop down in VRA with a list of virtual machine names to allow the customer to select from the list. This is useful in things like my previous posts adding and removing security tags that take an input of VM name. This is created as a action and returns an array of string. Once completed just choose it as the action to populate a drop down in VRA.

Here is the action code:

var machines = new Array();

vms = VcPlugin.getAllVirtualMachines();

for each (vm in vms) {

    machines.push(vm.name);

}

return machines;

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.