I'd like to put together a workflow that will present a list of both the VirtualMachineGuestOsIdentifier values and their long name equivalents. My goal is to create a service that other folks can consume to select the operating system that they want to run on a new VM. This is in aid of a "web portal" that is being developed where users will "order" new VMs and manage their existing VMs.
I know that I can get the list of VirtualMachineGuestOsIdentifier from the vim-types.xsd file from our vCenter server but that's a huge file and it doesn't list the long names for the possible OS values. I'd like to make the life of our web developers a little easier on this.
I know how to get a guest OS object if I already have the correct value for the VcVirtualMachineGuestOsIdentifier.fromString() call. But can I get a list of all possible values?
please and thank you.
colin j.
If you want to get the values interactively just use the below type for input.
If you want to list these programatically use:
var array = Server.findAllForType("VC:VirtualMachineGuestOsIdentifier");
for each (var element in array) {
System.log(element.value);
}
Hi!
If I remember right, the ENUMs are automatically presented as list. So if you have an workflow input parameter with type VirtualMachineGuestOsIdentifier, the user will automatically be presented a complete list.
oh, and for the long description: I doubt that they are even somewhere in the objects, because they are "just documentation". => Easiest way would be copy and paste from the vSphere API Reference.
Cheers,
Joerg
If you want to get the values interactively just use the below type for input.
If you want to list these programatically use:
var array = Server.findAllForType("VC:VirtualMachineGuestOsIdentifier");
for each (var element in array) {
System.log(element.value);
}