weizhouapache commented on code in PR #7224:
URL: https://github.com/apache/cloudstack/pull/7224#discussion_r1426853022
##########
plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java:
##########
@@ -723,4 +736,27 @@ public Pair<Boolean, String>
restoreVMToDifferentLocation(String restorePointId,
}
return new Pair<>(result.first(), restoreLocation);
}
+
+ /**
+ * Tries to retrieve the error's description of the Veeam restore task
that resulted in an error.
+ * @param uid Session uid in Veeam of the restore process;
+ * @return the description found in Veeam about the cause of error in the
restore process.
+ */
+ protected String getRestoreVmErrorDescription(String uid) {
+ LOG.debug(String.format("Trying to find the cause of error in the
restore process [%s].", uid));
+ List<String> cmds = Arrays.asList(
Review Comment:
I can get the description via powershell command
```
Restore Type VM Name State Start Time
End Time Description
------------ ------- ----- ----------
-------- -----------
RestoreVm i-2-226-VM Stopped 14/12/2023 10:59:56
14/12/2023 11:00:49
```
the description is empty (probably because the task is done without any
issue).
checked rest api reference, there is no description in the respose of
restoreSession.
https://helpcenter.veeam.com/docs/backup/em_rest/restoresessions_id.html?ver=120
however, the task has `message` in its response
https://helpcenter.veeam.com/docs/backup/em_rest/tasks_id.html?ver=120
an example of polledTask when task is done:
```
{"type":"Task","href":"https://10.0.3.142:9398/api/tasks/task-220","link":[{"href":"https://10.0.3.142:9398/api/tasks/task-220","rel":"Delete"},{"href":"https://10.0.3.142:9398/api/restoreSessions/30e90836-7674-41d7-a16a-a9b5ee0b0a7e?format=Entity","type":"RestoreSession","rel":"Related"}],"task_id":"task-220","state":"Finished","operation":"StartVMRestore","result":{"success":"true","message":"Ok"}}
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]