[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]

[Libvir] [RFC] Add Container support to libvirt


I'd like to extend libvirt to support Containers. As libvirt already supports Xen, KVM, QEMU and OpenVZ, I think it would be valuable to be able to utilize existing utilities to manage containers.

I've spent some time looking through the libvirt api and how this Container support will fit. Based on the XML format section of the libvirt website and some list discussions I put together the following proposed XML format:

<domain type='linuxcontainer'>
           <mount>/etc = /home/user/lxc_files/etc</mount>
           <mount>/var = /home/user/lxc_files/var</mount>
       <network hostname='browndog'>
           <ip address="" netmask=""/>
               <gateway address=""/>
       <console tty='/dev/pts/4' />

The clone() function is used with the CLONE_NEWPID and CLONE_NEWNS flags to start a new process within it's own process name space. The only processes visible to it will be itself and any processes that it spawns. The process that clone creates will start out preparing the container environment. This involves setting up any network interface, setting up the file system by performing any requested mounts, mounting /proc, setting up a tty device, populating /dev as necessary, and performing any other necessary initializations. It will then start the application(s) requested by the user. The executables started within the container could be an application or script or possibly /sbin/init. The mounts that the user specifies will need to be populated with the appropriate contents for whatever applications they are going to run within the container. cgroup will be used for isolation and association with controllers for cpu and memory resources.

I'm planning to start in on defining a container. All comments and questions are welcome.

Best Regards,
Dave Leskovec
IBM Linux Technology Center
Open Virtualization

[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]