CLOUDSTACK-1608: enable attach a volume created on zone wide storage to a vm created on cluster or host wide storage

This commit is contained in:
Edison Su 2013-03-19 14:45:17 -07:00
parent c60ef79321
commit ba249c0e66
1 changed files with 5 additions and 1 deletions

View File

@ -1453,11 +1453,15 @@ public class VolumeManagerImpl extends ManagerBase implements VolumeManager {
throw new CloudRuntimeException("Can't get scope of data store: " + storeForDataVol.getId());
}
if (storeForDataStoreScope.getScopeType() == ScopeType.ZONE) {
return false;
}
if (storeForRootStoreScope.getScopeType() != storeForDataStoreScope.getScopeType()) {
throw new CloudRuntimeException("Can't move volume between scope: " + storeForDataStoreScope.getScopeType() + " and " + storeForRootStoreScope.getScopeType());
}
return storeForRootStoreScope.isSameScope(storeForRootStoreScope);
return !storeForRootStoreScope.isSameScope(storeForDataStoreScope);
}
private VolumeVO sendAttachVolumeCommand(UserVmVO vm, VolumeVO volume, Long deviceId) {