Bug 1097028

Summary: Don't fail starting domain without cpu, cpuset and cpuacct cgroups controllers
Product: Red Hat Enterprise Linux 7 Reporter: Shanzhi Yu <shyu>
Component: libvirtAssignee: Martin Kletzander <mkletzan>
Status: CLOSED ERRATA QA Contact: Virtualization Bugs <virt-bugs>
Severity: low Docs Contact:
Priority: low    
Version: 7.0CC: dyuan, jmiao, mkletzan, mzhan, rbalakri
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: libvirt-1.2.7-1.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-03-05 07:35:18 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 Shanzhi Yu 2014-05-13 03:07:25 UTC
Description of problem:

improve the error info when cgroup controller cpu, cpuset and cpuacct 
are unmounted

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

libvirt-1.1.1-29.el7.x86_64
kernel-3.10.0-110.el7.x86_64
libcgroup-0.41-6.el7.x86_64

How reproducible:

100%

Steps to Reproduce:

1. prepare an guest
#virsh list --all
# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     rhel6-qcow2                    shut off
2. umount cgroup controller

# for i in hugetlb perf_event blkio net_cls freezer devices memory 
cpu,cpuacct cpuset ;do umount /sys/fs/cgroup/$i;done

# mount|grep cgroup
tmpfs on /sys/fs/cgroup type tmpfs 
(rw,nosuid,nodev,noexec,seclabel,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup 
(rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)

3. start guest
# virsh start rhel6-qcow2
error: Failed to start domain rhel6-qcow2
error: At least one cgroup controller is required: No such device or address

4. mount some controller then try to start guest

# mount -t cgroup -o memory memory /sys/fs/cgroup/memory/

# mount|grep cgroup
tmpfs on /sys/fs/cgroup type tmpfs 
(rw,nosuid,nodev,noexec,seclabel,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup 
(rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
memory on /sys/fs/cgroup/memory type cgroup (rw,relatime,memory)

# virsh start rhel6-qcow2
error: Failed to start domain rhel6-qcow2
error: At least one cgroup controller is required: No such device or address

5. mount cpu or cpuacct or cpuset, then restart guest

#mount -t cgroup -o cpu cpu /sys/fs/cgroup/cpu/

# mount|grep cgroup
tmpfs on /sys/fs/cgroup type tmpfs 
(rw,nosuid,nodev,noexec,seclabel,mode=755)
cgroup on /sys/fs/cgroup/systemd type cgroup 
(rw,nosuid,nodev,noexec,relatime,xattr,release_agent=/usr/lib/systemd/systemd-cgroups-agent,name=systemd)
cpu on /sys/fs/cgroup/cpu,cpuacct type cgroup (rw,relatime,cpu)

# virsh start rhel6-qcow2
Domain rhel6-qcow2 started


Actual results:


Expected results:

At least cpu or cpuacct or cpuset or cgroup controller is required to 
boot up guest


Additional info:

Comment 1 Martin Kletzander 2014-07-09 13:11:42 UTC
Fixed upstream with v1.2.6-115-g0c04906:

commit 0c04906fa8872e4f7cdb19f59cbcb26b9bd02b0e
Author: Martin Kletzander <mkletzan>
Date:   Wed Jul 9 09:55:29 2014 +0200

    qemu: don't error out when cgroups don't exist

Comment 2 Shanzhi Yu 2014-07-10 07:25:00 UTC
Martin,

According your patch, guest will boot up even without cgroup controller cpu or cpuset, so verify steps should be 1)umount cgroup controller cpu, cpuset,2) boot up guest without any error. And bug description should be also change to something like "Guest should be boot up even without cgroup controller cpu or cpuset".  Is that right?

Comment 3 Martin Kletzander 2014-07-10 07:30:37 UTC
Yes, you should be able to boot normally unless there are some settings which require some missing cgroups.

Comment 5 Shanzhi Yu 2014-11-20 07:20:37 UTC
Verify this bug with libvirt-1.2.8-7.el7.x86_64

Steps:
1. umount all sub cgroup

# lscgroup 
cgroups can't be listed: Cgroup is not mounted

2. try to start guest
# virsh start rh7 
Domain rh7 started

3. check guest status

# virsh domstate  rh7 
running

Guest can boot up without cpu, cpuset and cpuacct cgroups so change to verified status

Comment 7 errata-xmlrpc 2015-03-05 07:35:18 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHSA-2015-0323.html