VCP7-CMA Section 5 Objective 5.1 Create and Manage VMware Endpoints

Create and configure a vSphere Endpoint

A vSphere endpoint enables vRealize Automation to provision virtual machines against the resources managed by a vCenter Server instance.

There must be a proxy agent installed for EACH vCenter server you intend to add as an endpoint.


To Install the proxy agent. On a Windows Server browse to the vRA appliance and select the “vRealize Automation Component Installation Page”


Then select the IaaS Installer


Open the installer, accept the license and then proceed through the installation. Set the Appliance host name and the ROOT username and password details to access the VAMI page


Select Proxy Agents to install


Set the user with which the Windows Service will run under.


Select the vSphere agent type and complete the required fields. The Manager Service host and Model Manager web Service host will be running on an IAAS server. Depending on your deployment model this maybe the same server


Note that the Endpoint name must MATCH the value we give in vRealize Automation.

Add the endpoint and then let installation continue and complete.


We can now see the service running on the Windows Server we installed the proxy agent on.


The service shows the SERVICE name and not the ENDPOINT name we specified.

FYI you specify a vSphere proxy agent for a vCenter during the installation of vRA, I had forgotten what I called my endpoint and subsequently thought it was worth running through this process for study purposes

I stopped the other proxy agent that was running on my IAAS box


To Add a vSphere Endpoint to vRA you need to have the IAAS Administrator role assigned to your user.

Browse to the Infrastructure TAB and Select Endpoints.

Select new and browse to Virtual > vSphere (vCenter)


Complete the fields ensuring that the NAME section matches the ENDPOINT name of the proxy agent configured above. I’m using my DLIAASSVC service account to connect to vCenter.


Add a vRealize Orchestrator endpoint to vRealize Automation

The vRA Appliance has an embedded Orchestrator Appliance that can be used in smaller deployments or you can configure an external Orchestrator appliance\cluster in larger deployments.

The tenant administrator can configure tenant specific Orchestrator settings under Administration tab > vRO Configuration> Server Configuration.

Here you can choose to use the default Orchestrator Server that was configured by the system administrator in the default tenant, this will be the embedded Orchestator appliance out of the box. Or you can configure an external Orchestator server


As I havent configured the default tenant to use a different Orchestator appliance I am using the default Orchestator server in my lab which is the embedded Orch Appliance by default.


You can browse to the default Orchestrator Control center using the standard orchestrator ports, although known that the control center service is stopped by default.


If you browse to the vRA splash page you can launch the Orchestrator client


The Orchestrator client opens using port 443 on the vRA appliance and not 8281 and the default login for the Orchestrator client is the same system administrator account you’d use to access the default tenant “administrator”

You will still need to add the vRealize Orchestrator Appliance as an Endpoint even if you’re using the embedded appliance.

Logged in as an IAAS Admin

Browse to the Infrastructure TAB and Select Endpoints.

Select new and browse to Orchestrator > vRealize Orchestrator


Enter the name and optionally the description.

The address for the embedded vRO appliance will be https://VRAFQDN:443/vco

As I’ve not configured my Orch appliance to be integrated with AD yet i’m using the default vRO username and password which is the same credentials used to log in to the default vRA tenant.

There is a priority option, if you have multiple Orch endpoints this priority option will help vRA determine which vRO appliance to execute the workflow from. The highest priority Orch endpoint will be used first, then subsequently the next highest priority if no others are available.

Lower values mean higher Priority, in older versions of vRA the same could be achieved by setting the VMware.VCenterOrchestrator.Priority property on the vRO endpoint Properties tab, the property is case sensitive.


At this point vRA knowns about vRO & vCenter (vSphere)

However as vRO does all the heavy lifting when it comes to Automation, vRO also needs to know about vCenter & vRA. Configuring vRA & vCenter settings in vRO is covered in Section 6 however as this Section covers endpoint configuration, you can configure some vCenter vRO settings within vRA.

You can create a vSphere endpoint for vRealize Orchestrator in vRA by going to Administration tab > vRO Configuration > Endpoint


Give the endpoint a name, matching it to the vRA endpoint name


Set the vCenter hostname


Set the user name of the user that Orchestator will use to connect to vCenter. I have created a vRO service account. So all actions performed by vRO can be traced under this vRO Service Account. It has Administration privledges and global admin privledges


Adding the endpoint through vRA kicks off the vRO “Add a vCenter Server Instance” worflow. Essentially here vRA is calling a vRO API to run the workflow, running this workflow directly through vRO is covered in Section 6.4

Once this has been completed, we can see in the vRO inventory that the vCenter has been added to vRO and we can now run vRO workflows against the vCenter from vRA


Configure the NSX plugin in vRealize Orchestrator

Some of this section seems to be covered in Section 6 objective 4 “Install and configure NSX plugin” so I wont included the installation of the plugin here. See section 6.4 for those details.

With the NSX plugin installed, run the workflow under Libary>NSX>Configuration> Create NSX endpoint


This will add NSX as an endpoint in vRO, enter the workflow input parameters required to connect to NSX Manager


Troubleshot if required, successfully running the workflow will show NSX manager in the vRO inventory.


Integrate vRealize Automation with NSX

To Add an endpoint in NSX you will need the IAAS Administrator role assigned to your user account.

Browse to Infrastructure>Endpoints>New


Complete the required fields and add the NSX endpoint



Perform data collection in vRealize Automation

This is done by the IAAS Administrator under Infrastructure>Endpoints select the vRO appliance and then start Data Collection.


Configure NSX Network and Security for the vSphere endpoint

This is done by the IAAS Administrator under Infrastructure>Endpoints, within the vSphere vCenter endpoint, under the associations tab.

Assign the appropriate NSX manager to the correct vCenter


Adding the NSX association on the vSphere Endpoint will automatically add the vCenter endpoint to the NSX Associations.

Create and configure a vCloud Air Endpoint

This is done by the IAAS Administrator under Infrastructure>Endpoints, select new and under cloud select vCloud Air, complete the required information to add the vCloud Air endpoint.




vRO convert objects from string to object type

This code can be used to convert a vDS portgroup name in type string to a vDS portgroup object in type VC:DistrubutedVirtualPortgroup

You can use this to convert anything by calling the appropriate methods and querying the appropriate value.

Here we call the getAllDistributedVirtualPortgroups() method to get all vDS portgroups but you could call the getAllVirtualMachines() or getAllDatastores() method.

Set an input parameter of pgName in type string and the output Parameter as nicnetwork of type VC:DistrubutedVirtualPortgroup

The vDS portgroup .name value will have the vDS name in brackets after the portgroup in a similar format to “MyPortgroup (myVDS)”

So the input string would have to be represented in this way to work or you’d need to elaborate on the java script.

var portgroups = VcPlugin.getAllDistributedVirtualPortgroups();

var arraylength = portgroups.length;
var i = 0;

while (i < arraylength){ if (portgroups[i].name == pgName){ nicnetwork = portgroups[i]; }



vRO Return Datastores over a specified TB size

This code will return only the datastores over a specified Terabyte size.

Set two input parameters

inputTB as type number, this will be the TB size that will determine the Datastores to return.

set another input parameter as inDS as array type VC:Datastore

Set the output parameter as outDS as array type VC:Datastore

var tbSize = inputTB * 1073741824;

System.log("Variable tbSize is "+tbSize);

var ds = new Array();

for each (d in inDS){ if (d.summary.capacity >= tbSize){ ds.push(d);} System.log("name: " + +" Size: "+ d.summary.capacity);}

outDS = ds;

vRO vMotion VM to SDRS Datastore cluster and inflate disk

The following can be used to vMotion a machine to an SDRS Datastore Cluster, inflating the disk to Lazy Zero at the same time (done by VcVirtualMachineRelocateTransformation.flat)

Create two input parameters. vMotionVM of type VC:VirtualMachine & a parameter name SDRSCL of type VC:StoragePod

The output parameter will be myVcTask of type VC:Task

var storageSpec = new VcStoragePlacementSpec();
var StorageResourceManager = vMotionVM.sdkConnection.storageResourceManager;
var myStoragePlacementResult = VcStoragePlacementResult();
var myKey = new Array();
var podSelectionSpec = new VcStorageDrsPodSelectionSpec();
var relocateSpec = new VcVirtualMachineRelocateSpec();
relocateSpec.transform = VcVirtualMachineRelocateTransformation.flat;

podSelectionSpec.storagePod = SDRSCL;

storageSpec.type = "relocate";
storageSpec.vm = vMotionVM;
storageSpec.podSelectionSpec = podSelectionSpec;
storageSpec.relocateSpec = relocateSpec

myStoragePlacementResult = StorageResourceManager.recommendDatastores(storageSpec);

myKey[0] = myStoragePlacementResult.recommendations[0].key
myVcTask = StorageResourceManager.applyStorageDrsRecommendation_Task(myKey);

vRO Remove CD ROM Workflow

The following can be used to remove a CDROM drive from a powered on Virtual Machine using vRO, vRealize Orchestrator.

Paste the following into a Scriptable task and create an input Parameter of type VC:VirtualMachine called workflowVM


var configSpec = new VcVirtualMachineConfigSpec();
var deviceConfigSpecs = new Array();
var deviceConfigSpec = new VcVirtualDeviceConfigSpec();
var devices = workflowVM.config.hardware.device;

for ( var ii in devices) {
var device = devices[ii];
if ( device instanceof VcVirtualCdrom) {
deviceConfigSpec.device = device;
deviceConfigSpec.operation = VcVirtualDeviceConfigSpecOperation.remove;
deviceConfigSpecs.push (deviceConfigSpec);
configSpec.deviceChange = deviceConfigSpecs