diff --git a/scripts/vm/hypervisor/xenserver/vmops b/scripts/vm/hypervisor/xenserver/vmops index 4ba480fe2e7..76355d8bd1c 100755 --- a/scripts/vm/hypervisor/xenserver/vmops +++ b/scripts/vm/hypervisor/xenserver/vmops @@ -1095,7 +1095,7 @@ def backupSnapshot(session, args): # There has been no change since the last snapshot so no need to backup util.SMlog("There has been no change since the last snapshot with backup: " + prevBaseCopyUuid) # Set the uuid of the current backup to that of last backup - txt = "1#" + prevBaseCopyUuid + txt = "1#" + prevBackupUuid return txt # Check existence of snapshot on primary storage diff --git a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java index e94429bf8c3..47720e1732f 100644 --- a/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java +++ b/server/src/com/cloud/storage/snapshot/SnapshotManagerImpl.java @@ -368,7 +368,7 @@ public class SnapshotManagerImpl implements SnapshotManager { // Update the snapshot in the database if ((answer != null) && answer.getResult()) { // The snapshot was successfully created - if (preSnapshotPath != null && preSnapshotPath == answer.getSnapshotPath()) { + if (preSnapshotPath != null && preSnapshotPath.equals(answer.getSnapshotPath())) { if( preSnapshotVO.getRemoved() != null ) { String backupPath = preSnapshotVO.getBackupSnapshotId(); @@ -376,11 +376,10 @@ public class SnapshotManagerImpl implements SnapshotManager { createdSnapshot = updateDBOnCreateDuplicate(id, answer.getSnapshotPath(), backupPath); } else { // empty snapshot - s_logger.debug("CreateSnapshot: this is empty snapshot, remove it "); + s_logger.debug("CreateSnapshot: this is empty snapshot, use the last one "); // delete from the snapshots table _snapshotDao.delete(id); - throw new CloudRuntimeException( - " There is no change since last snapshot, please use last snapshot " + preSnapshotPath); + createdSnapshot = preSnapshotVO; } } else {