VMware Cloud Community
Windspirit
Hot Shot
Hot Shot
Jump to solution

vCloud:GuestOSType - VclGuestOSType()

Hi all, how do I set a value for vCloud:GuestOSType ?

I can read all the values, but how can I set the variable so I can create a VM.

I have a Workflow that has vcloud:GuestOSType as input variable. The customer is passing me a string with his PXE image and I need to phrase it to determine what OS he wants.

So I have ATM an Action that has as return a type vcloud:GuestOSType

var myVclGuestOSType = new VclGuestOSType() ;


it allready errors on the VAR with

[2013-08-01 16:33:54.780] [I] Unable to create object : _VclGuestOSType : com.vmware.vmo.plugin.vcloud.model.enumerations.GuestOSType

So Not sure how to do it.

0 Kudos
1 Solution

Accepted Solutions
Burke-
VMware Employee
VMware Employee
Jump to solution

Hello, the following works (NOTE: the string is case sensitive though):

var guestOSType = VclGuestOSType.getObject(guestOSTypeString);

In the above example, "guestOSTypeString" is a string being passed in to the workflow/action ...

rhel3_64Guest -- works, but RHEL3_64GUEST does not..

To get around this, you can use a loop like this:

for each (guestType in VclGuestOSType.values){

    if (guestType.toLowerCase() == guestOSTypeString.toLowerCase()){

        var guestOSType = VclGuestOSType.getObject(guestType);

    }

}

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter

View solution in original post

0 Kudos
1 Reply
Burke-
VMware Employee
VMware Employee
Jump to solution

Hello, the following works (NOTE: the string is case sensitive though):

var guestOSType = VclGuestOSType.getObject(guestOSTypeString);

In the above example, "guestOSTypeString" is a string being passed in to the workflow/action ...

rhel3_64Guest -- works, but RHEL3_64GUEST does not..

To get around this, you can use a loop like this:

for each (guestType in VclGuestOSType.values){

    if (guestType.toLowerCase() == guestOSTypeString.toLowerCase()){

        var guestOSType = VclGuestOSType.getObject(guestType);

    }

}

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 vRealize Orchestrator tips and tutorials - @TechnicalValues on Twitter
0 Kudos