You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@cloudstack.apache.org by mc...@apache.org on 2013/08/10 03:27:00 UTC
[1/3] git commit: updated refs/heads/master to 3efa276
Updated Branches:
refs/heads/master 24ef5ba9f -> 3efa2767a
CLOUDSTACK-4129: select SSVM based on ImageCache data store instead of
region wide image store.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/e018936d
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/e018936d
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/e018936d
Branch: refs/heads/master
Commit: e018936dc46f448bdcd656b09a1830f5d553b8ec
Parents: 24ef5ba
Author: Min Chen <mi...@citrix.com>
Authored: Fri Aug 9 16:27:32 2013 -0700
Committer: Min Chen <mi...@citrix.com>
Committed: Fri Aug 9 18:13:29 2013 -0700
----------------------------------------------------------------------
.../storage/endpoint/DefaultEndPointSelector.java | 9 ++++++++-
1 file changed, 8 insertions(+), 1 deletion(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/e018936d/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
----------------------------------------------------------------------
diff --git a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
index d2ddfd4..0cd8ad3 100644
--- a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
+++ b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java
@@ -166,7 +166,14 @@ public class DefaultEndPointSelector implements EndPointSelector {
if (moveBetweenPrimaryImage(srcStore, destStore)) {
return findEndPointForImageMove(srcStore, destStore);
} else if (moveBetweenCacheAndImage(srcStore, destStore)) {
- EndPoint ep = findEndpointForImageStorage(destStore);
+ // pick ssvm based on image cache dc
+ DataStore selectedStore = null;
+ if (srcStore.getRole() == DataStoreRole.ImageCache) {
+ selectedStore = srcStore;
+ } else {
+ selectedStore = destStore;
+ }
+ EndPoint ep = findEndpointForImageStorage(selectedStore);
return ep;
} else if (moveBetweenImages(srcStore, destStore)) {
EndPoint ep = findEndpointForImageStorage(destStore);
[2/3] git commit: updated refs/heads/master to 3efa276
Posted by mc...@apache.org.
CLOUDSTACK-4204:[Object_store_refactor] Snapshot created from volume in
zone2 is copying to secondary staging storages in zone1
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/fc774377
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/fc774377
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/fc774377
Branch: refs/heads/master
Commit: fc7743773a1f12e365fdfc9a7da84b08a4fd335b
Parents: e018936
Author: Min Chen <mi...@citrix.com>
Authored: Fri Aug 9 18:02:28 2013 -0700
Committer: Min Chen <mi...@citrix.com>
Committed: Fri Aug 9 18:13:46 2013 -0700
----------------------------------------------------------------------
.../motion/AncientDataMotionStrategy.java | 20 ++++++++++++++++++--
1 file changed, 18 insertions(+), 2 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/fc774377/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
index dc1b1bf..b643466 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
@@ -177,6 +177,21 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
return zoneScope;
}
+ private Scope pickCacheScopeForCopy(DataObject srcData, DataObject destData) {
+ Scope srcScope = srcData.getDataStore().getScope();
+ Scope destScope = destData.getDataStore().getScope();
+
+ Scope selectedScope = null;
+ if (srcScope.getScopeId() != null) {
+ selectedScope = srcScope;
+ } else if (destScope.getScopeId() != null) {
+ selectedScope = destScope;
+ } else {
+ s_logger.warn("Cannot find a zone-wide scope for move between cache store and image store");
+ }
+ return selectedScope;
+ }
+
protected Answer copyObject(DataObject srcData, DataObject destData) {
String value = configDao.getValue(Config.PrimaryStorageDownloadWait.toString());
int _primaryStorageDownloadWait = NumbersUtil.parseInt(value,
@@ -186,7 +201,7 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
DataObject srcForCopy = srcData;
try {
if (needCacheStorage(srcData, destData)) {
- Scope destScope = getZoneScope(destData.getDataStore().getScope());
+ Scope destScope = pickCacheScopeForCopy(srcData, destData);
srcForCopy = cacheData = cacheMgr.createCacheObject(srcData, destScope);
}
@@ -436,7 +451,8 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
Answer answer = null;
try {
if (needCacheStorage(srcData, destData)) {
- cacheData = cacheMgr.getCacheObject(srcData, destData.getDataStore().getScope());
+ Scope selectedScope = pickCacheScopeForCopy(srcData, destData);
+ cacheData = cacheMgr.getCacheObject(srcData, selectedScope);
CopyCommand cmd = new CopyCommand(srcData.getTO(), destData.getTO(), _backupsnapshotwait, _mgmtServer.getExecuteInSequence());
cmd.setCacheTO(cacheData.getTO());
[3/3] git commit: updated refs/heads/master to 3efa276
Posted by mc...@apache.org.
CLOUDSTACK-4204: return a ZoneScope in picking cache storage.
Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo
Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3efa2767
Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3efa2767
Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3efa2767
Branch: refs/heads/master
Commit: 3efa2767a88cdc68aadb4d8acb8ca2198ed39538
Parents: fc77437
Author: Min Chen <mi...@citrix.com>
Authored: Fri Aug 9 18:11:53 2013 -0700
Committer: Min Chen <mi...@citrix.com>
Committed: Fri Aug 9 18:14:01 2013 -0700
----------------------------------------------------------------------
.../cloudstack/storage/motion/AncientDataMotionStrategy.java | 6 +++---
1 file changed, 3 insertions(+), 3 deletions(-)
----------------------------------------------------------------------
http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3efa2767/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
----------------------------------------------------------------------
diff --git a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
index b643466..0fed922 100644
--- a/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
+++ b/engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java
@@ -183,11 +183,11 @@ public class AncientDataMotionStrategy implements DataMotionStrategy {
Scope selectedScope = null;
if (srcScope.getScopeId() != null) {
- selectedScope = srcScope;
+ selectedScope = getZoneScope(srcScope);
} else if (destScope.getScopeId() != null) {
- selectedScope = destScope;
+ selectedScope = getZoneScope(destScope);
} else {
- s_logger.warn("Cannot find a zone-wide scope for move between cache store and image store");
+ s_logger.warn("Cannot find a zone-wide scope for movement that needs a cache storage");
}
return selectedScope;
}