mirror of https://github.com/apache/cloudstack.git
CLOUDSTACK-5401: VM migration during host maintenance fails if pool.storage.capacity.disablethreshold is lowered
Changes: - During Vm migration while finding a new host within the cluster, we need to set the storagepool Id to the deployment plan too. - This will indicate the planner that the volumes are ready and no need to find new pool - This in turn will prevent the threshold check done during the pool allocation. This step is not needed since there is no need to allocate pools newly. - Thus the migration wont fail because th threshold check fails.
This commit is contained in:
parent
5475312612
commit
eb7cd06e19
|
|
@ -2054,8 +2054,16 @@ public class VirtualMachineManagerImpl extends ManagerBase implements VirtualMac
|
|||
}
|
||||
|
||||
Host host = _hostDao.findById(hostId);
|
||||
Long poolId = null;
|
||||
List<VolumeVO> vols = _volsDao.findReadyRootVolumesByInstance(vm.getId());
|
||||
for (VolumeVO rootVolumeOfVm : vols) {
|
||||
StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolumeOfVm.getPoolId());
|
||||
if (rootDiskPool != null) {
|
||||
poolId = rootDiskPool.getId();
|
||||
}
|
||||
}
|
||||
|
||||
DataCenterDeployment plan = new DataCenterDeployment(host.getDataCenterId(), host.getPodId(), host.getClusterId(), null, null, null);
|
||||
DataCenterDeployment plan = new DataCenterDeployment(host.getDataCenterId(), host.getPodId(), host.getClusterId(), null, poolId, null);
|
||||
ExcludeList excludes = new ExcludeList();
|
||||
excludes.addHost(hostId);
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue