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,
I have edited my answer since I first replied. Have you tried the code above ?
Christophe.
Please try this:
var providerVdcReference = vdc.toAdminObject().providerVdcReference;
providerVdc = vdc.getHost().getEntityByReference(VclEntityType.providerVdc ,providerVdcReference);
Christophe.
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)
You are missing the .log after System
It should be:
System.log('myadminextorgvdc is:' + myadminextorgvdc);
I have edited my answer since I first replied. Have you tried the code above ?
Christophe.
I get the following error
[2012-04-03 09:08:34.379] [I] Property named 'providerVdc' not found on object : _VclEntityType
Got it working. Thanks Christophe