cloudstack-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From likit...@apache.org
Subject git commit: updated refs/heads/master to e659751
Date Tue, 24 Dec 2013 12:25:02 GMT
Updated Branches:
  refs/heads/master b544669a8 -> e659751a8


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/e659751a
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e659751a
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e659751a

Branch: refs/heads/master
Commit: e659751a8aa99ed26b59e4ab7f377e889024160e
Parents: b544669
Author: Likitha Shetty <likitha.shetty@citrix.com>
Authored: Tue Dec 24 17:22:45 2013 +0530
Committer: Likitha Shetty <likitha.shetty@citrix.com>
Committed: Tue Dec 24 17:34:19 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/e659751a/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 9940249..fb68958 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
@@ -216,7 +216,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/e659751a/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 bcae7b5..ad7e0f3 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
@@ -39,6 +39,8 @@ import org.apache.cloudstack.storage.datastore.db.SnapshotDataStoreVO;
 import org.apache.cloudstack.storage.to.SnapshotObjectTO;
 
 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;
@@ -106,7 +108,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;


Mime
View raw message