Skip to content

Commit a163831

Browse files
authored
Maintenance mode: Add host to deployment planner avoid list to fix local storage vm migration (#9892)
1 parent 9f594c9 commit a163831

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

server/src/main/java/com/cloud/resource/ResourceManagerImpl.java

+3-1
Original file line numberDiff line numberDiff line change
@@ -1473,8 +1473,10 @@ private void migrateAwayVmWithVolumes(HostVO host, VMInstanceVO vm) {
14731473
final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm, null, offeringVO, null, null);
14741474
plan.setMigrationPlan(true);
14751475
DeployDestination dest = null;
1476+
DeploymentPlanner.ExcludeList avoids = new DeploymentPlanner.ExcludeList();
1477+
avoids.addHost(host.getId());
14761478
try {
1477-
dest = deploymentManager.planDeployment(profile, plan, new DeploymentPlanner.ExcludeList(), null);
1479+
dest = deploymentManager.planDeployment(profile, plan, avoids, null);
14781480
} catch (InsufficientServerCapacityException e) {
14791481
throw new CloudRuntimeException(String.format("Maintenance failed, could not find deployment destination for VM: %s.", vm), e);
14801482
}

0 commit comments

Comments
 (0)