On running the workflow to restore the SDDC manager from the host appliance:
curl https://<sddc_manager_fqdn>/v1/restores/tasks -k -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
-d '{
"elements" : [ {
"resourceType" : "SDDC_MANAGER"
} ],
"backupFile" : "<backup_file>",
"encryption" : {
"passphrase" : "<encryption_password>"
}
}'The command fails with the error:
{ "errorCode": "RESTORE_FAILED", "arguments": [ "An exception 400 BAD REQUEST: \"{\"causes\": [{\"message\":\"Invalid backup tar file\", \"type\":null}], \"errorCode\": \"BACKUP_FILE_INVALID\", \"message\":\"Backup file <backup_file_location> does not exist.\"}\"" ....
SDDC Manager 5.x
SDDC Manager 9.x
This issue occurs because the path provided in the backupFile parameter of the API request refers to a location on the host machine (from where the curl command is being executed) instead of a local path on the SDDC Manager appliance.
While the documentation(Restore SDDC Manager from a File-Based Backup) instructs the user to run the command from a host machine with network access to the SDDC Manager, the SDDC Manager API expects the backup file to already reside on its own local file system (at/tmp/) or at a reachable absolute path within its environment.
To resolve this, ensure the backup file is copied to the SDDC Manager appliance before initiating the restore task.
/tmp folder on the SDDC manager.ls -l <filename>curl https://<sddc_manager_fqdn>/v1/restores/tasks -k -X POST -H "Content-Type: application/json" -H "Authorization: Bearer $TOKEN" \
-d '{
"elements" : [ {
"resourceType" : "SDDC_MANAGER"
} ],
"backupFile" : "<absolution_path_of_backup_file_on_SDDC>",
"encryption" : {
"passphrase" : "<encryption_password>"
}
}'