apache / cloudstack

Apache CloudStack is an opensource Infrastructure as a Service (IaaS) cloud computing platform
https://cloudstack.apache.org/
Apache License 2.0
1.83k stars 1.07k forks source link

Wrong CPU mumber reported in list hosts #9290

Open fermosan opened 1 week ago

fermosan commented 1 week ago
ISSUE TYPE

Bug

COMPONENT NAME
Component: API
CLOUDSTACK VERSION
4.19.0.1
CONFIGURATION
OS / ENVIRONMENT

UBUNTU 22.04

SUMMARY

The cpunumber reported from list hosts is incosistent with physical hardware and records in database host table.

STEPS TO REPRODUCE
Maybe its related to fix #8252 and issue #6744 

The host has 
88 Cores
2.2 Ghz
(overprovisioning factor 1)

that means a maximum share of 193600 according to the #8252 patch
EXPECTED RESULTS
cpunumber matches physical hardware and detected cpus from host table
ACTUAL RESULTS
list hosts  filter=id,cpuallocatedvalue,cpunumber,cpusockets,cpuspeed,cpuwithoverprovisioning
{
  "count": 13,
  "host": [
    {
      "cpuallocatedvalue": 13500,
      "cpunumber": 176,
      "cpusockets": 2,
      "cpuspeed": 2200,
      "cpuwithoverprovisioning": "387200",
      "id": "7a75ccbc-8184-46ed-b42d-f9cdba1b9ccc"
    },
    {
      "cpuallocatedvalue": 24500,
      "cpunumber": 176,
      "cpusockets": 2,
      "cpuspeed": 2200,
      "cpuwithoverprovisioning": "387200",
      "id": "6dff8ccf-ad40-4755-8208-bea9745129d4"
    },
    {
      "cpuallocatedvalue": 14000,
      "cpunumber": 176,
      "cpusockets": 2,
      "cpuspeed": 2200,
      "cpuwithoverprovisioning": "387200",
      "id": "d2533dd4-1ed8-4b92-8001-4704b1973903"
    },
    {
      "cpuallocatedvalue": 18500,
      "cpunumber": 176,
      "cpusockets": 2,
      "cpuspeed": 2200,
      "cpuwithoverprovisioning": "387200",
      "id": "b5a0d84b-6248-4054-b61a-603e76fb8b2e"
    },
    {
      "cpuallocatedvalue": 12500,
      "cpunumber": 176,
      "cpusockets": 2,
      "cpuspeed": 2200,
      "cpuwithoverprovisioning": "387200",
      "id": "a1322c18-c806-4f05-bb44-9ec9d800d2bd"
    },
    {
      "cpuallocatedvalue": 16000,
      "cpunumber": 176,
      "cpusockets": 2,
      "cpuspeed": 2200,
      "cpuwithoverprovisioning": "387200",
      "id": "23016ba8-c508-4b60-b850-c992f01a5340"
    },
    {
      "id": "6f62f21a-ccd8-4e62-a311-5033a813e887"
    },
    {
      "id": "9d8d6faa-3221-4ed2-ac27-a1cdcdae5293"
    },
    {
      "cpuallocatedvalue": 16000,
      "cpunumber": 176,
      "cpusockets": 2,
      "cpuspeed": 2200,
      "cpuwithoverprovisioning": "387200",
      "id": "f621a88f-79f8-4857-bb9b-62b78bb5be02"
    },
    {
      "cpuallocatedvalue": 28100,
      "cpunumber": 176,
      "cpusockets": 2,
      "cpuspeed": 2200,
      "cpuwithoverprovisioning": "387200",
      "id": "ae35f566-a5bf-40f7-bacc-716904692e56"
    },
    {
      "cpuallocatedvalue": 8500,
      "cpunumber": 32,
      "cpusockets": 2,
      "cpuspeed": 2600,
      "cpuwithoverprovisioning": "83200",
      "id": "87f9a908-00ed-4018-b1f6-72d7d5476606"
    },
    {
      "cpuallocatedvalue": 10000,
      "cpunumber": 32,
      "cpusockets": 2,
      "cpuspeed": 2600,
      "cpuwithoverprovisioning": "83200",
      "id": "2e338815-a2f0-4663-a391-7ebe6ddbfa99"
    },
    {
      "cpuallocatedvalue": 22500,
      "cpunumber": 56,
      "cpusockets": 2,
      "cpuspeed": 2000,
      "cpuwithoverprovisioning": "112000",
      "id": "004f29a4-49ae-4e71-81bf-eb946d52e43e"
    }
  ]
}

select uuid,version,cpus,speed from host_view where cpus is not NULL;
--------------------------------------+----------+------+-------+
| uuid                                 | version  | cpus | speed |
+--------------------------------------+----------+------+-------+
| 7a75ccbc-8184-46ed-b42d-f9cdba1b9ccc | 4.19.0.1 |   88 |  2200 |
| 6dff8ccf-ad40-4755-8208-bea9745129d4 | 4.19.0.1 |   88 |  2200 |
| d2533dd4-1ed8-4b92-8001-4704b1973903 | 4.19.0.1 |   88 |  2200 |
| b5a0d84b-6248-4054-b61a-603e76fb8b2e | 4.19.0.1 |   88 |  2200 |
| a1322c18-c806-4f05-bb44-9ec9d800d2bd | 4.19.0.1 |   88 |  2200 |
| 23016ba8-c508-4b60-b850-c992f01a5340 | 4.19.0.1 |   88 |  2200 |
| f621a88f-79f8-4857-bb9b-62b78bb5be02 | 4.19.0.1 |   88 |  2200 |
| ae35f566-a5bf-40f7-bacc-716904692e56 | 4.19.0.1 |   88 |  2200 |
| 87f9a908-00ed-4018-b1f6-72d7d5476606 | 4.19.0.1 |   32 |  2600 |
| 2e338815-a2f0-4663-a391-7ebe6ddbfa99 | 4.19.0.1 |   32 |  2600 |
| 004f29a4-49ae-4e71-81bf-eb946d52e43e | 4.19.0.1 |   56 |  2000 |
+--------------------------------------+----------+------+-------+

lscpu:
Architecture:            x86_64
  CPU op-mode(s):        32-bit, 64-bit
  Address sizes:         46 bits physical, 48 bits virtual
  Byte Order:            Little Endian
CPU(s):                  88
  On-line CPU(s) list:   0-87
Vendor ID:               GenuineIntel
  Model name:            Intel(R) Xeon(R) CPU E5-2699 v4 @ 2.20GHz
    CPU family:          6
    Model:               79
    Thread(s) per core:  2
    Core(s) per socket:  22
    Socket(s):           2
    Stepping:            1
    CPU max MHz:         3600.0000
    CPU min MHz:         1200.0000
    BogoMIPS:            4400.28