From 0f1cd6009d7190535cb4e7c6ee96bbc564d3129e Mon Sep 17 00:00:00 2001 From: dahn Date: Fri, 4 Feb 2022 17:02:32 +0100 Subject: [PATCH 1/8] add logging to deployment planners (#5859) Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com> Co-authored-by: Daan Hoogland Co-authored-by: Daniel Augusto Veronezi Salvador <38945620+GutoVeronezi@users.noreply.github.com> Co-authored-by: sureshanaparti <12028987+sureshanaparti@users.noreply.github.com> --- .../org/apache/cloudstack/api/BaseCmd.java | 2 +- .../cloud/entity/api/VMEntityManagerImpl.java | 2 +- .../affinity/ExplicitDedicationProcessor.java | 6 ++++++ .../deploy/ImplicitDedicationPlanner.java | 2 +- .../deploy/DeploymentPlanningManagerImpl.java | 19 ++++++++++++++++++- ui/public/locales/en.json | 2 +- ui/src/views/offering/AddComputeOffering.vue | 2 +- 7 files changed, 29 insertions(+), 6 deletions(-) diff --git a/api/src/main/java/org/apache/cloudstack/api/BaseCmd.java b/api/src/main/java/org/apache/cloudstack/api/BaseCmd.java index 6575f1e6062..475745d081a 100644 --- a/api/src/main/java/org/apache/cloudstack/api/BaseCmd.java +++ b/api/src/main/java/org/apache/cloudstack/api/BaseCmd.java @@ -355,7 +355,7 @@ public abstract class BaseCmd { if (roleIsAllowed) { validFields.add(field); } else { - s_logger.debug("Ignoring paremeter " + parameterAnnotation.name() + " as the caller is not authorized to pass it in"); + s_logger.debug("Ignoring parameter " + parameterAnnotation.name() + " as the caller is not authorized to pass it in"); } } diff --git a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java index 02ffb37ba15..d9b7722f308 100644 --- a/engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java +++ b/engine/orchestration/src/main/java/org/apache/cloudstack/engine/cloud/entity/api/VMEntityManagerImpl.java @@ -221,7 +221,7 @@ public class VMEntityManagerImpl implements VMEntityManager { // call retry it. return UUID.randomUUID().toString(); } else { - throw new InsufficientServerCapacityException("Unable to create a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId(), + throw new InsufficientServerCapacityException("No destination found for a deployment for " + vmProfile, DataCenter.class, plan.getDataCenterId(), areAffinityGroupsAssociated(vmProfile)); } } diff --git a/plugins/affinity-group-processors/explicit-dedication/src/main/java/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java b/plugins/affinity-group-processors/explicit-dedication/src/main/java/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java index 905890493d2..8070a7409b5 100644 --- a/plugins/affinity-group-processors/explicit-dedication/src/main/java/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java +++ b/plugins/affinity-group-processors/explicit-dedication/src/main/java/org/apache/cloudstack/affinity/ExplicitDedicationProcessor.java @@ -305,6 +305,9 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase implement for (HostPodVO pod : podList) { DedicatedResourceVO dPod = _dedicatedDao.findByPodId(pod.getId()); if (dPod != null && !dedicatedResources.contains(dPod)) { + if (s_logger.isDebugEnabled()) { + s_logger.debug(String.format("Avoiding POD %s [%s] because it is not dedicated.", pod.getName(), pod.getUuid())); + } avoidList.addPod(pod.getId()); } else { includeList.addPod(pod.getId()); @@ -343,6 +346,9 @@ public class ExplicitDedicationProcessor extends AffinityProcessorBase implement for (HostPodVO pod : pods) { if (podsInIncludeList != null && !podsInIncludeList.contains(pod.getId())) { + if (s_logger.isDebugEnabled()) { + s_logger.debug(String.format("Avoiding POD %s [%s], as it is not in include list.", pod.getName(), pod.getUuid())); + } avoidList.addPod(pod.getId()); } } diff --git a/plugins/deployment-planners/implicit-dedication/src/main/java/com/cloud/deploy/ImplicitDedicationPlanner.java b/plugins/deployment-planners/implicit-dedication/src/main/java/com/cloud/deploy/ImplicitDedicationPlanner.java index 45f16abd2af..2c5a72498bc 100644 --- a/plugins/deployment-planners/implicit-dedication/src/main/java/com/cloud/deploy/ImplicitDedicationPlanner.java +++ b/plugins/deployment-planners/implicit-dedication/src/main/java/com/cloud/deploy/ImplicitDedicationPlanner.java @@ -107,7 +107,7 @@ public class ImplicitDedicationPlanner extends FirstFitPlanner implements Deploy } } - // Hosts running vms of other accounts created by ab implicit planner in strict mode should always be avoided. + // Hosts running vms of other accounts created by an implicit planner in strict mode should always be avoided. avoid.addHostList(hostRunningStrictImplicitVmsOfOtherAccounts); if (!hostRunningVmsOfAccount.isEmpty() && (hostsToAvoid == null || !hostsToAvoid.containsAll(hostRunningVmsOfAccount))) { diff --git a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java index 5a42f6e321c..fd33bed50c3 100644 --- a/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java +++ b/server/src/main/java/com/cloud/deploy/DeploymentPlanningManagerImpl.java @@ -754,9 +754,17 @@ StateListener, Configurable { //Only when the type is instance VM and not explicitly dedicated. if (vm.getType() == VirtualMachine.Type.User && !isExplicit) { //add explicitly dedicated resources in avoidList - + if (s_logger.isDebugEnabled()) { + s_logger.debug("Adding pods to avoid lists for non-explicit VM deployment: " + allPodsInDc); + } avoids.addPodList(allPodsInDc); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Adding clusters to avoid lists for non-explicit VM deployment: " + allClustersInDc); + } avoids.addClusterList(allClustersInDc); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Adding hosts to avoid lists for non-explicit VM deployment: " + allHostsInDc); + } avoids.addHostList(allHostsInDc); } @@ -835,8 +843,17 @@ StateListener, Configurable { } //Add in avoid list or no addition if no dedication + if (s_logger.isDebugEnabled()) { + s_logger.debug("Adding pods to avoid lists: " + allPodsInDc); + } avoids.addPodList(allPodsInDc); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Adding clusters to avoid lists: " + allClustersInDc); + } avoids.addClusterList(allClustersInDc); + if (s_logger.isDebugEnabled()) { + s_logger.debug("Adding hosts to avoid lists: " + allHostsInDc); + } avoids.addHostList(allHostsInDc); } } diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 9c44d838495..60dbff4444b 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -1674,7 +1674,7 @@ "label.powerflex.gateway.username": "Gateway Username", "label.powerflex.storage.pool": "Storage Pool", "label.powerstate": "Power State", -"label.preferred": "Prefered", +"label.preferred": "Preferred", "label.presetup": "PreSetup", "label.prev": "Prev", "label.previous": "Previous", diff --git a/ui/src/views/offering/AddComputeOffering.vue b/ui/src/views/offering/AddComputeOffering.vue index 3aa52ac458d..bcc09c1e9d5 100644 --- a/ui/src/views/offering/AddComputeOffering.vue +++ b/ui/src/views/offering/AddComputeOffering.vue @@ -394,7 +394,7 @@ {{ $t('label.strict') }} - + {{ $t('label.preferred') }} From 5adf608f80349c3aa119d2d96b66317b9dd30ec6 Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 7 Feb 2022 07:11:33 +0100 Subject: [PATCH 2/8] mvn: upgrade to xerces 2.12.2 (#5944) Fixes: #5943 --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index 67cbc6e2e5b..b3cb18e46a9 100644 --- a/pom.xml +++ b/pom.xml @@ -113,7 +113,7 @@ 1.0.1 7.1.0 2.27.2 - 2.12.0 + 2.12.2 5.10.0 From 5db6b86200dfd2e4b6fc83bc0acbb528cb9fef3d Mon Sep 17 00:00:00 2001 From: PJ Fanning Date: Mon, 7 Feb 2022 07:35:42 +0100 Subject: [PATCH 3/8] [issue-5946] upgrade to xstream 1.4.19 (#5947) --- pom.xml | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/pom.xml b/pom.xml index b3cb18e46a9..c78dc9f3d67 100644 --- a/pom.xml +++ b/pom.xml @@ -171,7 +171,7 @@ 0.5.0 6.2.0-3.1 3.1.3 - 1.4.15 + 1.4.19 5.3.3 0.5.4 1.12.0 From 81b49b835a477ed555decd43627d8ba7dc4f6e98 Mon Sep 17 00:00:00 2001 From: Abhishek Kumar Date: Mon, 7 Feb 2022 16:30:40 +0530 Subject: [PATCH 4/8] ui: fix select networks for template nic (#5933) * ui: fix select networks for template nic Fixes #5927 Signed-off-by: Abhishek Kumar --- ui/public/locales/en.json | 2 + .../InstanceNicsNetworkSelectListView.vue | 149 ++++++++++++ .../components/view/NicNetworkSelectForm.vue | 228 ++++++++++++++++++ ui/src/views/compute/DeployVM.vue | 62 +++-- 4 files changed, 407 insertions(+), 34 deletions(-) create mode 100644 ui/src/components/view/InstanceNicsNetworkSelectListView.vue create mode 100644 ui/src/components/view/NicNetworkSelectForm.vue diff --git a/ui/public/locales/en.json b/ui/public/locales/en.json index 60dbff4444b..7504bb7ef4d 100644 --- a/ui/public/locales/en.json +++ b/ui/public/locales/en.json @@ -552,6 +552,7 @@ "label.certificate.upload.failed": "Certificate Upload Failed", "label.certificate.upload.failed.description": "Failed to update SSL Certificate. Failed to pass certificate validation check", "label.certificateid": "Certificate ID", +"label.change": "Change", "label.change.affinity": "Change Affinity", "label.change.ip.addess": "Change IP Address", "label.change.ipaddress": "Change IP address for NIC", @@ -1978,6 +1979,7 @@ "label.select.instance": "Select instance", "label.select.instance.to.attach.volume.to": "Select instance to attach volume to", "label.select.iso.or.template": "Select ISO or template", +"label.select.network": "Select Network", "label.select.offering": "Select offering", "label.select.project": "Select Project", "label.select.projects": "Select Projects", diff --git a/ui/src/components/view/InstanceNicsNetworkSelectListView.vue b/ui/src/components/view/InstanceNicsNetworkSelectListView.vue new file mode 100644 index 00000000000..42b61624a7e --- /dev/null +++ b/ui/src/components/view/InstanceNicsNetworkSelectListView.vue @@ -0,0 +1,149 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/components/view/NicNetworkSelectForm.vue b/ui/src/components/view/NicNetworkSelectForm.vue new file mode 100644 index 00000000000..8c1b59db14f --- /dev/null +++ b/ui/src/components/view/NicNetworkSelectForm.vue @@ -0,0 +1,228 @@ +// Licensed to the Apache Software Foundation (ASF) under one +// or more contributor license agreements. See the NOTICE file +// distributed with this work for additional information +// regarding copyright ownership. The ASF licenses this file +// to you under the Apache License, Version 2.0 (the +// "License"); you may not use this file except in compliance +// with the License. You may obtain a copy of the License at +// +// http://www.apache.org/licenses/LICENSE-2.0 +// +// Unless required by applicable law or agreed to in writing, +// software distributed under the License is distributed on an +// "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY +// KIND, either express or implied. See the License for the +// specific language governing permissions and limitations +// under the License. + + + + + + diff --git a/ui/src/views/compute/DeployVM.vue b/ui/src/views/compute/DeployVM.vue index cbabe796ff4..3c330e1278d 100644 --- a/ui/src/views/compute/DeployVM.vue +++ b/ui/src/views/compute/DeployVM.vue @@ -330,31 +330,10 @@