SadiJr commented on code in PR #7224:
URL: https://github.com/apache/cloudstack/pull/7224#discussion_r1303516834
##########
plugins/backup/veeam/src/main/java/org/apache/cloudstack/backup/veeam/VeeamClient.java:
##########
@@ -317,17 +317,29 @@ private boolean checkTaskStatus(final HttpResponse
response) throws IOException
return false;
}
+ /**
+ * Checks the status of the restore session. Checked states are "Success"
and "Failure".<br/>
+ * There is also a timeout defined in the global configuration,
backup.plugin.veeam.restore.timeout,<br/>
+ * that is used to wait for the restore to complete before throwing a
{@link CloudRuntimeException}.
+ */
protected boolean checkIfRestoreSessionFinished(String type, String path)
throws IOException {
- for (int j = 0; j < this.restoreTimeout; j++) {
+ for (int j = 0; j < restoreTimeout; j++) {
HttpResponse relatedResponse = get(path);
RestoreSession session =
parseRestoreSessionResponse(relatedResponse);
if (session.getResult().equals("Success")) {
return true;
}
+ if (session.getResult().equalsIgnoreCase("Failed")) {
+ String sessionUid = session.getUid();
+ LOG.error(String.format("Failed to restore backup [%s] of VM
[%s] due to [%s].",
+ sessionUid, session.getVmDisplayName(),
+
getRestoreVmErrorDescription(StringUtils.substringAfterLast(sessionUid, ":"))));
+ throw new CloudRuntimeException(String.format("Restore job
[%s] failed.", sessionUid));
+ }
+ LOG.debug(String.format("Waiting %s seconds, out of a total of %s
seconds, for the backup process to finish.", j, restoreTimeout));
Review Comment:
@DaanHoogland sorry for the delay in answer, but can you please explain
better your point?
--
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]