server: Fix host CPU number#10218
Conversation
|
@blueorangutan package |
|
@weizhouapache a [SL] Jenkins job has been kicked to build packages. It will be bundled with KVM, XenServer and VMware SystemVM templates. I'll keep you posted as I make progress. |
Codecov ReportAttention: Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## 4.19 #10218 +/- ##
============================================
+ Coverage 15.13% 15.86% +0.73%
- Complexity 11274 11277 +3
============================================
Files 5408 5042 -366
Lines 474003 444186 -29817
Branches 57821 52629 -5192
============================================
- Hits 71729 70471 -1258
+ Misses 394256 365837 -28419
+ Partials 8018 7878 -140
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. |
|
@blueorangutan test |
|
@weizhouapache a [SL] Trillian-Jenkins test job (ol8 mgmt + kvm-ol8) has been kicked to run smoke tests |
|
Packaging result [SF]: ✔️ el8 ✔️ el9 ✔️ debian ✔️ suse15. SL-JID 12133 |
|
[SF] Trillian test result (tid-12135)
|
| DecimalFormat decimalFormat = new DecimalFormat("#.##"); | ||
| if (host.getType() == Host.Type.Routing) { | ||
| float cpuOverprovisioningFactor = ApiDBUtils.getCpuOverprovisioningFactor(host.getClusterId()); | ||
| hostResponse.setCpuNumber((int)(host.getCpus() * cpuOverprovisioningFactor)); |
There was a problem hiding this comment.
this line is the main fix
the rest of the PR changes are on HostForMigrationResponse, which now extends HostResponse.
so removed lots of duplicated codes
There was a problem hiding this comment.
OK, cpu number is already set and don't override it 👍 (see line 123)
borisstoyanov
left a comment
There was a problem hiding this comment.
LGTM
(localcloud) 🐱 > list hosts filter=id,cpuallocatedvalue,cpunumber,cpusockets,cpuspeed,cpuwithoverprovisioning
{
"count": 4,
"host": [
{
"cpuallocatedvalue": 500,
"cpunumber": 3,
"cpusockets": 3,
"cpuspeed": 2100,
"cpuwithoverprovisioning": "12600",
"id": "3358a313-2cb8-4859-b2c8-32d6e36b1369"
}
While without the fix it shows cpunumber 6:
(localcloud) 🐱 > list hosts filter=id,cpuallocatedvalue,cpunumber,cpusockets,cpuspeed,cpuwithoverprovisioning
{
"count": 4,
"host": [
{
"cpuallocatedvalue": 100,
"cpunumber": 6,
"cpusockets": 3,
"cpuspeed": 2100,
"cpuwithoverprovisioning": "12600",
"id": "8e156f6f-f6c1-4551-a242-9c412a971351"
},
Description
This PR fixes #9290
Types of changes
Feature/Enhancement Scale or Bug Severity
Feature/Enhancement Scale
Bug Severity
Screenshots (if appropriate):
How Has This Been Tested?
How did you try to break this feature and the system with this change?