scaling governors are optional for some OS platforms

Bug #2023018 reported by Sylvain Bauza
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Low
Sylvain Bauza

Bug Description

Some OS platforms don't use cpufreq, so operators should be able to just offline their CPUs.

For the moment, even if the config option CPU management strategy is 'cpu_state', we return an exception if so.

Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service Traceback (most recent call last):
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/opt/stack/nova/nova/filesystem.py", line 37, in read_sys
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service with open(os.path.join(SYS, path), mode='r') as data:
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service FileNotFoundError: [Errno 2] No such file or directory: '/sys/devices/system/cpu/cpu1/cpufreq/scaling_governor'
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service The above exception was the direct cause of the following exception:
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service Traceback (most recent call last):
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/usr/local/lib/python3.10/dist-packages/oslo_service/service.py", line 806, in run_service
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service service.start()
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/opt/stack/nova/nova/service.py", line 162, in start
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service self.manager.init_host(self.service_ref)
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/opt/stack/nova/nova/compute/manager.py", line 1608, in init_host
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service self.driver.init_host(host=self.host)
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 825, in init_host
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service libvirt_cpu.validate_all_dedicated_cpus()
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/opt/stack/nova/nova/virt/libvirt/cpu/api.py", line 143, in validate_all_dedicated_cpus
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service governors.add(pcpu.governor)
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/opt/stack/nova/nova/virt/libvirt/cpu/api.py", line 63, in governor
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service return core.get_governor(self.ident)
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/opt/stack/nova/nova/virt/libvirt/cpu/core.py", line 69, in get_governor
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service return filesystem.read_sys(
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service File "/opt/stack/nova/nova/filesystem.py", line 40, in read_sys
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service raise exception.FileNotFound(file_path=path) from exc
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service nova.exception.FileNotFound: File /sys/devices/system/cpu/cpu1/cpufreq/scaling_governor could not be found.
Jun 05 14:47:45 sbauza-dev2 nova-compute[75181]: ERROR oslo_service.service

Let's just to support the CPU state if so.

Tags: libvirt cpu
summary: - scaling governors are optional for some OS plateforms
+ scaling governors are optional for some OS platforms
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (master)

Fix proposed to branch: master
Review: https://review.opendev.org/c/openstack/nova/+/885352

Changed in nova:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.opendev.org/c/openstack/nova/+/885352
Committed: https://opendev.org/openstack/nova/commit/2c4421568ea62e66257b55c08092de3e0303fb0a
Submitter: "Zuul (22348)"
Branch: master

commit 2c4421568ea62e66257b55c08092de3e0303fb0a
Author: Sylvain Bauza <email address hidden>
Date: Tue Jun 6 11:56:32 2023 +0200

    cpu: make governors to be optional

    Change-Id: Ifb7d001cfdb95b1b0aa29f45c0ef71c0673e1760
    Closes-Bug: #2023018

Changed in nova:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/2023.2)

Fix proposed to branch: stable/2023.2
Review: https://review.opendev.org/c/openstack/nova/+/905673

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/2023.1)

Fix proposed to branch: stable/2023.1
Review: https://review.opendev.org/c/openstack/nova/+/905676

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/2023.2)

Reviewed: https://review.opendev.org/c/openstack/nova/+/905673
Committed: https://opendev.org/openstack/nova/commit/891d1773a26082e3f24ec6583f843b39a50bf76d
Submitter: "Zuul (22348)"
Branch: stable/2023.2

commit 891d1773a26082e3f24ec6583f843b39a50bf76d
Author: Sylvain Bauza <email address hidden>
Date: Tue Jun 6 11:56:32 2023 +0200

    cpu: make governors to be optional

    Change-Id: Ifb7d001cfdb95b1b0aa29f45c0ef71c0673e1760
    Closes-Bug: #2023018
    (cherry picked from commit 2c4421568ea62e66257b55c08092de3e0303fb0a)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/2023.1)

Reviewed: https://review.opendev.org/c/openstack/nova/+/905676
Committed: https://opendev.org/openstack/nova/commit/5c33bd4dfc8c1fcf3eecd656130408fb0a5a3bc5
Submitter: "Zuul (22348)"
Branch: stable/2023.1

commit 5c33bd4dfc8c1fcf3eecd656130408fb0a5a3bc5
Author: Sylvain Bauza <email address hidden>
Date: Tue Jun 6 11:56:32 2023 +0200

    cpu: make governors to be optional

    Change-Id: Ifb7d001cfdb95b1b0aa29f45c0ef71c0673e1760
    Closes-Bug: #2023018
    (cherry picked from commit 2c4421568ea62e66257b55c08092de3e0303fb0a)
    (cherry picked from commit 891d1773a26082e3f24ec6583f843b39a50bf76d)

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/nova 29.0.0.0rc1

This issue was fixed in the openstack/nova 29.0.0.0rc1 release candidate.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.