VMware Cloud Community
alice7
Contributor
Contributor

How to get a providervdc from organization name or org reference?

I want to get providervdc information where my organization was created. Is there anyway to get it?

0 Kudos
4 Replies
cdecanini_
VMware Employee
VMware Employee

You need a VDC as a starting point (you can get the VDCs from an org but these can have different provider VDCs).

var host = vdc.getHost();
var providerVdcReference = vdc.toAdminObject().providerVdcReference;
var providerVdc = host.getEntityByReference(VclFinderType.PROVIDER_VDC, providerVdcReference);

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
alice7
Contributor
Contributor

I was assuming that you could get providervdc from org name. Is there anyway to get VCenter information from providervdc?

Sorry forgot to say thanks for your response.

0 Kudos
cdecanini_
VMware Employee
VMware Employee

No you cannot get provider VDC from org name because your org may have VDC belonging to different provider VDCs.

What vCenter information are you looking for ?

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
0 Kudos
thomas_root1
Enthusiast
Enthusiast

Maybe this post helps you: http://www.virtuallyghetto.com/2012/04/org-vdc-to-vcenter-resource-pool.html

It's about getting vCenter-information(MoRef of the resourcepool) from an org-vdc. But there is a similar way with providerVdcs. You just have to change the query type to QueryResultProviderVdcResourcePoolRelationRecordType. With the MoRef you can connect to your vSphere environment and retrieve the ResourcePool-Object.