[Libcg-devel] [libvirt]: Not able to login to container when cgroup is enabled

Rishikesh risrajak at linux.vnet.ibm.com
Tue Oct 13 06:09:23 UTC 2009


Rishikesh wrote:
> Rishikesh wrote:
>   
>> Hi daniel,
>>
>> Sorry for late response, was busy with some other high priority task.
>>
>> Daniel P. Berrange wrote:
>>   
>>     
>>> On Wed, Oct 07, 2009 at 08:12:02PM +0530, Dhaval Giani wrote:
>>>   
>>> The most likely suspect is that the cgroups controllers were mounted or
>>> unmounted after libvirtd started. A restart of libvirtd ought to resolve
>>> the problem if this is indeed the case
>>>   
>>>     
>>>       
>>   
>>     
>
> Ok, Here i tried one more scenario, i think this is what you meant:
>
> 1> Stop libvirtd
> 2> Run cgroup " /etc/init.d/cgconfig start"
> 3> Start libvirtd
> 4> And then try to create a container.
>
> Though above steps are also failing. But now i am getting some different 
> failure.  I am not seeing the earlier warning messages. You can see 
> below on shell 1.
>
> My previous post was following this steps:
> 1> Run cgroup once again
> 2> service libvirtd restart
> 3> Create a container
>
>
> Here are the different error which i am getting:
> Shell:1
>
> [root at mhs21a ~]# libvirtd
> libvir: Linux Container error : failed to connect to client socket: No 
> such file or directory
> 11:17:36.743: error : lxcVmStart:1007 : Failed to read pid file 
> /var/run/libvirt/lxc/vm1.pid: No such file or directory
> libvir: Linux Container error : Failed to read pid file 
> /var/run/libvirt/lxc/vm1.pid: No such file or directory
>
>
> Shell 2:
>
> [root at mhs21a ~]# vim /etc/cgconfig.conf
> [root at mhs21a ~]# /etc/init.d/cgconfig start
> Starting cgconfig service:                                 [  OK  ]
> [root at mhs21a ~]# virsh -c lxc:///
> Welcome to virsh, the virtualization interactive terminal.
>
> Type:  'help' for help with commands
>        'quit' to quit
>
> virsh # list --all
>  Id Name                 State
> ----------------------------------
>   - vm1                  shut off
>
> virsh # start vm1
> error: Failed to start domain vm1
> error: Failed to read pid file /var/run/libvirt/lxc/vm1.pid: No such 
> file or directory
>
> virsh # list --all
>  Id Name                 State
> ----------------------------------
>   - vm1                  shut off
>
> virsh #
>
>
> So now we need to deal with two issue:
>     - One we need to decide , ( is it neccessary to stop libvirt before 
> creating cgroup ?)
>     - How container can be started using cgroup ?
>
> -Rishi
>
>
>   

Cgroup config file & controllers mount shows like this :
[root at mhs21a ~]# cat /proc/mounts | grep cgroup
cgroup /cgroups/cpu cgroup rw,relatime,cpu 0 0
cgroup /cgroups/cpuacct cgroup rw,relatime,cpuacct 0 0
cgroup /cgroups/memory cgroup rw,relatime,memory 0 0
[root at mhs21a ~]# cat /etc/cgconfig.
cat: /etc/cgconfig.: No such file or directory
[root at mhs21a ~]# cat /etc/cgconfig.conf
#
#  Copyright IBM Corporation. 2007
#
group test1/fruits/mango {
    perm {
        task {
            uid = test;
            gid = test;
        }
        admin {
            uid = root;
            gid = root;
        }
    }
        cpu {
            cpu.shares = 1024;
        }
    }
mount {
    cpu = /cgroups/cpu;
    cpuacct = /cgroups/cpuacct;
    memory  = /cgroups/memory;
}
[root at mhs21a ~]#


>> Actually not , restarting libvirt daemon did not help me.
>>
>> I had controllers mounted as per /proc/mount . And i am really seeing an 
>> issue after starting cgconfig services on my system.
>>
>> Shell :1
>> virsh # start vm1
>> Domain vm1 started
>>
>> virsh # list --all
>>  Id Name                 State
>> ----------------------------------
>>   - vm1                  shut off
>>
>> virsh #
>>
>> Shell 2:
>> [root at mls41 ~]# service libvirtd restart
>> Stopping libvirtd daemon:                                  [  OK  ]
>> Starting libvirtd daemon:                                  [  OK  ]
>> [root at mls41 ~]# cat /proc/mounts | grep cgroup
>> cgroup /cgroup cgroup rw,relatime,cpuacct,cpu 0 0
>> [root at mls41 ~]#
>>
>> Let me know if you need some more info.
>>
>> -Rishi
>>   
>>     
>>> Daniel;
>>>   
>>>     
>>>       
>> ------------------------------------------------------------------------------
>> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
>> is the only developer event you need to attend this year. Jumpstart your
>> developing skills, take BlackBerry mobile applications to market and stay 
>> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
>> http://p.sf.net/sfu/devconference
>> _______________________________________________
>> Libcg-devel mailing list
>> Libcg-devel at lists.sourceforge.net
>> https://lists.sourceforge.net/lists/listinfo/libcg-devel
>>   
>>     
>
>
> ------------------------------------------------------------------------------
> Come build with us! The BlackBerry(R) Developer Conference in SF, CA
> is the only developer event you need to attend this year. Jumpstart your
> developing skills, take BlackBerry mobile applications to market and stay 
> ahead of the curve. Join us from November 9 - 12, 2009. Register now!
> http://p.sf.net/sfu/devconference
> _______________________________________________
> Libcg-devel mailing list
> Libcg-devel at lists.sourceforge.net
> https://lists.sourceforge.net/lists/listinfo/libcg-devel
>   




More information about the libvir-list mailing list