CLOUDSTACK-6046:CreateVolume from snapshot is failing with S3 as secondary storage and zone-wide primary storage.(cherry picked from commit 900c51103ab1e29b86ea5f76cb73c72b3de51db7)
Signed-off-by: Animesh Chaturvedi <[email protected]> Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/3cd9dee1 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/3cd9dee1 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/3cd9dee1 Branch: refs/heads/4.3 Commit: 3cd9dee1db21794f19fff3699ed79115bfe02ecc Parents: 278c54a Author: Min Chen <[email protected]> Authored: Thu Feb 6 15:33:05 2014 -0800 Committer: Animesh Chaturvedi <[email protected]> Committed: Fri Feb 7 13:24:48 2014 -0800 ---------------------------------------------------------------------- .../cloudstack/storage/motion/AncientDataMotionStrategy.java | 2 +- .../cloudstack/storage/endpoint/DefaultEndPointSelector.java | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3cd9dee1/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 30edf68..f2ed667 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 @@ -249,7 +249,7 @@ AncientDataMotionStrategy implements DataMotionStrategy { if (srcData.getDataStore().getRole() == DataStoreRole.Primary) { ep = selector.select(volObj); } else { - ep = selector.select(snapObj, volObj); + ep = selector.select(srcData, volObj); } CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait, VirtualMachineManager.ExecuteInSequence.value()); http://git-wip-us.apache.org/repos/asf/cloudstack/blob/3cd9dee1/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 967251f..39bc839 100644 --- a/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java +++ b/engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java @@ -167,10 +167,11 @@ public class DefaultEndPointSelector implements EndPointSelector { poolId = destStore.getId(); } else { // if both are zone scope - selectedScope = srcScope; if (srcStore.getRole() == DataStoreRole.Primary) { + selectedScope = srcScope; poolId = srcStore.getId(); } else if (destStore.getRole() == DataStoreRole.Primary) { + selectedScope = destScope; poolId = destStore.getId(); } }
