You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by li...@apache.org on 2013/12/24 13:08:52 UTC

git commit: updated refs/heads/4.3 to 289c8a0

Updated Branches:
  refs/heads/4.3 a9ca48035 -> 289c8a09e


CLOUDSTACK-5508. Vmware - When there are multiple secondary stores, the newly added secondary store is not being selected for backing up snapshots.
If the snapshot being backed up is a a delta snapshot, pick the image store where the parent snapshot is stored. Otheriwse pick a random image store.


Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/289c8a09
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/289c8a09
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/289c8a09

Branch: refs/heads/4.3
Commit: 289c8a09ea5bf681c34f97fc676e3ba4cc5cd720
Parents: a9ca480
Author: Likitha Shetty <li...@citrix.com>
Authored: Tue Dec 24 17:22:45 2013 +0530
Committer: Likitha Shetty <li...@citrix.com>
Committed: Tue Dec 24 17:31:29 2013 +0530

----------------------------------------------------------------------
 .../cloudstack/storage/snapshot/SnapshotServiceImpl.java      | 7 ++++++-
 .../storage/snapshot/XenserverSnapshotStrategy.java           | 5 ++++-
 2 files changed, 10 insertions(+), 2 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/cloudstack/blob/289c8a09/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
index 9b73bea..7df2432 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/SnapshotServiceImpl.java
@@ -219,7 +219,12 @@ public class SnapshotServiceImpl implements SnapshotService {
     // the same store as its parent since
     // we are taking delta snapshot
     private DataStore findSnapshotImageStore(SnapshotInfo snapshot) {
-        if (snapshot.getParent() == null) {
+        Boolean fullSnapshot = true;
+        Object payload = snapshot.getPayload();
+        if (payload != null) {
+            fullSnapshot = (Boolean)payload;
+        }
+        if (fullSnapshot) {
             return dataStoreMgr.getImageStore(snapshot.getDataCenterId());
         } else {
             SnapshotInfo parentSnapshot = snapshot.getParent();

http://git-wip-us.apache.org/repos/asf/cloudstack/blob/289c8a09/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
index ae48fe4..adb24bd 100644
--- a/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
+++ b/engine/storage/snapshot/src/org/apache/cloudstack/storage/snapshot/XenserverSnapshotStrategy.java
@@ -40,6 +40,8 @@ import org.apache.log4j.Logger;
 import org.springframework.stereotype.Component;
 
 import com.cloud.exception.InvalidParameterValueException;
+import com.cloud.hypervisor.Hypervisor;
+import com.cloud.hypervisor.Hypervisor.HypervisorType;
 import com.cloud.storage.CreateSnapshotPayload;
 import com.cloud.storage.DataStoreRole;
 import com.cloud.storage.Snapshot;
@@ -108,7 +110,8 @@ public class XenserverSnapshotStrategy extends SnapshotStrategyBase {
 
         boolean fullBackup = true;
         SnapshotDataStoreVO parentSnapshotOnBackupStore = snapshotStoreDao.findLatestSnapshotForVolume(snapshot.getVolumeId(), DataStoreRole.Image);
-        if (parentSnapshotOnBackupStore != null) {
+        HypervisorType hypervisorType = snapshot.getBaseVolume().getHypervisorType();
+        if (parentSnapshotOnBackupStore != null && hypervisorType == Hypervisor.HypervisorType.XenServer) { // CS does incremental backup only for XenServer
             int _deltaSnapshotMax = NumbersUtil.parseInt(configDao.getValue("snapshot.delta.max"),
                     SnapshotManager.DELTAMAX);
             int deltaSnap = _deltaSnapshotMax;