Skip to content

Commit 0f1cd60

Browse files
DaanHooglandDaan HooglandGutoVeronezisureshanaparti
authored
add logging to deployment planners (apache#5859)
Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com> Co-authored-by: Daan Hoogland <dahn@onecht.net> Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com> Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com>
1 parent 966b32c commit 0f1cd60

7 files changed

Lines changed: 29 additions & 6 deletions

File tree

api/src/main/java/org/apache/cloudstack/api/BaseCmd.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -355,7 +355,7 @@ public List<Field> getParamFields() {
355355
if (roleIsAllowed) {
356356
validFields.add(field);
357357
} else {
358-
s_logger.debug("Ignoring paremeter " + parameterAnnotation.name() + " as the caller is not authorized to pass it in");
358+
s_logger.debug("Ignoring parameter " + parameterAnnotation.name() + " as the caller is not authorized to pass it in");
359359
}
360360
}
361361

engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -221,7 +221,7 @@ public String reserveVirtualMachine(VMEntityVO vmEntityVO, DeploymentPlanner pla
221221
// call retry it.
222222
return UUID.randomUUID().toString();
223223
} else {
224-
throw new InsufficientServerCapacityException("Unable to create a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId(),
224+
throw new InsufficientServerCapacityException("No destination found for a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId(),
225225
areAffinityGroupsAssociated(vmProfile));
226226
}
227227
}

plugins/affinity-group-processors/explicit-dedication/src/main/java/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -305,6 +305,9 @@ private ExcludeList updateAvoidList(List<DedicatedResourceVO> dedicatedResources
305305
for (HostPodVO pod : podList) {
306306
DedicatedResourceVO dPod = _dedicatedDao.findByPodId(pod.getId());
307307
if (dPod != null && !dedicatedResources.contains(dPod)) {
308+
if (s_logger.isDebugEnabled()) {
309+
s_logger.debug(String.format("Avoiding POD %s [%s] because it is not dedicated.", pod.getName(), pod.getUuid()));
310+
}
308311
avoidList.addPod(pod.getId());
309312
} else {
310313
includeList.addPod(pod.getId());
@@ -343,6 +346,9 @@ private ExcludeList updateAvoidList(List<DedicatedResourceVO> dedicatedResources
343346

344347
for (HostPodVO pod : pods) {
345348
if (podsInIncludeList != null && !podsInIncludeList.contains(pod.getId())) {
349+
if (s_logger.isDebugEnabled()) {
350+
s_logger.debug(String.format("Avoiding POD %s [%s], as it is not in include list.", pod.getName(), pod.getUuid()));
351+
}
346352
avoidList.addPod(pod.getId());
347353
}
348354
}

plugins/deployment-planners/implicit-dedication/src/main/java/com/cloud/deploy/ImplicitDedicationPlanner.java

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -107,7 +107,7 @@ public List<Long> orderClusters(VirtualMachineProfile vmProfile, DeploymentPlan
107107
}
108108
}
109109

110-
// Hosts running vms of other accounts created by ab implicit planner in strict mode should always be avoided.
110+
// Hosts running vms of other accounts created by an implicit planner in strict mode should always be avoided.
111111
avoid.addHostList(hostRunningStrictImplicitVmsOfOtherAccounts);
112112

113113
if (!hostRunningVmsOfAccount.isEmpty() && (hostsToAvoid == null || !hostsToAvoid.containsAll(hostRunningVmsOfAccount))) {

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

Lines changed: 18 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,9 +754,17 @@ public void checkForNonDedicatedResources(VirtualMachineProfile vmProfile, DataC
754754
//Only when the type is instance VM and not explicitly dedicated.
755755
if (vm.getType() == VirtualMachine.Type.User && !isExplicit) {
756756
//add explicitly dedicated resources in avoidList
757-
757+
if (s_logger.isDebugEnabled()) {
758+
s_logger.debug("Adding pods to avoid lists for non-explicit VM deployment: " + allPodsInDc);
759+
}
758760
avoids.addPodList(allPodsInDc);
761+
if (s_logger.isDebugEnabled()) {
762+
s_logger.debug("Adding clusters to avoid lists for non-explicit VM deployment: " + allClustersInDc);
763+
}
759764
avoids.addClusterList(allClustersInDc);
765+
if (s_logger.isDebugEnabled()) {
766+
s_logger.debug("Adding hosts to avoid lists for non-explicit VM deployment: " + allHostsInDc);
767+
}
760768
avoids.addHostList(allHostsInDc);
761769
}
762770

@@ -835,8 +843,17 @@ public void checkForNonDedicatedResources(VirtualMachineProfile vmProfile, DataC
835843
}
836844

837845
//Add in avoid list or no addition if no dedication
846+
if (s_logger.isDebugEnabled()) {
847+
s_logger.debug("Adding pods to avoid lists: " + allPodsInDc);
848+
}
838849
avoids.addPodList(allPodsInDc);
850+
if (s_logger.isDebugEnabled()) {
851+
s_logger.debug("Adding clusters to avoid lists: " + allClustersInDc);
852+
}
839853
avoids.addClusterList(allClustersInDc);
854+
if (s_logger.isDebugEnabled()) {
855+
s_logger.debug("Adding hosts to avoid lists: " + allHostsInDc);
856+
}
840857
avoids.addHostList(allHostsInDc);
841858
}
842859
}

ui/public/locales/en.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1674,7 +1674,7 @@
16741674
"label.powerflex.gateway.username": "Gateway Username",
16751675
"label.powerflex.storage.pool": "Storage Pool",
16761676
"label.powerstate": "Power State",
1677-
"label.preferred": "Prefered",
1677+
"label.preferred": "Preferred",
16781678
"label.presetup": "PreSetup",
16791679
"label.prev": "Prev",
16801680
"label.previous": "Previous",

ui/src/views/offering/AddComputeOffering.vue

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -394,7 +394,7 @@
394394
<a-radio-button value="strict">
395395
{{ $t('label.strict') }}
396396
</a-radio-button>
397-
<a-radio-button value="preferred">
397+
<a-radio-button value="Preferred">
398398
{{ $t('label.preferred') }}
399399
</a-radio-button>
400400
</a-radio-group>

0 commit comments

Comments
 (0)