vRealize Orchestrator Integration

This article covers connecting VMware’s vRealize Orchestrator to vCenter and Avi Vantage deployments.  vRO can be used to automate Avi Vantage tasks, such as deploying a new virtual service or editing an existing one.

See VMware’s vRO website for more info on vRealize Orchestrator. The latest vRO ova can be downloaded from My VMware. The image used for initial implementation can be downloaded from Amazon S3.

Avi Network’s vRO package, which includes pre-built templates for configuring Avi Vantage, may be downloaded from the Avi git repo.  vRO support requires at least version 16.3 of Avi Vantage.

Connect vRO to vCenter

  • Once the vRO appliance is deployed using the ova, browse to https://<VRO-IP>:8283/vco-controlcenter/#/
  • Login using the root credentials provided during ova deploy.
  • Click “Configure Authentication Provider.”
  • Select Authentication mode as vSphere and configure as shown:vro1

     

  • On the home page, click Startup Options and restart the services.

Log into vRO

  • Browse to https://<VRO -IP>:8281/vco/
  • Click “Start Orchestrator Client.” The Java client binary will be downloaded.
  • Open the client.jnlp file and click ‘Run’ when prompted.
  • Login using vCenter credentials (not VRO login). The host name will be VRO-IP:8281.
  • Change the view to “Design” using the dropdown on top.vro2

 

Import the Avi-VRO Package

  • Download the latest com.vmware.avinetworks.plugin.dynamictypes.package from the Git repo avinetworks/avi_vrealize.
  • On the Packages tab, import the Avi package.vro3

     

  • Navigate to the Workflows tab and check that the Avi Networks folder is created with all supported workflows.vro4

     

Add Avi Controller and Create Dynamic Objects

Before running any of the workflows, first create an Avi Controller object. Make sure support for HTTP basic authentication is enabled on the Avi Controller; it is disabled by default. See the following Basic Auth KB to enable. Next, write access to vCenter Cloud must be configured for the same vCenter server to which vRO is connected.

  • Select “Create Avi Networks Dynamic Types” workflow under Avi Networks > Setup > Helpers.vro5

     

  • Run the Workflow and follow steps as below:vro6
    vro7
    vro8 (Note: Enter the Avi Controller URL as > , with no / at the end) https://<IP

    vro9
    vro10

  • On the Inventory tab, Dynamic Types objects will be auto-created for all existing virtual services, pools and certificates:
    vro11

Running Workflows

Steps for running all workflows is same. This section walks through HTTPS VS creation workflow.

  • Navigate to the Workflows tab.
  • Run the “Create Load Balancer” under Avi Networks > Sample Workflows
  • Follow the steps below to run the workflow:vro12vro13
    vro14
    vro15
    vro16
  • Check that the Dynamic type object for the virtual service is created on Inventory tab under your selected namespace. Refresh if it is not visible.
  • Check the VS on the Avi Controller UI.

Editing Workflows

Each workflow is made up of many components (input parameters, Java scripts, action Java scripts, presentation, etc.). Depending on what needs to be changed, one may need to edit one or more of these components.

This section walks through an example of adding load balancing algorithm as a new option exposed in the “Create Load Balancer” workflow demonstrated previously in this article.

  • Edit the “Create Load Balancer” workflow.
  • From the Input tab add a new variable called lbAlgo of type string:vro17
  • From the Presentation tab the variable lbAlgo must be visible.
  • Create a new step and name it.
  • Drag-drop the lbAlgo variable to the new step:vro18
  • Click on lbAlgo.
  • Add a property of “Predefined answers” since we need to create a dropdown with all algorithm options.
  • Add some load balancing algorithm strings to the list:vro19
  • Navigate to the Schema tab and edit the “generate parameter” script:vro20

    vro23

  • From the Visual Binding tab, drag-drop the lbAlgo variable from left margin (in parameters) to center table under IN column:vro21
  • From the Scripting tab, edit the JavaScript to add the lbAlgo parameter to output parameter (properties_para):vro22
  • Save the changes to the script and exit.
  • Save and close the workflow.

Now that we have read the input from the presentation form and forwarded it to next blocks in workflow, edit the actionscript, which adds it to the REST payload. The action generatePoolJsonData calls genetrateJsonData. Edit this genetrateJsonData actionscript.

  • From the Actions tab > com.avinetworks, edit the genetrateJsonData.
  • Update the script to get the lbAlgo from properties para and add it to pool json data string instead of the hard-coded string, as shown:vro23
  • Save and exit.