HCX Service Mesh Operations via API

Before deploying Service Mesh, we need to create Compute & Network Profiles in both source & destination HCX environment. The order of Service Mesh deployment is as follows:

  1. Create Network Profiles in source & destination HCX.
  2. Create Compute Profiles in source & destination HCX.
  3. Trigger Service Mesh deployment from on-prem (source) site.

In this post I will demonstrate HCX Service Mesh operations via API.

Some of the most common operation associated with service mesh can be:

  1. Create profiles (Network & Compute) and deploy service mesh.
  2. Update Network & Compute profiles to include/remove additional features.
  3. Delete Network & Compute profiles.
  4. Update Service Mesh to include/remove additional services.
  5. Delete Service Mesh. 

Let’s jump into lab and look at these operations in action.

Network Profile API

1: List Network Profiles: This API call list all the networks profiles that you have created to be used in service mesh. 

 

Note: Here objectId is the id of the various networks participating in network profiles

2: List Specific Network profile: This API call lists a specific network profile.

3: Create Network Profile: For a freshly deployed HCX environment, you will first create network profiles

There are few parameters values that you need to obtain before creating network profile via API. These parameters are:

  • “backingId”:”LS ID or dv port id>”
  • “backingName”:”<LS or DV portgroup name>”
  • “vCenterInstanceUuid”:”<uuid>”

These values can be obtained via vsphere API’s or UI.

 

 

4: Update Network profile: Using this API, you can modify following: 

  • Modify IP pool.
  • Modify primary/secondary secondary DNS server.
  • Modify Subnet Mask & MTU.
  • Change backing DV portgroup.

5: Delete Network Profile: Before executing this call, please ensure that network profile is not in used by any service mesh.

Compute Profile API

1: List compute profiles: Below API call list all the compute profiles in a HCX environment.

 

2: Create Compute Profile

 

3: Update Compute Profile

4: Delete Compute Profile

Service Mesh API

1: List Service Mesh

 

2: Create Service Mesh

 

Response Output: Create service mesh API returns servicemeshID in response which we can use in further operations. 

3:  Re-sync Service Mesh

4: Update Service Mesh

5: Delete Service Mesh

And that’s it for this post.  

I hope you enjoyed reading this post. Feel free to share this on social media if it is worth sharing 🙂

Leave a ReplyCancel reply