mirror of
https://github.com/apache/cloudstack.git
synced 2025-11-02 20:02:29 +01:00
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.
This commit is contained in:
parent
1c80185170
commit
6416de5770
@ -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();
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user