VMware Cloud Community
JoJoGabor
Expert
Expert

Choosing between multiple VCenters

I want to write a workflow to provision VMs which the user can select a site name to deploy to. I have a Vcenter per physical site, so want friendly names for the site such as London, new York etc, but then want the workflow to select the correct Vcenter and continue the workflow from there. What's the best way of achieving this?

I was thinking of having a CSV file as a resource, with site name against vcenter name, and wanted to query this file to pick out the VC. How can I do this? Is this the best way of achieving this?

2 Replies
schepp
Leadership
Leadership

Hi,

as I'm a lazy person, I would just create a dropdown list with the sites names and would use a prefilled array that matches the site names with the vCenter.

Importing the info from a csv would work as well, here's an example how to get data from a csv file:

http://www.virtualiseme.net.au/index.php/learning-vco-part-1-bulk-vm-creation-by-csv/

Tim

0 Kudos
ChristianWehner
VMware Employee
VMware Employee

I would add an vCenter advanced settings key (Like siteFriendlyName or something) where I store the site information in so it is also visible within vCenter and you configure it there.

Then from vRO you can select the correct vCenter with this code:

var siteFriendlyName = "New York";

for each (var sdkConnection in VcPlugin.allSdkConnections) {

  if(sdkConnection.optionManager.queryOptions( "siteFriendlyName" ).shift().value == siteFriendlyName) {

     myVCenterServer = sdkConnection;

  }

}

Cheers,

Chris