My LBaaS Journey part 1

My upcoming blog posts will be dedicated to my LBaaS journey. With LBaaS, I am referring to “Load Balancer as a Service”. In my journey, I am going to explain how you can create a NSX based  edge device, configured as a vRealize Automation 7.x Infrastructure Load Balancer what will be offered as a self service catalog item within vRealize Automation.

The first part of the journey is all about the relevant REST API calls to the NSX manager. On a high level, the following steps will be followed in this part of the journey.

  • Create the NSX Edge device
  • Configure the NSX Edge device as a vRA 7.x infrastructure Load Balancer
  • Capture the NSX Edge device config via a REST API call
  • Modify the NSX Edge device config
  • Deploy a new NSX Edge device via a REST API call

In the next section, I am going to explain these high level steps in much more detail

  1. The first task is to create your nsx edge device and configure it as you want. Because my use-case is all about creating a vRA 7.x Infrastructure Load Balancer, I used the following VMware document as my reference (https://docs.vmware.com/en/vRealize-Automation/7.4/vrealize-automation-load-balancing.pdf).  The NSX-V version I am using is 6.4.3. Please write down the Id of the nsx edge device, we need this Id later in this blog-post. The Id of my template nsx edge device = edge-60.
  2. No we have created the template nsx edge device, we want to capture all of it’s configuration. To achieve this, we need to execute a REST API command to the NSX Manager. However, before we can execute REST API commands to the NSX Manager, we need to authenticate to the NSX Manager REST API. I am using Postman in this blog-post as my REST Client. In the below screenshots, you can see how I managed to get an Authorization Header for my future REST API calls to the NSX Manager.
  3. Now we have the Authorization Header, we need to add two additional Headers. With these two additional headers, we make sure that the Response Body of the REST API call, will be in json format.
  4. Now we have all the ingredients to execute the right REST API call to capture the configuration of our template nsx edge device, we can execute the following REST API call.

    Make sure you have the 3 Headers configured as explained earlier in this blog-post. As you can see in this REST API call, we also needed to provide in here the Id of the template nsx edge device. The outcome of this REST API call is the configuration of the template nsx edge device in json format.
  5. Now we have the main configuration of our template nsx edge device in json format, we are able to modify the contents. In this blog I am going to modify the following information:
  6. The contents of the new configuration file used in my example looks now like the following:
  7. We can now try to deploy the template nsx edge device based on the modified json file as the REST Request Body. Again make sure you have also the 3 Headers configured . Now execute the following REST API call.

  8. As you already discovered, the REST API call failed with the following error “HTTP Status 400 Bad Request”
  9. The reason for this error is due to a missing password in the REST Request Body. This missing variable and it’s value are not part of the GET REST API call. To fix this issue with the REST API call, you need to modify the REST Request Body again and include the variable “password” with your password as the value. See the below example.
  10. After we included the password variable into the REST Request Body, we can finally deploy a new nsx edge device based on the json configuration file. Again make sure you have also the 3 Headers configured. Execute again the following REST API call. This time the REST API call should succeed and it will return a status of 201 Created.


  11. After a few moments you will see in your vCenter Client that a new nsx edge device has been deployed.

This is the end of part 1 of My LBaaS Journey blog series. I hope you enjoyed! In the next part of my Journey, I am going to develop a vRealize Orchestrator Workflow based on the REST API calls demonstrated in part 1 of the Journey.

One thought on “My LBaaS Journey part 1”

Leave a Reply

Your email address will not be published. Required fields are marked *