Bug 666130

Summary: Cgroups cause libvirt to be unable to start virtual machines
Product: [Fedora] Fedora Reporter: Scott J Henson <shenson>
Component: libvirtAssignee: Libvirt Maintainers <libvirt-maint>
Status: CLOSED INSUFFICIENT_DATA QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: medium Docs Contact:
Priority: low    
Version: 14CC: awilliam, berrange, clalance, crobinso, dgoodwin, ehabkost, itamar, jforbes, jmontleo, matt, mcepl, mschmidt, nphilipp, overholt, panormitis, ricardo.arguello, rodney.mckee, ryniker, sergio.pasra, veillard, virt-maint, wd
Target Milestone: ---Keywords: Reopened
Target Release: ---   
Hardware: Unspecified   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2012-01-24 16:51:45 EST Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:

Description Scott J Henson 2010-12-28 22:42:46 EST
Description of problem:

I have cgroups mounted in order to get a speed up (described in the various linux related media).  I am not sure if I modified it myself, or if F14 came like this.  I know I did it on my previous F13 install, but don't remember doing it on F14.

Now, when I try to start a virtual machine, I get an error.  If I unmount the cgroup mount and restart libvirtd, I can start the virtual machine.

cgroup on /cgroup/cpu type cgroup (rw,cpu)

Version-Release number of selected component (if applicable):
shenson@aiden ~$ rpm -q libvirt
libvirt-0.8.3-2.fc14.x86_64
shenson@aiden ~$ rpm -qa | grep cgroup
libcgroup-0.36.2-5.fc14.x86_64

How reproducible:

100% reproducible.

Steps to Reproduce:
1. Have cgroup mounted on /cgroup/cpu
2. virsh start vm
  
Actual results:
shenson@aiden ~$ sudo virsh start sb-el5
error: Failed to start domain sb-el5
error: Unable to deny all devices for sb-el5: No such file or directory

Expected results:
Virtual machine starts as expected.


Additional info:
Comment 1 Matěj Cepl 2011-01-21 05:38:22 EST
This is a duplicate of bug 660402. Not sure whether this should be closed though.
Comment 2 Cole Robinson 2011-03-23 17:55:59 EDT
*** Bug 660402 has been marked as a duplicate of this bug. ***
Comment 3 Nils Philippsen 2011-04-01 05:05:43 EDT
The same happened to me on an up to date F15(pre) machine. After restarting libvirtd, it worked again.
Comment 4 Adam Williamson 2011-04-05 00:31:19 EDT
yeah, still happening on f15 for me too.
Comment 5 Matt Willsher 2011-04-10 03:31:11 EDT
I have the same symptoms on F15 upto date as of the time of this entry. The sequence where this happens for me is:

create first new VM
run through to installation complete. At this point it was left for 6 hours.
Reboot the VM (this was a CentOS 5 installation)
I then get the following error ('router' is the VM instance name):

Error starting domain: Unable to create cgroup for router: No such file or directory

unmount as described by Mr. Henson, above, worked around the problem
Comment 6 Nils Philippsen 2011-04-11 06:18:20 EDT
Just for the record, for me it was sufficient to restart libvirtd when I had this issue.
Comment 7 Devan Goodwin 2011-04-22 14:51:40 EDT
Same error, restarting libvirtd also works around the issue for me.
Comment 8 Cole Robinson 2011-04-27 09:01:44 EDT

*** This bug has been marked as a duplicate of bug 678555 ***
Comment 9 Michal Schmidt 2011-04-27 09:11:49 EDT
This bug was reported against Fedora 14.
I don't think it is a duplicate of the systemd bug, because F14 does not use systemd (at least not by default).
But even if Scott uses systemd on his F14 system, this F14 bug would not be resolved by an update in F15.
Comment 10 Scott J Henson 2011-04-27 10:41:34 EDT
I was not using systemd. I was (and am) using a standard F14 install with upstart.
Comment 11 Richard Ryniker 2011-05-19 07:09:28 EDT
F15
It appears this can also affect the creation of virtual machines.
The work-around described above in Comment 3 was effective:

# systemctl try-restart libvirtd.service


Sample of failure to create a VM (before libvirtd.service restart):

[root@hp ryniker]# virt-install --prompt
What is the name of your virtual machine? 
MPLAB
How much RAM should be allocated (in megabytes)? 
4096
What would you like to use as the disk (file path)? 
/home/ryniker/Virt_stor/MPLAB.img 
This will overwrite the existing path '/home/ryniker/Virt_stor/MPLAB.img'
Do you really want to use this disk (yes or no) 
yes
What is the install CD-ROM/ISO or URL? 
Fedora-15-x86_64-DVD.iso

Starting install...
ERROR    Unable to create cgroup for MPLAB: No such file or directory
Domain installation does not appear to have been successful.
If it was, you can restart your domain by running:
  virsh --connect qemu:///system start MPLAB
otherwise, please restart your installation.
Comment 12 Chuck Ebbert 2011-05-20 09:57:07 EDT
(In reply to comment #10)
> I was not using systemd. I was (and am) using a standard F14 install with
> upstart.

And does "service libvirtd restart" fix it on F14?
Comment 13 Scott J Henson 2011-05-20 10:37:17 EDT
(In reply to comment #12)
> (In reply to comment #10)
> > I was not using systemd. I was (and am) using a standard F14 install with
> > upstart.
> 
> And does "service libvirtd restart" fix it on F14?

If I unmount the cgroup filesystem and restart libvirtd, things work properly. At which point I can remount the cgroup filesystem and things continue to work till libvirtd restarts.
Comment 14 Panormitis Petrou 2011-05-30 05:22:19 EDT
This bug still exists on Fedora 15
Comment 15 Rodney McKee 2011-05-31 20:26:29 EDT
Had no issues under Fedora14, just upgraded to fc15 and get 
Error starting domain: Unable to create cgroup for windowsXP: No such file or directory
Comment 16 Rodney McKee 2011-05-31 23:16:32 EDT
Just applied the current updates and fixed, sorry for the spam
Comment 17 Cole Robinson 2011-07-07 12:58:34 EDT
Anybody seeing cgroup issues on Fedora 15, YOU DO NOT WANT THIS BUG REPORT. The issue you are encountering is a still present systemd bug:

https://bugzilla.redhat.com/show_bug.cgi?id=678555

Scott, can you provide an exact set of steps to go from working config to non working config? I can't reproduce this issue. Here's what I'm doing:

service libvirtd stop
service cgconfig stop

cat /etc/cgconfig.conf:
mount {
	cpu     = /cgroup/cpu;
}

service cgconfig start
cat /proc/mounts | grep cgroup:
cgroup /cgroup/cpu cgroup rw,relatime,cpu 0 0

service libvirtd start

virsh start f12-vm:
Domain f12-vm started

Scott, does this affect all your VMs or just some? Can you provide the domain XML of one of the affected domains with 'virsh dumpxml $vmname'? Have you made any configuration changes in /etc/libvirt/qemu.conf? Can you provide the output of /proc/mounts | grep cgroup when reproducing the problem?
Comment 18 Fedora Admin XMLRPC Client 2011-09-22 13:59:14 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 19 Fedora Admin XMLRPC Client 2011-09-22 14:03:07 EDT
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 20 Fedora Admin XMLRPC Client 2011-11-30 14:59:10 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 21 Fedora Admin XMLRPC Client 2011-11-30 15:00:14 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 22 Fedora Admin XMLRPC Client 2011-11-30 15:05:20 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 23 Fedora Admin XMLRPC Client 2011-11-30 15:05:40 EST
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.
Comment 24 Cole Robinson 2012-01-24 16:51:45 EST
F14 is EOL, and data wasn't provided anyways. Closing