Skip to content

Commit ba249c0

Browse files
committed
CLOUDSTACK-1608: enable attach a volume created on zone wide storage to a vm created on cluster or host wide storage
1 parent c60ef79 commit ba249c0

1 file changed

Lines changed: 5 additions & 1 deletion

File tree

‎server/src/com/cloud/storage/VolumeManagerImpl.java‎

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1453,11 +1453,15 @@ private boolean needMoveVolume(VolumeVO rootVolumeOfVm, VolumeInfo volume) {
14531453
throw new CloudRuntimeException("Can't get scope of data store: " + storeForDataVol.getId());
14541454
}
14551455

1456+
if (storeForDataStoreScope.getScopeType() == ScopeType.ZONE) {
1457+
return false;
1458+
}
1459+
14561460
if (storeForRootStoreScope.getScopeType() != storeForDataStoreScope.getScopeType()) {
14571461
throw new CloudRuntimeException("Can't move volume between scope: " + storeForDataStoreScope.getScopeType() + " and " + storeForRootStoreScope.getScopeType());
14581462
}
14591463

1460-
return storeForRootStoreScope.isSameScope(storeForRootStoreScope);
1464+
return !storeForRootStoreScope.isSameScope(storeForDataStoreScope);
14611465
}
14621466

14631467
private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volume, Long deviceId) {

0 commit comments

Comments
 (0)