Uploaded image for project: 'Red Hat OpenStack Services on OpenShift'
  1. Red Hat OpenStack Services on OpenShift
  2. OSPRH-10772

nova-compute restart unpins pinned VMs if [libvirt]power_management=true.

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Undefined Undefined
    • None
    • rhos-18.0 Feature Release 1 (Nov 2024)
    • openstack-nova
    • None
    • False
    • Hide

      None

      Show
      None
    • False
    • ?
    • ?
    • ?
    • ?
    • None
    • Hide
      .Compute service power management feature disabled by default

      The Compute service (nova) power management feature is disabled by default. You can enable it with the following `nova-compute` configuration:

      ----
      [libvirt]
      cpu_power_management = true
      cpu_power_management_strategy = governor
      ----

      The default `cpu_power_management_strategy` `cpu_state` is currently unsupported. Restarting nova-compute causes all dedicated PCPUs on that host to be powered down, including ones used by instances. if the `cpu_state` strategy is used, those instances' CPUs will become unpinned.
      Show
      .Compute service power management feature disabled by default The Compute service (nova) power management feature is disabled by default. You can enable it with the following `nova-compute` configuration: ---- [libvirt] cpu_power_management = true cpu_power_management_strategy = governor ---- The default `cpu_power_management_strategy` `cpu_state` is currently unsupported. Restarting nova-compute causes all dedicated PCPUs on that host to be powered down, including ones used by instances. if the `cpu_state` strategy is used, those instances' CPUs will become unpinned.
    • Known Issue
    • Moderate

      Reproduction:

      • have a deployment with pinned CPUs configured and power mgmt enabled
        [root@edpm-compute-0 ~]# podman exec -it nova_compute cat /etc/nova/nova.conf.d/25-cpu-pinning-nova.conf | egrep -e '_set|power' -B1
        [compute]
        cpu_shared_set = 0,1,2,3
        cpu_dedicated_set = 4-19
        --
          [libvirt]
        cpu_power_management=true
        
      • check that nova-compute disabled the unused pcpus at startup
        On-line CPU(s) list:                0-3,20-255
        Off-line CPU(s) list:               4-19
        
      • boot a VM with nova that using pinned CPUs
        [zuul@controller-0 ~]$ openstack flavor show m1.dedicated
        +----------------------------+--------------------------------------+
        | Field                      | Value                                |
        +----------------------------+--------------------------------------+
        | OS-FLV-DISABLED:disabled   | False                                |
        | OS-FLV-EXT-DATA:ephemeral  | 0                                    |
        | access_project_ids         | None                                 |
        | description                | None                                 |
        | disk                       | 1                                    |
        | id                         | 4e5abbfc-2cfc-4f13-a0b0-442aeb51ea7b |
        | name                       | m1.dedicated                         |
        | os-flavor-access:is_public | True                                 |
        | properties                 | hw:cpu_policy='dedicated'            |
        | ram                        | 512                                  |
        | rxtx_factor                | 1.0                                  |
        | swap                       |                                      |
        | vcpus                      | 2                                    |
        +----------------------------+--------------------------------------+
        
        [zuul@controller-0 ~]$ openstack --os-compute-api-version 2.80 server create --image cirros --flavor m1.dedicated --nic none vm1-gibi
        
      • observe that nova onlined the two pcpus allocated to the VM
        [root@edpm-compute-0 ~]# virsh dumpxml 5 | grep vcpupin
            <vcpupin vcpu='0' cpuset='7'/>
            <vcpupin vcpu='1' cpuset='11'/>
        
        [root@edpm-compute-0 ~]# lscpu | grep 'line CPU'
        On-line CPU(s) list:                0-3,7,11,20-255
        Off-line CPU(s) list:               4-6,8-10,12-19
        
        [root@edpm-compute-0 ~]# taskset -cp `pgrep qemu-kvm`
        pid 130794's current affinity list: 7,11
        
      • restart the nova-compute service
        [root@edpm-compute-0 ~]# systemctl restart edpm_nova_compute
        
        
      • observe that the VM is still running, the allocated PCPU cores are offlined and the VM is unpinned
        [root@edpm-compute-0 ~]# virsh list 
         Id   Name                State
        -----------------------------------
         5    instance-00000007   running
        
        [root@edpm-compute-0 ~]# virsh dumpxml 5 | grep vcpupin
            <vcpupin vcpu='0' cpuset='7'/>
            <vcpupin vcpu='1' cpuset='11'/>
        
        [root@edpm-compute-0 ~]# lscpu | grep 'line CPU'
        On-line CPU(s) list:                0-3,20-255
        Off-line CPU(s) list:               4-19
        
        [root@edpm-compute-0 ~]# taskset -cp `pgrep qemu-kvm`
        pid 130794's current affinity list: 0-3,20-255
        

      Expected behavior:

      • nova-compute restart does not offline any PCPU that are used by running VMs.

      Relevant nova-compute log during the service restart:

      Oct 17 14:47:26 edpm-compute-0 nova_compute[130962]: 2024-10-17 14:47:26.544 2 DEBUG nova.virt.libvirt.cpu.api [None req-b2f86412-9ebd-44ae-9d0d-925cd6bcb7fd - - - - - -] Cores powered up : {'4', '15', '5', '6', '19', '10', '14', '17', '18', '11', '9', '16', '7', '8', '12', '13'} power_up /usr/lib/python3.9/site-packages/nova/virt/libvirt/cpu/api.py:107
      Oct 17 14:47:28 edpm-compute-0 nova_compute[130962]: 2024-10-17 14:47:28.938 2 DEBUG nova.virt.libvirt.cpu.api [None req-b2f86412-9ebd-44ae-9d0d-925cd6bcb7fd - - - - - -] Cores powered down : {4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19} power_down_all_dedicated_cpus /usr/lib/python3.9/site-packages/nova/virt/libvirt/cpu/api.py:169
      

      The whole restart log is attached as https://issues.redhat.com/secure/attachment/13283260/nova-compute-restart.log

              alifshit@redhat.com Artom Lifshitz
              rh-ee-bgibizer Balazs Gibizer
              rhos-dfg-compute
              Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

                Created:
                Updated: