From 1b1a417bb43f507cf920b99b3c0d5ebca97c1724 Mon Sep 17 00:00:00 2001 From: Anshul Gangwar Date: Fri, 20 Jun 2014 16:35:06 +0530 Subject: [PATCH] CLOUDSTACK-6968: Allowing cluster scope volumes to attach to any VM. If migration is needed then first they will be migrated to appropriate cluster before attaching. (cherry picked from commit e7ba46b5f7da21c4fc13dc3284aa802d177045f2) --- server/src/com/cloud/storage/VolumeApiServiceImpl.java | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 6703e61b3a0..fd434a50e84 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -1944,7 +1944,9 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic } if (storeForDataStoreScope.getScopeId().equals(vmClusterId)) { return false; - } + } else { + return true; + } } else if (storeForDataStoreScope.getScopeType() == ScopeType.HOST && (storeForRootStoreScope.getScopeType() == ScopeType.CLUSTER || storeForRootStoreScope.getScopeType() == ScopeType.ZONE)) { Long hostId = _vmInstanceDao.findById(rootVolumeOfVm.getInstanceId()).getHostId();