Re: [Lxc-users] Regarding lxc tools and libvirt (virsh).
Kumar L Srikanth-B22348 wrote: Hi, I am new to Linux Containers and Libvirt. Recently, I installed Linux Container tools on my Fedora Core 12 (64 bit) machine and able to create/start/destroy my own containers using the following commands: lxc-create lxc-sshd lxc-start lxc-destroy And I also installed libvirtd on my machine, and able to create/start/destroy my own domains using the following commands: virsh -c lxc:/// define /path/to/domain/xml/configuration/file virsh -c lxc:/// start [Domain Name] virsh -c lxc:/// shutdown [Domain Name] virsh -c lxc:/// undefine [Domain Name] I just wonder is there any relation between the domains created with 'virsh' and containers created with 'lxc-tools' [like lxc-create, lxc-start ..etc]? Can I start a container created using 'lxc-create' command with virsh [virsh -c lxc:/// start [Container Name] ...something like that]? Please let me know. No, these are 2 separate projects. But a driver could be implemented to plug the lxc tools with the libvirt. -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] Regarding lxc tools and libvirt (virsh).
Thanks for the reply Daniel. I have another issue. I am creating a Domain using libvirt XML. In order to mount the host's '/home/srikanth' directory to the new container's '/' directory, my XML format is shown below: domain type='lxc' id='1' namecontainer1_vm/name memory50/memory os typeexe/type init/bin/sh/init /os vcpu1/vcpu clock offset='utc'/ on_poweroffdestroy/on_poweroff on_rebootrestart/on_reboot on_crashdestroy/on_crash devices emulator/usr/libexec/libvirt_lxc/emulator filesystem type='mount' source dir='/home/srikanth'/ target dir='/'/ /filesystem console type='pty' / /devices /domain With the above libvirt XML, Domain is defining, but not starting. When I issue the start command it's saying Domain started, but showing shut off status. If I changed the target directory(traget dir='/'/) from '/' to '/home/container1'(traget dir='/home/container1'/), the domain is starting normally and I am able to see the contents in the target directory. Can you please let me know, how can I set the target directory to '/'? By the way, I am using libvirt version o.7.6. Regards, Srikanth. -Original Message- From: Daniel Lezcano [mailto:daniel.lezc...@free.fr] Sent: Friday, February 05, 2010 2:25 PM To: Kumar L Srikanth-B22348 Cc: lxc-users@lists.sourceforge.net Subject: Re: [Lxc-users] Regarding lxc tools and libvirt (virsh). Kumar L Srikanth-B22348 wrote: Hi, I am new to Linux Containers and Libvirt. Recently, I installed Linux Container tools on my Fedora Core 12 (64 bit) machine and able to create/start/destroy my own containers using the following commands: lxc-create lxc-sshd lxc-start lxc-destroy And I also installed libvirtd on my machine, and able to create/start/destroy my own domains using the following commands: virsh -c lxc:/// define /path/to/domain/xml/configuration/file virsh -c lxc:/// start [Domain Name] virsh -c lxc:/// shutdown [Domain Name] virsh -c lxc:/// undefine [Domain Name] I just wonder is there any relation between the domains created with 'virsh' and containers created with 'lxc-tools' [like lxc-create, lxc-start ..etc]? Can I start a container created using 'lxc-create' command with virsh [virsh -c lxc:/// start [Container Name] ...something like that]? Please let me know. No, these are 2 separate projects. But a driver could be implemented to plug the lxc tools with the libvirt. -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] Regarding lxc tools and libvirt (virsh).
Kumar L Srikanth-B22348 wrote: Thanks for the reply Daniel. I have another issue. I am creating a Domain using libvirt XML. In order to mount the host's '/home/srikanth' directory to the new container's '/' directory, my XML format is shown below: domain type='lxc' id='1' namecontainer1_vm/name memory50/memory os typeexe/type init/bin/sh/init /os vcpu1/vcpu clock offset='utc'/ on_poweroffdestroy/on_poweroff on_rebootrestart/on_reboot on_crashdestroy/on_crash devices emulator/usr/libexec/libvirt_lxc/emulator filesystem type='mount' source dir='/home/srikanth'/ target dir='/'/ /filesystem console type='pty' / /devices /domain With the above libvirt XML, Domain is defining, but not starting. When I issue the start command it's saying Domain started, but showing shut off status. If I changed the target directory(traget dir='/'/) from '/' to '/home/container1'(traget dir='/home/container1'/), the domain is starting normally and I am able to see the contents in the target directory. Can you please let me know, how can I set the target directory to '/'? By the way, I am using libvirt version o.7.6. I won't be able to answer as I don't know libvirt, it's better you ask to the libvirt mailing list. This mailing list is for the lxc container tools. -Original Message- From: Daniel Lezcano [mailto:daniel.lezc...@free.fr] Sent: Friday, February 05, 2010 2:25 PM To: Kumar L Srikanth-B22348 Cc: lxc-users@lists.sourceforge.net Subject: Re: [Lxc-users] Regarding lxc tools and libvirt (virsh). Kumar L Srikanth-B22348 wrote: Hi, I am new to Linux Containers and Libvirt. Recently, I installed Linux Container tools on my Fedora Core 12 (64 bit) machine and able to create/start/destroy my own containers using the following commands: lxc-create lxc-sshd lxc-start lxc-destroy And I also installed libvirtd on my machine, and able to create/start/destroy my own domains using the following commands: virsh -c lxc:/// define /path/to/domain/xml/configuration/file virsh -c lxc:/// start [Domain Name] virsh -c lxc:/// shutdown [Domain Name] virsh -c lxc:/// undefine [Domain Name] I just wonder is there any relation between the domains created with 'virsh' and containers created with 'lxc-tools' [like lxc-create, lxc-start ..etc]? Can I start a container created using 'lxc-create' command with virsh [virsh -c lxc:/// start [Container Name] ...something like that]? Please let me know. No, these are 2 separate projects. But a driver could be implemented to plug the lxc tools with the libvirt. -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] Unable to SSH to the containers.
Hi Daniel, Please see my inline comments. Regards, Srikanth -Original Message- From: Daniel Lezcano [mailto:daniel.lezc...@free.fr] Sent: Friday, February 05, 2010 5:40 PM To: Kumar L Srikanth-B22348 Cc: lxc-users@lists.sourceforge.net Subject: Re: [Lxc-users] Unable to SSH to the containers. Kumar L Srikanth-B22348 wrote: My lxc version is 0.6.3. Ok. I suppose you tried with lxc-ssh script to create the container, right ? Srikanth Yes, with lxc-sshd script. You should try: lxc-execute -n cont1 /bin/bash /usr/sbin/sshd Srikanth You mean to execute the following command: lxc-execute -n cont1 /bin/bash /usr/sbin/sshd ? The same for the other container: lxc-execute -n cont2 /bin/bash /usr/sbin/sshd if you want, you can log to lxc-devel Freenode irc's channel, that maybe easier to check the config. Srikanth lxc-devel can not be found in my linyx contianer tools. Regards, Srikanth. -Original Message- From: Daniel Lezcano [mailto:daniel.lezc...@free.fr] Sent: Friday, February 05, 2010 5:27 PM To: Kumar L Srikanth-B22348 Cc: lxc-users@lists.sourceforge.net Subject: Re: [Lxc-users] Unable to SSH to the containers. Kumar L Srikanth-B22348 wrote: Hi, I have created two containers cont1 and cont2, using 'lxc-sshd' command. While creating containers, I gave cont1 ip address as '172.16.1.16' and cont2 ipaddress as '172.16.1.17'. Prior to creating containers, I followed the following link to create a bridge 'br0' with the ipaddress '172.16.1.10' which is bridged to 'eth0'. http://www.ibm.com/developerworks/linux/library/l-lxc-containers/ Maybe not up-to-date at this moment. It's not a problem, just a misconfiguration. I will give you the right configuration. What version of lxc are running ? -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users
Re: [Lxc-users] Unable to SSH to the containers.
Kumar L Srikanth-B22348 wrote: Hi Daniel, Please see my inline comments. Regards, Srikanth -Original Message- From: Daniel Lezcano [mailto:daniel.lezc...@free.fr] Sent: Friday, February 05, 2010 5:40 PM To: Kumar L Srikanth-B22348 Cc: lxc-users@lists.sourceforge.net Subject: Re: [Lxc-users] Unable to SSH to the containers. Kumar L Srikanth-B22348 wrote: My lxc version is 0.6.3. Ok. I suppose you tried with lxc-ssh script to create the container, right ? Srikanth Yes, with lxc-sshd script. You should try: lxc-execute -n cont1 /bin/bash /usr/sbin/sshd Srikanth You mean to execute the following command: lxc-execute -n cont1 /bin/bash /usr/sbin/sshd ? No, I meant get a shell in a container and from this shell launch sshd. The same for the other container: lxc-execute -n cont2 /bin/bash /usr/sbin/sshd if you want, you can log to lxc-devel Freenode irc's channel, that maybe easier to check the config. Srikanth lxc-devel can not be found in my linyx contianer tools. I meant chatting via irc. -- The Planet: dedicated and managed hosting, cloud storage, colocation Stay online with enterprise data centers and the best network in the business Choose flexible plans and management services without long-term contracts Personal 24x7 support from experience hosting pros just a phone call away. http://p.sf.net/sfu/theplanet-com ___ Lxc-users mailing list Lxc-users@lists.sourceforge.net https://lists.sourceforge.net/lists/listinfo/lxc-users