CLOUDSTACK-5264: add delta snapshot for existing xenserver

This commit is contained in:
edison 2013-12-30 10:47:15 -08:00
parent 4c9521726b
commit 7d02fcd5b4
1 changed files with 6 additions and 3 deletions

View File

@ -144,7 +144,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
throw new CloudRuntimeException("Unable to find CD-ROM VBD for VM: " + vmName);
} else {
// If an ISO is already inserted, eject it
if (isoVBD.getEmpty(conn) == false) {
if (!isoVBD.getEmpty(conn)) {
isoVBD.eject(conn);
}
@ -1291,7 +1291,8 @@ public class XenServerStorageProcessor implements StorageProcessor {
// By default assume failure
String details = null;
String snapshotBackupUuid = null;
boolean fullbackup = true;
Map<String, String> options = cmd.getOptions();
boolean fullbackup = Boolean.parseBoolean(options.get("fullSnapshot"));
try {
SR primaryStorageSR = hypervisorResource.getSRByNameLabelandHost(conn, primaryStorageNameLabel);
if (primaryStorageSR == null) {
@ -1302,7 +1303,7 @@ public class XenServerStorageProcessor implements StorageProcessor {
VDI snapshotVdi = getVDIbyUuid(conn, snapshotUuid);
String snapshotPaUuid = null;
if ( prevBackupUuid != null ) {
if ( prevSnapshotUuid != null && !fullbackup) {
try {
snapshotPaUuid = getVhdParent(conn, psUuid, snapshotUuid, isISCSI);
if( snapshotPaUuid != null ) {
@ -1310,6 +1311,8 @@ public class XenServerStorageProcessor implements StorageProcessor {
String prevSnashotPaUuid = getVhdParent(conn, psUuid, prevSnapshotUuid, isISCSI);
if (snashotPaPaPaUuid != null && prevSnashotPaUuid!= null && prevSnashotPaUuid.equals(snashotPaPaPaUuid)) {
fullbackup = false;
} else {
fullbackup = true;
}
}
} catch (Exception e) {