Prerequisites
- An user account with Enterprise Admin privileges is needed to authenticate the NSX API.
- Provide the current (old) passwords for the accounts to change them via this API. If a password is lost, a manual recovery via the VM console GRUB menu is required. Refer to this article Resetting GRUB password on NSX Manager
- Please note that the new password must be at least 15 characters long and include a mix of uppercase, lowercase, numbers, and special characters.
API Workflow Steps
Step 1: Retrieve Edge Transport Node IDs
- Execute GET request to retrieve the UUIDs of the Edge Transport Nodes.
GET https://<nsx-manager-ip>/api/v1/transport-nodes - Filter the JSON response for nodes where the resource_type is EdgeNode, and copy the id of the target node.
Step 2: Retrieve User IDs
- Execute a GET request to find the internal userid for the admin and root accounts on that specific node.
GET https://<nsx-manager-ip>/api/v1/transport-nodes/{transport-node-id}/node/users - In the response, locate the users (usually, root is 0 and admin is 10000 ) and note its exact user-id values.
Step 3: Update the Passwords
- Execute a PUT request using the specific user ID to update the password.
PUT https://<nsx-manager-ip>/api/v1/transport-nodes/{transport-node-id}/node/users/{userid} - Ensure the header includes Content-Type: application/json and use the following JSON payload structure:
{
"password": "<NewPassword>",
"old_password": "<CurrentPassword>"
}
- A 200 OK HTTP status code will confirm that the password was updated successfully.