From 7e087645c6a1b5fb26738f97a7eff655a604e6c3 Mon Sep 17 00:00:00 2001 From: Sateesh Chodapuneedi Date: Thu, 18 Jul 2013 00:51:07 +0530 Subject: [PATCH] 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 --- .../resource/VmwareStorageProcessor.java | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java index 3436c5b2e45..2b9949b0b0e 100644 --- a/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java +++ b/plugins/hypervisors/vmware/src/com/cloud/storage/resource/VmwareStorageProcessor.java @@ -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);