Changing the backup server credentials on NSX-T manager using API
search cancel

Changing the backup server credentials on NSX-T manager using API

book

Article ID: 409586

calendar_today

Updated On:

Products

VMware NSX

Issue/Introduction

  • On the NSX Manager UI, the backup is stuck with the following status "Cluster Backup in Progress"
  • On the Backup server, there have been no backups created for this duration, confirming that the backup task is stuck.
  • Even if the rolling reboot of the NSX Manager is performed, as soon as the NSX Manager is up, it gets stuck with the backup in progress message again.
  • Editing or Disabling the backup configuration is not available as there is an existing backup task running.

Environment

VMware NSX 4.1

Cause

  • Backup server credentials is changed and not updated on the NSX-T Manager side

Resolution

  • Use the below command to get backup details

API call to be used :- GET /policy/api/v1/cluster/backups/config 

    • Login to the NSX manager as user admin
    • Run the command st en  :-Enter the root password here
    • This will take you to the root login prompt.
    • Run the command below and proceed with entering the NSX Manager admin password.
 curl -X  GET -H 'Content-Type: application/json' -sN -k -u  admin "https://<NSX-Manager-IP>/policy/api/v1/cluster/backups/config"

Example output:

{
   "backup_enabled" : true;
   "backup_schedule":{
      "resource_type": "WeeklyBackupSchedule",
      "days_of_week":[
         1,
         3,
         5
      ],
      "hour_of_day":0,
      "minute_of_day":0
   },
   "remote_file_server":{
      "server":"<Backup-Server-Ip>",
      "port":22,
      "protocol":{
         "protocol_name":"sftp",
         "ssh_fingerprint":"SHA256:###########################",
         "authentication_scheme":{
            "scheme_name":"<Password of the Backup server>",
            "username":"<UserAccount of the Backup server>"
         }
      },
      "directory_path":"/<Directory_folder_path>"
   },
   "inventory_summary_interval":300
}

To update the credentials of the Backup server on NSX manager

  • Copy the entire payload in the command output above and execute the PUT API along -with d option and with new backups server credentials :-

API call to be used :- PUT /policy/api/v1/cluster/backups/config 

curl -X PUT -H 'Content-Type: application/json' -d '{"backup_enabled" : true; "backup_schedule":{"resource_type": "WeeklyBackupSchedule", "days_of_week":[1,3,5], "hour_of_day":0,"minute_of_day":0}, "remote_file_server":{"server":"<Backup-Server-Ip>", "port":22,"protocol":{"protocol_name":"sftp", "ssh_fingerprint":"SHA256:###########################", "authentication_scheme":{"scheme_name":"<New_Password>", "username":"<Bacukp_UserName>"}}, "directory_path":"/<Directory_folder_path>"}, "inventory_summary_interval":300}' -sN -k -u   admin "https://localhost/policy/api/v1/infra/security-global-config"
  • The above command updates the NSX manager with the new user account name and new password of the backup server.
  • Restart the following service on all the NSX managers.
    systemctl restart nsx-mp-api-server

Additional Information