Bug 1867986 - [OSP16.1] Nova placement has wrong cpus information
Summary: [OSP16.1] Nova placement has wrong cpus information
Keywords:
Status: CLOSED DUPLICATE of bug 1862396
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: openstack-placement
Version: 16.1 (Train)
Hardware: Unspecified
OS: Unspecified
unspecified
high
Target Milestone: ---
: ---
Assignee: Stephen Finucane
QA Contact: OSP DFG:Compute
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-08-11 10:33 UTC by Khomesh Thakre
Modified: 2023-03-21 19:34 UTC (History)
1 user (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2020-08-12 16:29:53 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Khomesh Thakre 2020-08-11 10:33:21 UTC
Description of problem:
Nova placement has wrong information cpus 

In OSP 16.1, I have created 2 VM with cpu_policy set to dedicated.

~~~
(overcloud) [stack@undercloud-0 ~]$ openstack flavor show mid 
+----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| Field                      | Value                                                                                                                                   |
+----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
| OS-FLV-DISABLED:disabled   | False                                                                                                                                   |
| OS-FLV-EXT-DATA:ephemeral  | 0                                                                                                                                       |
| access_project_ids         | None                                                                                                                                    |
| description                | None                                                                                                                                    |
| disk                       | 20                                                                                                                                      |
| extra_specs                | {'hw:cpu_policy': 'dedicated', 'hw:mem_page_size': 'large', 'hw:emulator_threads_policy': 'isolate', 'hw:cpu_thread_policy': 'isolate'} |
| id                         | e1b5c7dc-a441-4cb0-858d-0e64eeec6ee6                                                                                                    |
| name                       | mid                                                                                                                                     |
| os-flavor-access:is_public | True                                                                                                                                    |
| properties                 | hw:cpu_policy='dedicated', hw:cpu_thread_policy='isolate', hw:emulator_threads_policy='isolate', hw:mem_page_size='large'               |
| ram                        | 2048                                                                                                                                    |
| rxtx_factor                | 1.0                                                                                                                                     |
| swap                       | 0                                                                                                                                       |
| vcpus                      | 2                                                                                                                                       |
+----------------------------+-----------------------------------------------------------------------------------------------------------------------------------------+
~~~

Both the VM are running on same 

~~~
(overcloud) [stack@undercloud-0 ~]$ openstack server show 2-cpu-1 -c id -c name -c flavor -c OS-EXT-SRV-ATTR:host --fit-width
+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field                | Value                                                                                                                                                                                    |
+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| OS-EXT-SRV-ATTR:host | nfv-compute-sriov-0.localdomain                                                                                                                                                          |
| flavor               | disk='20', ephemeral='0', extra_specs.hw:cpu_policy='dedicated', extra_specs.hw:cpu_thread_policy='isolate', extra_specs.hw:emulator_threads_policy='isolate',                           |
|                      | extra_specs.hw:mem_page_size='large', original_name='mid', ram='2048', swap='0', vcpus='2'                                                                                               |
| id                   | 059ec06f-c4f4-4ada-966b-409aa261eaa5                                                                                                                                                     |
| name                 | 2-cpu-1                                                                                                                                                                                  |
+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
(overcloud) [stack@undercloud-0 ~]$ openstack server show 2-cpu -c id -c name -c flavor -c OS-EXT-SRV-ATTR:host --fit-width
+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| Field                | Value                                                                                                                                                                                    |
+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| OS-EXT-SRV-ATTR:host | nfv-compute-sriov-0.localdomain                                                                                                                                                          |
| flavor               | disk='20', ephemeral='0', extra_specs.hw:cpu_policy='dedicated', extra_specs.hw:cpu_thread_policy='isolate', extra_specs.hw:emulator_threads_policy='isolate',                           |
|                      | extra_specs.hw:mem_page_size='large', original_name='mid', ram='2048', swap='0', vcpus='2'                                                                                               |
| id                   | bef7467d-500e-40b6-b60f-df7bcc32bdce                                                                                                                                                     |
| name                 | 2-cpu                                                                                                                                                                                    |
+----------------------+------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
(overcloud) [stack@undercloud-0 ~]$
~~~

Both the VM are using cpu policy dedicated, b ut in nova placement usage i see VCPUS been use instead of PCPUS

~~~
(overcloud) [stack@undercloud-0 ~]$ openstack resource provider list 
+--------------------------------------+---------------------------------+------------+
| uuid                                 | name                            | generation |
+--------------------------------------+---------------------------------+------------+
| 77ed94b4-4e76-4552-a4fa-cbaa59984284 | nfv-compute-sriov-0.localdomain |         17 |
| 96da5079-91e0-4857-a1d1-608b912e0df3 | nfv-compute-sriov-1.localdomain |         12 |
+--------------------------------------+---------------------------------+------------+

(overcloud) [stack@undercloud-0 ~]$ openstack resource provider inventory list --os-placement-api-version 1.2 77ed94b4-4e76-4552-a4fa-cbaa59984284
+----------------+------------------+----------+----------+----------+-----------+-------+
| resource_class | allocation_ratio | min_unit | max_unit | reserved | step_size | total |
+----------------+------------------+----------+----------+----------+-----------+-------+
| VCPU           |             16.0 |        1 |        2 |        0 |         1 |     2 |
| MEMORY_MB      |              1.0 |        1 |    63776 |     4096 |         1 | 63776 |
| DISK_GB        |              1.0 |        1 |      558 |        0 |         1 |   558 |
| PCPU           |              1.0 |        1 |       29 |        0 |         1 |    29 |
+----------------+------------------+----------+----------+----------+-----------+-------+

(overcloud) [stack@undercloud-0 ~]$ openstack resource provider usage show 77ed94b4-4e76-4552-a4fa-cbaa59984284
+----------------+-------+
| resource_class | usage |
+----------------+-------+
| VCPU           |     4 |    <<<<<
| MEMORY_MB      |  4096 |
| DISK_GB        |    40 |
| PCPU           |     0 |
+----------------+-------+
~~~

Version-Release number of selected component (if applicable):
Red Hat OpenStack Platform release 16.1.0 GA (Train)


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:
I expected PCPU to be used instead of vcpu.


Additional info:

Comment 1 Stephen Finucane 2020-08-12 16:29:53 UTC
Thanks for the report. This is a known issue and is targeted for 16.1.2. I'm closing this as a duplicate.

*** This bug has been marked as a duplicate of bug 1862396 ***


Note You need to log in before you can comment on or make changes to this bug.