VMware Cloud Community
colinj
Contributor
Contributor
Jump to solution

A workflow that will list all possible values for VirtualMachineGuestOsIdentifier

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.

Reply
0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

If you want to get the values interactively just use the below type for input.

Screen Shot 2012-06-22 at 8.15.55 PM.png

If you want to list these programatically use:

var array = Server.findAllForType("VC:VirtualMachineGuestOsIdentifier");

for each (var element in array) {
    System.log(element.value);
}

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter

View solution in original post

Reply
0 Kudos
2 Replies
tschoergez
Leadership
Leadership
Jump to solution

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

Reply
0 Kudos
cdecanini_
VMware Employee
VMware Employee
Jump to solution

If you want to get the values interactively just use the below type for input.

Screen Shot 2012-06-22 at 8.15.55 PM.png

If you want to list these programatically use:

var array = Server.findAllForType("VC:VirtualMachineGuestOsIdentifier");

for each (var element in array) {
    System.log(element.value);
}

If my answer resolved or helped you, please mark it as Correct or Helpful to award points. Thank you! Visit http://www.vcoteam.info & http://blogs.vmware.com/orchestrator for vCenter Orchestrator tips and tutorials - @vCOTeam on Twitter
Reply
0 Kudos