Skip to content

Commit 481013f

Browse files
BartJMdhslove
authored andcommitted
Maintenance mode: Add host to deployment planner avoid list to fix local storage vm migration (apache#9892)
1 parent 8870a72 commit 481013f

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

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

0 commit comments

Comments
 (0)