Martin Sivák has uploaded a new change for review. Change subject: core: Use proper message when scheduling fails with not enough cores ......................................................................
core: Use proper message when scheduling fails with not enough cores Leftover from scheduling reporting refactoring, the CPUPolicyUnit still used the old error message style. This updates it to the new mechanism. Change-Id: Ibf9247ecded75bb4c4a3bd8e8a7bd23e11ac670b Bug-Url: https://bugzilla.redhat.com/1129542 Signed-off-by: Martin Sivak <msi...@redhat.com> --- M backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CPUPolicyUnit.java M backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java M backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties M frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java M frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties M frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties 6 files changed, 8 insertions(+), 1 deletion(-) git pull ssh://gerrit.ovirt.org:29418/ovirt-engine refs/changes/86/32686/1 diff --git a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CPUPolicyUnit.java b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CPUPolicyUnit.java index bcf9f74..ee61641 100644 --- a/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CPUPolicyUnit.java +++ b/backend/manager/modules/bll/src/main/java/org/ovirt/engine/core/bll/scheduling/policyunits/CPUPolicyUnit.java @@ -24,7 +24,7 @@ for (VDS vds : hosts) { Integer cores = SlaValidator.getInstance().getEffectiveCpuCores(vds); if (cores != null && vm.getNumOfCpus() > cores) { - messages.addMessage(vds.getId(), VdcBllMessages.ACTION_TYPE_FAILED_VDS_VM_CPUS.toString()); + messages.addMessage(vds.getId(), VdcBllMessages.VAR__DETAIL__NOT_ENOUGH_CORES.toString()); log.debugFormat("host {0} has less cores ({1}) than vm cores ({2})", vds.getName(), cores, diff --git a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java index caa1276..f0b6e54 100644 --- a/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java +++ b/backend/manager/modules/common/src/main/java/org/ovirt/engine/core/common/errors/VdcBllMessages.java @@ -1000,6 +1000,7 @@ VAR__DETAIL__LOW_CPU_LEVEL, VAR__DETAIL__SWAP_VALUE_ILLEGAL, VAR__DETAIL__NOT_ENOUGH_MEMORY, + VAR__DETAIL__NOT_ENOUGH_CORES, SCHEDULING_NO_HOSTS, SCHEDULING_HOST_FILTERED_REASON, SCHEDULING_HOST_FILTERED_REASON_WITH_DETAIL, diff --git a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties index ecfbe32..abdf4c1 100644 --- a/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties +++ b/backend/manager/modules/dal/src/main/resources/bundles/AppErrors.properties @@ -1209,6 +1209,7 @@ VAR__DETAIL__LOW_CPU_LEVEL=$detailMessage its CPU level ${hostCPULevel} is lower than the VM requires ${vmCPULevel} VAR__DETAIL__SWAP_VALUE_ILLEGAL=$detailMessage its swap value was illegal VAR__DETAIL__NOT_ENOUGH_MEMORY=$detailMessage it has insufficient free memory to run the VM +VAR__DETAIL__NOT_ENOUGH_CORES=$detailMessage it does not have enough cores to run the VM SCHEDULING_NO_HOSTS=There are no hosts to use. Check that the cluster contains at least one host in Up state. VAR__FILTERTYPE__EXTERNAL=$filterType external VAR__FILTERTYPE__INTERNAL=$filterType internal diff --git a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java index 92432cd..2e165fd 100644 --- a/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java +++ b/frontend/webadmin/modules/frontend/src/main/java/org/ovirt/engine/ui/frontend/AppErrors.java @@ -3234,6 +3234,9 @@ @DefaultStringValue("$detailMessage it has insufficient free memory to run the VM") String VAR__DETAIL__NOT_ENOUGH_MEMORY(); + @DefaultStringValue("$detailMessage it has insufficient CPU cores to run the VM") + String VAR__DETAIL__NOT_ENOUGH_CORES(); + @DefaultStringValue("There are no hosts to use. Check that the cluster contains at least one host in Up state.") String SCHEDULING_NO_HOSTS(); diff --git a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index c35c22b..199d978 100644 --- a/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/userportal-gwtp/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -1013,6 +1013,7 @@ VAR__DETAIL__LOW_CPU_LEVEL=$detailMessage its CPU level ${hostCPULevel} is lower than the VM requires ${vmCPULevel} VAR__DETAIL__SWAP_VALUE_ILLEGAL=$detailMessage its swap value was illegal VAR__DETAIL__NOT_ENOUGH_MEMORY=$detailMessage it has insufficient free memory to run the VM +VAR__DETAIL__NOT_ENOUGH_CORES=$detailMessage it does not have enough cores to run the VM SCHEDULING_NO_HOSTS=There are no hosts to use. Check that the cluster contains at least one host in Up state. VAR__FILTERTYPE__EXTERNAL=$filterType external VAR__FILTERTYPE__INTERNAL=$filterType internal diff --git a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties index 9d3ace5..1631444 100644 --- a/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties +++ b/frontend/webadmin/modules/webadmin/src/main/resources/org/ovirt/engine/ui/frontend/AppErrors.properties @@ -1175,6 +1175,7 @@ VAR__DETAIL__LOW_CPU_LEVEL=$detailMessage its CPU level ${hostCPULevel} is lower than the VM requires ${vmCPULevel} VAR__DETAIL__SWAP_VALUE_ILLEGAL=$detailMessage its swap value was illegal VAR__DETAIL__NOT_ENOUGH_MEMORY=$detailMessage it has insufficient free memory to run the VM +VAR__DETAIL__NOT_ENOUGH_CORES=$detailMessage it does not have enough cores to run the VM SCHEDULING_NO_HOSTS=There are no hosts to use. Check that the cluster contains at least one host in Up state. VAR__FILTERTYPE__EXTERNAL=$filterType external VAR__FILTERTYPE__INTERNAL=$filterType internal -- To view, visit http://gerrit.ovirt.org/32686 To unsubscribe, visit http://gerrit.ovirt.org/settings Gerrit-MessageType: newchange Gerrit-Change-Id: Ibf9247ecded75bb4c4a3bd8e8a7bd23e11ac670b Gerrit-PatchSet: 1 Gerrit-Project: ovirt-engine Gerrit-Branch: ovirt-engine-3.5 Gerrit-Owner: Martin Sivák <msi...@redhat.com> _______________________________________________ Engine-patches mailing list Engine-patches@ovirt.org http://lists.ovirt.org/mailman/listinfo/engine-patches