Skip to content

Commit b141b8e

Browse files
committed
Merge remote-tracking branch 'origin/4.13' into 4.14
2 parents b64d0b2 + 4da374b commit b141b8e

3 files changed

Lines changed: 10 additions & 4 deletions

File tree

engine/components-api/src/main/java/com/cloud/deploy/DeploymentPlanningManager.java

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
// under the License.
1717
package com.cloud.deploy;
1818

19+
import com.cloud.dc.DataCenter;
1920
import com.cloud.deploy.DeploymentPlanner.ExcludeList;
2021
import com.cloud.exception.AffinityConflictException;
2122
import com.cloud.exception.InsufficientServerCapacityException;
@@ -49,4 +50,6 @@ String finalizeReservation(DeployDestination plannedDestination,
4950
void cleanupVMReservations();
5051

5152
DeploymentPlanner getDeploymentPlannerByName(String plannerName);
53+
54+
void checkForNonDedicatedResources(VirtualMachineProfile vmProfile, DataCenter dc, ExcludeList avoids);
5255
}

server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -362,9 +362,6 @@ public DeployDestination planDeployment(VirtualMachineProfile vmProfile, Deploym
362362
}
363363
}
364364

365-
if (vm.getType() == VirtualMachine.Type.User) {
366-
checkForNonDedicatedResources(vmProfile, dc, avoids);
367-
}
368365
if (s_logger.isDebugEnabled()) {
369366
s_logger.debug("Deploy avoids pods: " + avoids.getPodsToAvoid() + ", clusters: " + avoids.getClustersToAvoid() + ", hosts: " + avoids.getHostsToAvoid());
370367
}
@@ -572,7 +569,8 @@ public DeploymentPlanner getDeploymentPlannerByName(String plannerName) {
572569
return null;
573570
}
574571

575-
private void checkForNonDedicatedResources(VirtualMachineProfile vmProfile, DataCenter dc, ExcludeList avoids) {
572+
@Override
573+
public void checkForNonDedicatedResources(VirtualMachineProfile vmProfile, DataCenter dc, ExcludeList avoids) {
576574
boolean isExplicit = false;
577575
VirtualMachine vm = vmProfile.getVirtualMachine();
578576

server/src/main/java/com/cloud/server/ManagementServerImpl.java

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1343,6 +1343,11 @@ public Ternary<Pair<List<? extends Host>, Integer>, List<? extends Host>, Map<Ho
13431343
}
13441344
}
13451345

1346+
if (vm.getType() == VirtualMachine.Type.User || vm.getType() == VirtualMachine.Type.DomainRouter) {
1347+
final DataCenterVO dc = _dcDao.findById(srcHost.getDataCenterId());
1348+
_dpMgr.checkForNonDedicatedResources(vmProfile, dc, excludes);
1349+
}
1350+
13461351
for (final HostAllocator allocator : hostAllocators) {
13471352
if (canMigrateWithStorage) {
13481353
suitableHosts = allocator.allocateTo(vmProfile, plan, Host.Type.Routing, excludes, allHosts, HostAllocator.RETURN_UPTO_ALL, false);

0 commit comments

Comments
 (0)