Skip to content

Commit 3cd9dee

Browse files
minchen07chaturvedia
authored andcommitted
CLOUDSTACK-6046:CreateVolume from snapshot is failing with S3 as
secondary storage and zone-wide primary storage.(cherry picked from commit 900c511) Signed-off-by: Animesh Chaturvedi <animesh@apache.org>
1 parent 278c54a commit 3cd9dee

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

engine/storage/datamotion/src/org/apache/cloudstack/storage/motion/AncientDataMotionStrategy.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -249,7 +249,7 @@ protected Answer copyVolumeFromSnapshot(DataObject snapObj, DataObject volObj) {
249249
if (srcData.getDataStore().getRole() == DataStoreRole.Primary) {
250250
ep = selector.select(volObj);
251251
} else {
252-
ep = selector.select(snapObj, volObj);
252+
ep = selector.select(srcData, volObj);
253253
}
254254

255255
CopyCommand cmd = new CopyCommand(srcData.getTO(), volObj.getTO(), _createVolumeFromSnapshotWait, VirtualMachineManager.ExecuteInSequence.value());

engine/storage/src/org/apache/cloudstack/storage/endpoint/DefaultEndPointSelector.java

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -167,10 +167,11 @@ protected EndPoint findEndPointForImageMove(DataStore srcStore, DataStore destSt
167167
poolId = destStore.getId();
168168
} else {
169169
// if both are zone scope
170-
selectedScope = srcScope;
171170
if (srcStore.getRole() == DataStoreRole.Primary) {
171+
selectedScope = srcScope;
172172
poolId = srcStore.getId();
173173
} else if (destStore.getRole() == DataStoreRole.Primary) {
174+
selectedScope = destScope;
174175
poolId = destStore.getId();
175176
}
176177
}

0 commit comments

Comments
 (0)