Skip to content

Commit

Permalink
Maintenance mode: Add host to deployment planner avoid list to fix lo…
Browse files Browse the repository at this point in the history
…cal storage vm migration
  • Loading branch information
BartJM committed Nov 4, 2024
1 parent 8af08dd commit c460198
Showing 1 changed file with 3 additions and 1 deletion.
Original file line number Diff line number Diff line change
Expand Up @@ -1469,8 +1469,10 @@ private void migrateAwayVmWithVolumes(HostVO host, VMInstanceVO vm) {
final VirtualMachineProfile profile = new VirtualMachineProfileImpl(vm, null, offeringVO, null, null);
plan.setMigrationPlan(true);
DeployDestination dest = null;
DeploymentPlanner.ExcludeList avoids = new DeploymentPlanner.ExcludeList();
avoids.addHost(host.getId());
try {
dest = deploymentManager.planDeployment(profile, plan, new DeploymentPlanner.ExcludeList(), null);
dest = deploymentManager.planDeployment(profile, plan, avoids, null);
} catch (InsufficientServerCapacityException e) {
throw new CloudRuntimeException(String.format("Maintenance failed, could not find deployment destination for VM [id=%s, name=%s].", vm.getId(), vm.getInstanceName()),
e);
Expand Down

0 comments on commit c460198

Please sign in to comment.