• mehdi@mkvlab.at

Redeploy NSX Edge Trasport Node using API

In this post, we will redeploy the NSX Edge Transport Node using the NSX Manager API call where you can easily and quickly redeploy your edge node. I am in a situation, where my nodes are not responding as I am constantly testing things in my Lab, so I wanted to share how you can do that in your production environment.

There are other reasons you may need to redeploy your edge node:

  • Troubleshooting and issue resolution
  • You might want to change the management port group
  • You want to change certain advanced settings
  • You want to change your edge node configuration or change the virtual hardware version

Step 1 – Retrieve Node ID and Config

the first thing we need to do is to get out the edge node ID which can be collected using an API call in the NSX Manager

GET https://nsx.mkv.lab/api/v1/transport-nodes/

After having the node ID we can run the same GET call to get the node’s config. In my case, it would be

GET https://nsx.mkv.lab/api/v1/transport-nodes/fd57b46c-70a2-4382-8d89-8e6544a165b9

Step 2 – Change the JSON Config

Now, we need to update some information in the configuration. I start by copying the entire JSON file to my preferred editor, where I review everything and make any necessary changes. In this case, I’m satisfied with the current settings, so I only need to add the password section to the configuration. I just added the passwords as follows under “node_user_settings”

        "node_user_settings": {
            "cli_username": "admin",
            "audit_username": "audit",
            "cli_password": "YOUR_PASSWORD",
            "audit_password": "YOUR_PASSWORD",
            "root_password": "YOUR_PASSWORD"

Step 3 – Redeploy the Edge Node

Now we have everything we need so I will copy the edited JSON config to the body and because I am using Postman I change the body to raw and JSON format and post the API call with the “action=redeploy” command:

POST https://nsx.mkv.lab/api/v1/transport-nodes/fd57b46c-70a2-4382-8d89-8e6544a165b9?action=redeploy

If you go back to NSX Manager you will see that the edge node will be redeployed.

Leave a Reply

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