Bug 1727149

Summary: libvirt fails to use cgroups when booting with the unified hierarchy (v2)
Product: [Fedora] Fedora Reporter: Ben Breard <bbreard>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 30CC: agedosier, berrange, clalancette, itamar, jforbes, laine, libvirt-maint, pkrempa, richard.poettler, veillard, virt-maint
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2019-07-05 08:00:16 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Ben Breard 2019-07-04 17:11:12 UTC
Description of problem:


Version-Release number of selected component (if applicable):


How reproducible:


Steps to Reproduce:
1. Append systemd.unified_cgroup_hierarchy=1 to the kernel and boot
2. start a VM with the default settings in /etc/libvirt/qemu.conf

Actual results:

Error starting domain: Invalid value '+cpu' for 'cgroup.subtree_control': Invalid argument

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 75, in cb_wrapper
    callback(asyncjob, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/asyncjob.py", line 111, in tmpcb
    callback(*args, **kwargs)
  File "/usr/share/virt-manager/virtManager/libvirtobject.py", line 66, in newfn
    ret = fn(self, *args, **kwargs)
  File "/usr/share/virt-manager/virtManager/domain.py", line 1420, in startup
    self._backend.create()
  File "/usr/lib64/python3.7/site-packages/libvirt.py", line 1089, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirt.libvirtError: Invalid value '+cpu' for 'cgroup.subtree_control': Invalid argument


Expected results:
VM should work and libvirt should leverage the v2 controllers.


Additional info:
I know this is early days for supporting this in libvirt, but I wasn't able to find any docs in the repo for how to handle this. I've tried disabling all the controllers in the config file above, and that works as a work around, but I really need cpu & mem working at minimum. What am I doing wrong? thanks!

Comment 1 Peter Krempa 2019-07-04 17:28:34 UTC
The support was added very recently. libvirt-5.5.0 should support cgroups v2. You should be able to install it from the virt-preview repo: https://fedoraproject.org/wiki/Virtualization_Preview_Repository

Comment 2 Ben Breard 2019-07-04 17:56:45 UTC
Ah fantastic. Thanks! Is 5.5 likely to land in F31? That would help us here: https://fedoraproject.org/wiki/Changes/CGroupsV2

I'll close this.

Comment 3 Daniel Berrangé 2019-07-05 08:00:16 UTC
It is already in F31. We're not intending to change it in F30.