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

secondary storage and zone-wide primary storage.
This commit is contained in:
Min Chen 2014-02-06 15:33:05 -08:00
parent 782c530685
commit 621276715a
2 changed files with 3 additions and 2 deletions

View File

@ -242,7 +242,7 @@ public class 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

@ -166,10 +166,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();
}
}