VMware Cloud Community
NigelHarris
Contributor
Contributor
Jump to solution

Relationship between OrgVDC and ProviderVDC

I'm trying to write a small workflow which when provided an OrgVDC will return the ProviderVDC behind it.   This will help us ensure that we are provisioned vApps into the correctly licensed vSphere cluster.  I was expecting that the provider object would be the parent of the Orgvdc, but it appears that is an Org object.  Could someone tell me how I can write a small workflow which when provided an OrgVDC will return the ProviderVDC behind it ? I'm unable to determine how to resolve one from the other

thanks,

Reply
0 Kudos
1 Solution

Accepted Solutions
cdecanini_
VMware Employee
VMware Employee
Jump to solution

I have edited my answer since I first replied. Have you tried the code above ?

Christophe.

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
6 Replies
cdecanini_
VMware Employee
VMware Employee
Jump to solution

Please try this:

var providerVdcReference = vdc.toAdminObject().providerVdcReference;
providerVdc = vdc.getHost().getEntityByReference(VclEntityType.providerVdc ,providerVdcReference);

Christophe.

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
NigelHarris
Contributor
Contributor
Jump to solution

I've got the following code
var myorgvdc = I_ORGVDC;
var myadminorgvdc = I_VCLHOST.toAdminObject(myorgvdc);
var myadminextorgvdc = I_VCLHOSTADMIN.toAdminExtensionObject(myadminorgvdc);
System('myadminextorgvdc is:' +  myadminextorgvdc);

and I'm getting the following error

2012-04-02 11:44:27.608] [I] TypeError: System is not a function, it is ch.dunes.scripting.server.script.SystemObject. (Workflow:getPVDC / Scriptable task (item0)#7)

Any suggestions ?
thanks,

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

You are missing the .log after System Smiley Wink

It should be:

System.log('myadminextorgvdc is:' +  myadminextorgvdc);

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
cdecanini_
VMware Employee
VMware Employee
Jump to solution

I have edited my answer since I first replied. Have you tried the code above ?

Christophe.

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
NigelHarris
Contributor
Contributor
Jump to solution

I get the following error

[2012-04-03 09:08:34.379] [I] Property named 'providerVdc' not found on object : _VclEntityType

Reply
0 Kudos
NigelHarris
Contributor
Contributor
Jump to solution

Got it working.  Thanks Christophe

var vdc = I_TARGETORGVDC;
var providerVdcReference = vdc.toAdminObject().providerVdcReference;
providerVdc = vdc.getHost().getEntityByReference(VclEntityType.PROVIDER_VDC ,providerVdcReference);
System.log('providerVdc is:' +  providerVdc);
System.log('providerVdc.name is:' +  providerVdc.name);
Reply
0 Kudos