Repository: cloudstack Updated Branches: refs/heads/master 1c8018517 -> bbcffbbab
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. Project: http://git-wip-us.apache.org/repos/asf/cloudstack/repo Commit: http://git-wip-us.apache.org/repos/asf/cloudstack/commit/6416de57 Tree: http://git-wip-us.apache.org/repos/asf/cloudstack/tree/6416de57 Diff: http://git-wip-us.apache.org/repos/asf/cloudstack/diff/6416de57 Branch: refs/heads/master Commit: 6416de5770ad5579f78dc06ebc58bb0e4262c2c2 Parents: 1c80185 Author: Anshul Gangwar <anshul.gang...@citrix.com> Authored: Mon Jun 23 11:30:50 2014 +0530 Committer: Devdeep Singh <devd...@gmail.com> Committed: Mon Jun 23 12:15:10 2014 +0530 ---------------------------------------------------------------------- server/src/com/cloud/storage/VolumeApiServiceImpl.java | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) ---------------------------------------------------------------------- http://git-wip-us.apache.org/repos/asf/cloudstack/blob/6416de57/server/src/com/cloud/storage/VolumeApiServiceImpl.java ---------------------------------------------------------------------- diff --git a/server/src/com/cloud/storage/VolumeApiServiceImpl.java b/server/src/com/cloud/storage/VolumeApiServiceImpl.java index 8a7b220..fff6b11 100644 --- a/server/src/com/cloud/storage/VolumeApiServiceImpl.java +++ b/server/src/com/cloud/storage/VolumeApiServiceImpl.java @@ -26,7 +26,6 @@ import java.util.concurrent.ExecutionException; import javax.inject.Inject; -import com.cloud.utils.DateUtil; import org.apache.log4j.Logger; import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd; @@ -116,6 +115,7 @@ import com.cloud.user.User; import com.cloud.user.VmDiskStatisticsVO; import com.cloud.user.dao.AccountDao; import com.cloud.user.dao.VmDiskStatisticsDao; +import com.cloud.utils.DateUtil; import com.cloud.utils.EnumUtils; import com.cloud.utils.NumbersUtil; import com.cloud.utils.Pair; @@ -2010,7 +2010,9 @@ public class VolumeApiServiceImpl extends ManagerBase implements VolumeApiServic } if (storeForNewStoreScope.getScopeId().equals(vmClusterId)) { return false; - } + } else { + return true; + } } else if (storeForNewStoreScope.getScopeType() == ScopeType.HOST && (storeForExistingStoreScope.getScopeType() == ScopeType.CLUSTER || storeForExistingStoreScope.getScopeType() == ScopeType.ZONE)) { Long hostId = _vmInstanceDao.findById(existingVolume.getInstanceId()).getHostId();