Skip to content

Commit 13d2caa

Browse files
author
Prachi Damle
committed
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.
1 parent 3a6adb3 commit 13d2caa

1 file changed

Lines changed: 9 additions & 1 deletion

File tree

‎engine/orchestration/src/com/cloud/vm/VirtualMachineManagerImpl.java‎

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2047,8 +2047,16 @@ public void migrateAway(String vmUuid, long srcHostId) throws InsufficientServer
20472047
}
20482048

20492049
Host host = _hostDao.findById(hostId);
2050+
Long poolId = null;
2051+
List<VolumeVO> vols = _volsDao.findReadyRootVolumesByInstance(vm.getId());
2052+
for (VolumeVO rootVolumeOfVm : vols) {
2053+
StoragePoolVO rootDiskPool = _storagePoolDao.findById(rootVolumeOfVm.getPoolId());
2054+
if (rootDiskPool != null) {
2055+
poolId = rootDiskPool.getId();
2056+
}
2057+
}
20502058

2051-
DataCenterDeployment plan = new DataCenterDeployment(host.getDataCenterId(), host.getPodId(), host.getClusterId(), null, null, null);
2059+
DataCenterDeployment plan = new DataCenterDeployment(host.getDataCenterId(), host.getPodId(), host.getClusterId(), null, poolId, null);
20522060
ExcludeList excludes = new ExcludeList();
20532061
excludes.addHost(hostId);
20542062

0 commit comments

Comments
 (0)