CLOUDSTACK-6046:CreateVolume from snapshot is failing with S3 as

secondary storage and zone-wide primary storage.(cherry picked from commit 900c51103a)

Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
This commit is contained in:
Min Chen 2014-02-06 15:33:05 -08:00 committed by Animesh Chaturvedi
parent 278c54a970
commit 3cd9dee1db
2 changed files with 3 additions and 2 deletions

View File

@ -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());

View File

@ -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();
}
}