Skip to content

Commit c460198

Browse files
committed
Maintenance mode: Add host to deployment planner avoid list to fix local storage vm migration
1 parent 8af08dd commit c460198

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
@@ -1469,8 +1469,10 @@ private void migrateAwayVmWithVolumes(HostVO host, VMInstanceVO vm) {
14691469
final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm, null, offeringVO, null, null);
14701470
plan.setMigrationPlan(true);
14711471
DeployDestination dest = null;
1472+
DeploymentPlanner.ExcludeList avoids = new DeploymentPlanner.ExcludeList();
1473+
avoids.addHost(host.getId());
14721474
try {
1473-
dest = deploymentManager.planDeployment(profile, plan, new DeploymentPlanner.ExcludeList(), null);
1475+
dest = deploymentManager.planDeployment(profile, plan, avoids, null);
14741476
} catch (InsufficientServerCapacityException e) {
14751477
throw new CloudRuntimeException(String.format("Maintenance failed, could not find deployment destination for VM [id=%s, name=%s].", vm.getId(), vm.getInstanceName()),
14761478
e);

0 commit comments

Comments
 (0)