cgred should be started before libvirt-bin

Bug #644669 reported by Philippe Clérié
26
This bug affects 6 people
Affects Status Importance Assigned to Milestone
libcgroup (Fedora)
Invalid
Medium
libcgroup (Ubuntu)
Fix Released
Medium
Jon Bernard

Bug Description

This bug was reported against libvirt-bin as #577264. There was a request to file a bug against libcgroup and 577264 was closed. The bug was not filed against libcgroup so I am filing it.

The bug description in 577264 is correct. Right now for example any VM started automatically at boot time works perfectly but anything started after that will trigger the reported error. The work around proposed also works.

I am running Lucid and my systems are up to date as of today (21-Sep-2010).

Regards
Philippe

Tags: upstart
Revision history for this message
In , Adam (adam-redhat-bugs) wrote :

Sometimes, on Rawhide, when I try to run a VM - that is, actually when I hit the Run button - it fails to run. An error dialog pops up, which says:

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

There's a Details drop-down. When dropped down, it says:

Traceback (most recent call last):
  File "/usr/share/virt-manager/virtManager/engine.py", line 878, in run_domain
    vm.startup()
  File "/usr/share/virt-manager/virtManager/domain.py", line 1321, in startup
    self._backend.create()
  File "/usr/lib64/python2.7/site-packages/libvirt.py", line 333, in create
    if ret == -1: raise libvirtError ('virDomainCreate() failed', dom=self)
libvirtError: Unable to create cgroup for Fedora13: No such file or directory

This doesn't *always* happen. I think it happens when the system's been running for a while before I try to run a VM, or possibly after a suspend/resume cycle.

When this happens, I can solve it by restarting libvirtd. I don't have to quit/resume virt-manager; I can restart libvirtd with virt-manager running, re-connect to localhost in virt-manager, and then successfully start the VM.

Revision history for this message
In , Matěj (matj-redhat-bugs) wrote :

Me too (restart of libvirtd service helps) and this has a duplicate in bug 666130.

Changed in libcgroup (Ubuntu):
status: New → Triaged
importance: Undecided → Medium
Changed in libcgroup (Ubuntu):
assignee: nobody → Serge Hallyn (serge-hallyn)
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

As suggested on the upstart-dev list by Clint, I'll add the following upstart job to cgred:

# libvirt-cgred-wait
start on starting libvirt-bin
stop on started cgred or stopped cgred

task
normal exit 2
script
  status cgred | grep -q "start/running" && exit 0
  start cgred || true
  sleep 3600
end script
# EOF

tags: added: upstart
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Could you try the packages attached in comment #2 and see if they do what you need?

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

As natty feature freeze is tomorrow, it would be great to get the libvirt packages in. Has anyone had a chance to test?

Revision history for this message
Philippe Clérié (pclerie) wrote : Re: [Bug 644669] Re: cgred should be started before libvirt-bin

On Wednesday, 23 February 2011 12:11:08 you wrote:
> As natty feature freeze is tomorrow, it would be great to get the
> libvirt packages in. Has anyone had a chance to test?

I planned to check it out but I had hoped for a patch to the lucid package.
The fix comes with a new upstream version, so I would prefer to set up another
server to do that. That's a little more complicated and I haven't gotten
around to it just yet. Sorry!

--

Philippe

------
The trouble with common sense is that it is so uncommon.
<Anonymous>

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Philippe,

could you try the debs from comment #6?

Revision history for this message
Philippe Clérié (pclerie) wrote :

On Thursday, 24 February 2011 11:09:03 you wrote:
> @Philippe,
>
> could you try the debs from comment #6?

Looks ok.

I made sure to purge libvirt-bin, libcgroup1 and cgroup-bin before installing
your packages. My VM now start correctly with no tweaking.

--

Philippe

------
The trouble with common sense is that it is so uncommon.
<Anonymous>

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Quoting Philippe Clérié (<email address hidden>):
> On Thursday, 24 February 2011 11:09:03 you wrote:
> > @Philippe,
> >
> > could you try the debs from comment #6?
>
> Looks ok.
>
> I made sure to purge libvirt-bin, libcgroup1 and cgroup-bin before installing
> your packages. My VM now start correctly with no tweaking.

Thanks, Philippe - would you mind pasting the output of

 cat /proc/self/mounts

here?

Revision history for this message
Philippe Clérié (pclerie) wrote :

On Thursday, 24 February 2011 12:39:22 you wrote:
> Quoting Philippe Clérié (<email address hidden>):
> > On Thursday, 24 February 2011 11:09:03 you wrote:
> > > @Philippe,
> > >
> > > could you try the debs from comment #6?
> >
> > Looks ok.
> >
> > I made sure to purge libvirt-bin, libcgroup1 and cgroup-bin before
> > installing your packages. My VM now start correctly with no tweaking.
>
> Thanks, Philippe - would you mind pasting the output of
>
> cat /proc/self/mounts
>
> here?

Perhaps you are right to be suspicious. CGroup is not mounted.

/var/log/syslog has the following lines:

libvirt-cgred-wait main process (1096) killed by TERM signal
cgred main process (1120) terminated with status 81

and:

service libvirt-bin status

produces:

libvirt-bin start/running, process 1137

Did I miss something?

--

Philippe

------
The trouble with common sense is that it is so uncommon.
<Anonymous>

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

> Perhaps you are right to be suspicious. CGroup is not mounted.

Ah, that's only bc I'm an idiot. /sys/fs/cgroup (which is created
by the kernel) doesn't exist in lucid.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :
Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@philippe,

thanks for testing the previous version. The debs attached in comment #12 worked for me in a lucid VM. Can you confirm whether they work for you?

(The associated lp:~serge-hallyn/ubuntu/lucid/libcgroup/upstart tree is updated with the trivial fix)

Revision history for this message
Philippe Clérié (pclerie) wrote :

Sorry for the delay.

cgroups is now mounted. But you still need to add a /mnt/cgroups/devices to
cgconfig.conf to load a vm.

And while I'm at it, /mnt is really not a good place to put cgroups.
Mounting anything to /mnt is sure to cause a crash.

--

Philippe

------
The trouble with common sense is that it is so uncommon.
<Anonymous>

On Thursday 24 February 2011 22:33:21 you wrote:
> @philippe,
>
> thanks for testing the previous version. The debs attached in comment
> #12 worked for me in a lucid VM. Can you confirm whether they work for
> you?
>
> (The associated lp:~serge-hallyn/ubuntu/lucid/libcgroup/upstart tree is
> updated with the trivial fix)

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

Quoting Philippe Clérié (<email address hidden>):
> Sorry for the delay.
>
> cgroups is now mounted. But you still need to add a /mnt/cgroups/devices to
> cgconfig.conf to load a vm.

Thanks very much for the info, Philippe.

> And while I'm at it, /mnt is really not a good place to put cgroups.
> Mounting anything to /mnt is sure to cause a crash.

That's why /sys/fs/cgroup was decided upon as the "right" place. It's
just not an option in lucid.

At this point, as the upstart-related work appears to be done, I will
ask jbernard as the maintainer to take over. It'll be far better for
him to decide what to do about mount points, given the needs of older
releases.

Thanks again for testing.

Revision history for this message
Serge Hallyn (serge-hallyn) wrote :

@Jon,

if you prefer I'll re-take this bug and do merge proposals for each release. But since I'm not sure what you'll want to do about the mountpoints, assigning the bug to you seemed prudent.

thanks,
-serge

Changed in libcgroup (Ubuntu):
assignee: Serge Hallyn (serge-hallyn) → Jon Bernard (jbernard)
Revision history for this message
In , Cole (cole-redhat-bugs) wrote :

Duping to the libvirt bug

*** This bug has been marked as a duplicate of bug 666130 ***

Revision history for this message
Jon Bernard (jbernard) wrote :

I've just pushed a branch that's been sync'd with Debian's version 0.37.1-1. This sync pulls in two security fixes that should be included in Natty if possible. I've rebased Serge Hallyn's patches on top of this branch, so they are included as well.

Branch is at lp:~jbernard/ubuntu/lucid/libcgroup/upstart

Revision history for this message
Jon Bernard (jbernard) wrote :
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libcgroup - 0.37.1-1ubuntu1

---------------
libcgroup (0.37.1-1ubuntu1) natty; urgency=low

  * Mount a tmpfs at /sys/fs/cgroup so cgred can create subdirs. Otherwise
    the whole thing fails.
  * Convert to upstart (LP: #644669)
  * add a job to make libvirt (if it is installed and starts) wait until
    cgred is running.
 -- Serge Hallyn <email address hidden> Thu, 17 Feb 2011 18:03:17 -0600

Changed in libcgroup (Ubuntu):
status: Triaged → Fix Released
Changed in libcgroup (Fedora):
importance: Unknown → Medium
status: Unknown → Invalid
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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