Skip to content

Commit 6416de5

Browse files
anshulgangwardevdeep
authored andcommitted
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.
1 parent 1c80185 commit 6416de5

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

server/src/com/cloud/storage/VolumeApiServiceImpl.java

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626

2727
import javax.inject.Inject;
2828

29-
import com.cloud.utils.DateUtil;
3029
import org.apache.log4j.Logger;
3130

3231
import org.apache.cloudstack.api.command.user.volume.AttachVolumeCmd;
@@ -116,6 +115,7 @@
116115
import com.cloud.user.VmDiskStatisticsVO;
117116
import com.cloud.user.dao.AccountDao;
118117
import com.cloud.user.dao.VmDiskStatisticsDao;
118+
import com.cloud.utils.DateUtil;
119119
import com.cloud.utils.EnumUtils;
120120
import com.cloud.utils.NumbersUtil;
121121
import com.cloud.utils.Pair;
@@ -2010,7 +2010,9 @@ private boolean needMoveVolume(VolumeVO existingVolume, VolumeInfo newVolume) {
20102010
}
20112011
if (storeForNewStoreScope.getScopeId().equals(vmClusterId)) {
20122012
return false;
2013-
}
2013+
} else {
2014+
return true;
2015+
}
20142016
} else if (storeForNewStoreScope.getScopeType() == ScopeType.HOST
20152017
&& (storeForExistingStoreScope.getScopeType() == ScopeType.CLUSTER || storeForExistingStoreScope.getScopeType() == ScopeType.ZONE)) {
20162018
Long hostId = _vmInstanceDao.findById(existingVolume.getInstanceId()).getHostId();

0 commit comments

Comments
 (0)