Use PCPU and VCPU resource in single VM

Registered by huaqiang on 2019-07-05

Create VM with dedicated CPU and shared CPU in one instance

Blueprint information

Status:
Complete
Approver:
Stephen Finucane
Priority:
Low
Drafter:
huaqiang
Direction:
Approved
Assignee:
huaqiang
Definition:
Approved
Series goal:
Accepted for victoria
Implementation:
Implemented
Milestone target:
milestone icon victoria-2
Started by
Eric Fried on 2020-02-17
Completed by
Balazs Gibizer on 2020-07-23

Related branches

Sprints

Whiteboard

Spec: https://review.opendev.org/#/c/668656/

[efried 20190725] Today is spec freeze, and this spec is close, but some edits are still needed. Assuming those are completed satisfactorily, there seems to be agreement (pending formal SFE) to accept this proposal with the following caveats:
- There is a hard dependency on blueprint cpu-resources.
- cpu-resources must be code complete and merged/approved (or extremely close) by R-7 (Aug 29).
- The full code for this feature must be at least available for review by that same time (R-7, Aug 29).
- As usual, the code for this feature should be approved by feature freeze (R-5, Sep 12)
If these milestones arrive and conditions are not met, this blueprint will be deferred to U.

Deferring this out of Train since it wasn't approved and we're about 2 weeks from feature freeze. -- mriedem 20190829

Gerrit topic: https://review.opendev.org/#/q/topic:bp/mixed-cpu-instance

Addressed by: https://review.opendev.org/688932
    [WIP] To create single NUMA node instance in function '_get_numa_topology_auto'

Addressed by: https://review.opendev.org/688933
    [WIP] Assign and track instance pinning cpu through 'cpu_pinning' field

Addressed by: https://review.opendev.org/688934
    [WIP] Add a new instance CPU allocation policy: mixed

Addressed by: https://review.opendev.org/688935
    [WIP] virt/libvirt: Get host pin cpuset according instance cpu_pinning

Gerrit topic: https://review.opendev.org/#/q/topic:bp/mixed-cpu-instance-set4

Addressed by: https://review.opendev.org/688936
    metadata: export the vCPU IDs that are pinning on the host CPUs

Addressed by: https://review.opendev.org/696008
    support unbalanced dedicatd CPU distribution on instance NUMA nodes

Addressed by: https://review.opendev.org/696009
    Create 'mixed' instance from PCPU and VCPU resources

Gerrit topic: https://review.opendev.org/#/q/topic:bp/use-pcpu-and-vcpu-in-one-instance

Addressed by: https://review.opendev.org/696007
    [WIP] More tests for validating CPU policy by 'resources:PCPU' and 'resources:VCPU'

Addressed by: https://review.opendev.org/705437
    Create 'mixed' instance from PCPU and VCPU resources

Addressed by: https://review.opendev.org/668656
    Use PCPU and VCPU in one instance

[efried 20200213] Spec approved

[efried 20200220] Agreed in the Nova meeting to Direction:Approve all Definition:Approved blueprints http://eavesdrop.openstack.org/meetings/nova/2020/nova.2020-02-20-14.00.log.html#l-131

Addressed by: https://review.opendev.org/537414
    objects: Add online migration for legacy NUMA objects

Addressed by: https://review.opendev.org/713351
    Refine and introduce correct parameters for test_get_guest_config_numa_host_instance_topo_cpu_pinning

Addressed by: https://review.opendev.org/713352
    scheduler: Introduce 'dedicated' and 'sharing' CPUs for InstanceNUMACell

Addressed by: https://review.opendev.org/713353
    Derive 'cpu_pinning_requested' property from cpu_policy

Addressed by: https://review.opendev.org/713354
    Introduce 'MIXED' CPU allocation policy for instance

Addressed by: https://review.opendev.org/713355
    Introduce the interface of creating 'MIXED' policy instance through 'PCPU' and 'VCPU'

Addressed by: https://review.opendev.org/714655
    libvirt: support to create instance with dedicated and shared CPUs

Addressed by: https://review.opendev.org/714656
    Remove 'InstanceNUMACell.cpu_pinning_requested' field

Addressed by: https://review.opendev.org/714657
    Refactor the code in checking available host CPUs

Addressed by: https://review.opendev.org/714658
    [WIP] An alternative way for keeping instance dedicated CPUs

Addressed by: https://review.opendev.org/468203
    hardware: Add validation for 'cpu_realtime_mask'

Addressed by: https://review.opendev.org/461456
    hardware: Tweak the 'cpu_realtime_mask' handling slightly

Addressed by: https://review.opendev.org/714694
    hardware: Update and correct typing information

Addressed by: https://review.opendev.org/714695
    libvirt: Add typing information

Addressed by: https://review.opendev.org/714696
    tests: Split instance NUMA object tests

Addressed by: https://review.opendev.org/714697
    objects: Replace 'cpu_pinning_requested' helper

Addressed by: https://review.opendev.org/714698
    hardware: Don't consider overhead CPUs for unpinned instances

Addressed by: https://review.opendev.org/714699
    hardware: Remove handling of pre-Train compute nodes

Addressed by: https://review.opendev.org/714700
    hardware: Rework 'get_realtime_constraint'

Addressed by: https://review.opendev.org/714701
    hardware: Invert order of NUMA topology generation

Addressed by: https://review.opendev.org/714702
    hardware: 'numa_fit_instance_to_host' requires 'limits' argument

Addressed by: https://review.opendev.org/714703
    hardware: Remove '_numa_fit_instance_cell_with_pinning'

Addressed by: https://review.opendev.org/714704
    WIP! objects: Add 'CPUAllocationPolicy.MIXED' enum

Addressed by: https://review.opendev.org/714705
    WIP! objects: Add 'InstanceNUMACell.pcpuset' field

Addressed by: https://review.opendev.org/714706
    WIP! hardware: Add support for 'hw:cpu_dedicated_mask' extra spec

Addressed by: https://review.opendev.org/714707
    WIP! hardware: Start configuring 'InstanceNUMACell.pcpuset'

Addressed by: https://review.opendev.org/676208
    tox: Integrate mypy

Addressed by: https://review.opendev.org/716267
    Introduce the 'CPUAllocationPolicy.MIXED' enum

Addressed by: https://review.opendev.org/716268
    computer: validate cpu pinning configuration for mixed instance

Addressed by: https://review.opendev.org/716269
    Calculate the pinned and unpinned CPU usage for mixed instance

Addressed by: https://review.opendev.org/716270
    scheduler: translate the mixed instance resource demanding to placement request

Addressed by: https://review.opendev.org/716271
    Enable the support of mixed instance

Addressed by: https://review.opendev.org/716984
    Introduce 'pcpuset' field for InstanceNUMACell

Addressed by: https://review.opendev.org/718294
    libvirt/hardware: refactor numa_get_constraints

Addressed by: https://review.opendev.org/718493
    online data migration for cpuset of dedicated instance

[20200414] we hit feature freeze in Ussuri, so it is deferred to Victoria

Addressed by: https://review.opendev.org/724381
    WIP: objects: Add migrate-on-load behavior for legacy NUMA objects

Addressed by: https://review.opendev.org/725801
    Use PCPU and VCPU in one instance

Addressed by: https://review.opendev.org/728480
    notification: add the pcpuset info to instance numa cell payload

Addressed by: https://review.opendev.org/728481
    libvirt: apply mixed instance CPU policy

Addressed by: https://review.opendev.org/728482
    scheduler: mixed instance CPU resource translating

Addressed by: https://review.opendev.org/728483
    flavor: Enable 'hw:cpu_dedicated_mask' for creating a mixed instance

Addressed by: https://review.opendev.org/728484
    compute: bump nova-compute service version for mixed instance

Addressed by: https://review.opendev.org/728485
    hardware: create 'mixed' instance for realtime and shared CPUs

[2020.05.18 gibi]: spec approved for Victoria release.

Addressed by: https://review.opendev.org/736997
    release note: add new features introduces by use-pcpu-and-vcpu-in-one-instance

Addressed by: https://review.opendev.org/737026
    hardware: Allow 'hw:cpu_realtime_mask' to be omitted

Addressed by: https://review.opendev.org/728793
    test_hardware: code formating for multiline construct

Addressed by: https://review.opendev.org/740670
    doc: Correct typo

Addressed by: https://review.opendev.org/740925
    hardware: refactor the code for CPU policy sanity check

Addressed by: https://review.opendev.org/740933
    [DNM] bump nova-compute version for mixed instance in API

Addressed by: https://review.opendev.org/741395
    test: add some notes and new tests for mixed instance

Addressed by: https://review.opendev.org/741920
    libvirt: Remove two-level loop

[2020-07-23 gibi]: the last must-have patch has been merged in Victoria so I'm marking this as implemented. Requesting PCPU + VCPU via 'resources:' extra specs, has been deferred since it's (a) low priority and (b) interferes with the NUMA in placement work

(?)

Work Items

Dependency tree

* Blueprints in grey have been implemented.

This blueprint contains Public information 
Everyone can see this information.

Subscribers

No subscribers.