CLOUDSTACK-3595 Backup snapshot successful but CopyCmdAnswer received is failure.

Send success answer of type CopyCmdAnswer with full snapshot backup path in secondary store (image store role)

Signed-off-by: Sateesh Chodapuneedi <sateesh@apache.org>
This commit is contained in:
Sateesh Chodapuneedi 2013-07-18 00:51:07 +05:30
parent 598a647105
commit 7e087645c6
1 changed files with 10 additions and 8 deletions

View File

@ -725,14 +725,16 @@ public class VmwareStorageProcessor implements StorageProcessor {
hostService.getWorkerName(context, cmd, 1));
success = (snapshotBackupUuid != null);
if (success) {
details = "Successfully backedUp the snapshotUuid: " + snapshotUuid + " to secondary storage.";
return new CopyCmdAnswer(details);
} else {
SnapshotObjectTO newSnapshot = new SnapshotObjectTO();
newSnapshot.setPath(snapshotBackupUuid);
return new CopyCmdAnswer(newSnapshot);
}
if (!success) {
details = "Failed to backUp the snapshot with uuid: " + snapshotUuid + " to secondary storage.";
return new CopyCmdAnswer(details);
} else {
details = "Successfully backedUp the snapshot with Uuid: " + snapshotUuid + " to secondary storage.";
SnapshotObjectTO newSnapshot = new SnapshotObjectTO();
newSnapshot.setPath(destSnapshot.getPath() + "/" + snapshotBackupUuid);
return new CopyCmdAnswer(newSnapshot);
}
} finally {
if(vmMo != null){
ManagedObjectReference snapshotMor = vmMo.getSnapshotMor(snapshotUuid);