HostOnNet Blog

virsh error: Unable to create cgroup for x: No such file or directory

Looking for Linux Server Admin or WordPress Expert? We can help.

I have 2 test KVM virtual machine on a server

[[email protected] ~]# virsh list --all
 Id    Name                           State
----------------------------------------------------
 -     vm1                            shut off
 -     vm2                            shut off

[[email protected] ~]#

Recently i tried start one of the Virtual Machine, i got following error.

[[email protected] ~]# virsh start vm1
error: Failed to start domain vm1
error: Unable to create cgroup for vm1: No such file or directory

[[email protected] ~]#

After some searching, i found this is due to bug in “systemd”, that deletes cgroup directory that are not associated with any running process. Until the bug get fixed, it can be fixed by restarting libvirtd.

[[email protected] ~]# service libvirtd restart
Stopping libvirtd daemon:                                  [  OK  ]
Starting libvirtd daemon:                                  [  OK  ]
[[email protected] ~]# 

After libvirtd restarted, i am able to start Virtual Machine.

[[email protected] ~]# virsh start vm1
Domain vm1 started

[[email protected] ~]# 

Update

The problem was cause by OpneVZ Kernel. Installing CentOS default kernel fixed it. One problem i noticed was

[[email protected] ~]# service cgconfig start
Starting cgconfig service: Error: cannot mount cpuset to /cgroup/cpuset: Device or resource busy
/sbin/cgconfigparser; error loading /etc/cgconfig.conf: Cgroup mounting failed
Failed to parse /etc/cgconfig.conf or /etc/cgconfig.d      [FAILED]
[[email protected] ~]#

This also got fixed by installing CentOS Kernel.

[[email protected] ~]# service cgconfig status
Running
[[email protected] ~]# 

Posted in Virtualization

One Response to virsh error: Unable to create cgroup for x: No such file or directory

Leave a Reply

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.