Bug 982168

Summary: libvirt failed to create controller cpu for group when changed the guest's defualt <partition> element
Product: Red Hat Enterprise Linux 7 Reporter: Luwen Su <lsu>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED NOTABUG QA Contact: Virtualization Bugs <virt-bugs>
Severity: medium Docs Contact:
Priority: medium    
Version: 7.0CC: acathrow, dyuan, pkrempa, shyu, zhpeng
Target Milestone: rc   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-07-12 11:29:24 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 Luwen Su 2013-07-08 10:07:17 UTC
Description of problem:
when changes the default <partition> from machine to others , like test , the guest will fail to start because
the error "Failed to create controller cpu for group "


Version-Release number of selected component (if applicable):
libvirt-1.1.0-1.el7.x86_64
qemu-kvm-1.5.1-2.el7.x86_64
libcgroup-0.38-3.el7.x86_64
kernel-3.10.0-0.rc7.64.el7.x86_64

How reproducible:
100%

Steps to Reproduce:
1. Prepare a shutoff guest , add this to the guest
<resource>
    <partition>/machinc</partition>
</resource>

2.start the guest
#virsh start test
error: Failed to start domain test
error: Unable to initialize /machinc cgroup: No such file or directory

3.If create the dir in /sys/fs/cgroup/cpu/ by myself , those related files can be created except the guest's contents
# ll machina/
total 0
-rw-r--r--. 1 root root 0 Jul  8 11:23 cgroup.clone_children
--w--w--w-. 1 root root 0 Jul  8 11:23 cgroup.event_control
-rw-r--r--. 1 root root 0 Jul  8 11:23 cgroup.procs
-r--r--r--. 1 root root 0 Jul  8 11:23 cpuacct.stat
-rw-r--r--. 1 root root 0 Jul  8 11:23 cpuacct.usage
-r--r--r--. 1 root root 0 Jul  8 11:23 cpuacct.usage_percpu
-rw-r--r--. 1 root root 0 Jul  8 11:23 cpu.cfs_period_us
-rw-r--r--. 1 root root 0 Jul  8 11:23 cpu.cfs_quota_us
-rw-r--r--. 1 root root 0 Jul  8 11:23 cpu.rt_period_us
-rw-r--r--. 1 root root 0 Jul  8 11:23 cpu.rt_runtime_us
-rw-r--r--. 1 root root 0 Jul  8 11:23 cpu.shares
-r--r--r--. 1 root root 0 Jul  8 11:23 cpu.stat
-rw-r--r--. 1 root root 0 Jul  8 11:23 notify_on_release
-rw-r--r--. 1 root root 0 Jul  8 11:23 tasks

4.In /var/log/message , libvirt debug level log

libvirtd[10139]: path=/machinc create=0 controllers=ffffffff
libvirtd[10139]: parent=(nil) path=/machinc.partition controllers=-1
libvirtd[10139]: group=0x7fe8d4000e80 controllers=-1 path=/machinc.partition parent=(nil)
libvirtd[10139]: Auto-detecting controllers
libvirtd[10139]: Controller 'cpu' present=yes
libvirtd[10139]: Controller 'cpuacct' present=yes
libvirtd[10139]: Controller 'cpuset' present=yes
libvirtd[10139]: Controller 'memory' present=yes
libvirtd[10139]: Controller 'devices' present=yes
libvirtd[10139]: Controller 'freezer' present=yes
libvirtd[10139]: Controller 'blkio' present=yes
libvirtd[10139]: Controller 'net_cls' present=yes
libvirtd[10139]: Controller 'perf_event' present=yes
libvirtd[10139]: Detected mount/mapping 0:cpu at /sys/fs/cgroup/cpu,cpuacct in /machinc.partition
libvirtd[10139]: Detected mount/mapping 1:cpuacct at /sys/fs/cgroup/cpu,cpuacct in /machinc.partition
libvirtd[10139]: Detected mount/mapping 2:cpuset at /sys/fs/cgroup/cpuset in /machinc.partition
libvirtd[10139]: Detected mount/mapping 3:memory at /sys/fs/cgroup/memory in /machinc.partition
libvirtd[10139]: Detected mount/mapping 4evices at /sys/fs/cgroup/devices in /machinc.partition
libvirtd[10139]: Detected mount/mapping 5:freezer at /sys/fs/cgroup/freezer in /machinc.partition
libvirtd[10139]: Detected mount/mapping 6:blkio at /sys/fs/cgroup/blkio in /machinc.partition
libvirtd[10139]: Detected mount/mapping 7:net_cls at /sys/fs/cgroup/net_cls in /machinc.partition
libvirtd[10139]: Detected mount/mapping 8erf_event at /sys/fs/cgroup/perf_event in /machinc.partition
libvirtd[10139]: parent=(nil) path=/ controllers=-1
libvirtd[10139]: group=0x7fe8d4007570 controllers=-1 path=/ parent=(nil)
libvirtd[10139]: Auto-detecting controllers
libvirtd[10139]: Controller 'cpu' present=yes
libvirtd[10139]: Controller 'cpuacct' present=yes
libvirtd[10139]: Controller 'cpuset' present=yes
libvirtd[10139]: Controller 'memory' present=yes
libvirtd[10139]: Controller 'devices' present=yes
libvirtd[10139]: Controller 'freezer' present=yes
libvirtd[10139]: Controller 'blkio' present=yes
libvirtd[10139]: Controller 'net_cls' present=yes
libvirtd[10139]: Controller 'perf_event' present=yes
libvirtd[10139]: Detected mount/mapping 0:cpu at /sys/fs/cgroup/cpu,cpuacct in /
libvirtd[10139]: Detected mount/mapping 1:cpuacct at /sys/fs/cgroup/cpu,cpuacct in /
libvirtd[10139]: Detected mount/mapping 2:cpuset at /sys/fs/cgroup/cpuset in /
libvirtd[10139]: Detected mount/mapping 3:memory at /sys/fs/cgroup/memory in /
libvirtd[10139]: Detected mount/mapping 4evices at /sys/fs/cgroup/devices in /
libvirtd[10139]: Detected mount/mapping 5:freezer at /sys/fs/cgroup/freezer in /
libvirtd[10139]: Detected mount/mapping 6:blkio at /sys/fs/cgroup/blkio in /
libvirtd[10139]: Detected mount/mapping 7:net_cls at /sys/fs/cgroup/net_cls in /
libvirtd[10139]: Detected mount/mapping 8erf_event at /sys/fs/cgroup/perf_event in /
libvirtd[10139]: Make group /machinc.partition
libvirtd[10139]: Make controller /sys/fs/cgroup/cpu,cpuacct/machinc.partition/
libvirtd[10139]: Failed to create controller cpu for group
libvirtd[10139]: Done making controllers for group
libvirtd[10139]: Removing cgroup /machinc.partition

Actual results:
Fail to start guest with customized <partition>

Expected results:
The guest can start


Additional info:

Comment 2 Peter Krempa 2013-07-12 11:29:24 UTC
From the documentation for the <partition> element:

"Hypervisors may allow for virtual machines to be placed into resource partitions, potentially with nesting of said partitions. The resource element groups together configuration related to resource partitioning. It currently supports a child element partition whose content defines the path of the resource partition in which to place the domain. If no partition is listed, then the domain will be placed in a default partition. 

It is the responsibility of the app/admin to ensure that the partition exists prior to starting the guest. Only the (hypervisor specific) default partition can be assumed to exist by default."

The described behavior is expected. Closing as NOTABUG.