Pearl1594 commented on code in PR #13654:
URL: https://github.com/apache/cloudstack/pull/13654#discussion_r4739811946
##########
server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java:
##########
@@ -1083,8 +1084,62 @@ private void findAvoiSetForRouterVM(ExcludeList avoids,
VirtualMachine vm, List<
}
private void findAvoidSetForNonExplicitUserVM(ExcludeList avoids,
VirtualMachine vm, List<Long> allPodsInDc, List<Long> allClustersInDc,
List<Long> allHostsInDc) {
+ if (allPodsInDc.isEmpty() && allClustersInDc.isEmpty() &&
allHostsInDc.isEmpty()) {
Review Comment:
The pod, cluster and host blocks are identical except for the DAO call
(searchDedicatedPods/Clusters/Hosts) and the id getter
(getPodId/getClusterId/getHostId). Could we extract them into one helper that
takes the search call and id getter as parameters?
Something like:
```
removeDedicatedIdsAccessibleToVm(allPodsInDc, vmDomainId, vmAccountId,
hasDomainExplicitDedicationGroup,
(domainId, accountId) -> _dedicatedDao.searchDedicatedPods(null,
domainId, accountId, null, filter),
DedicatedResourceVO::getPodId);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]