Experimental LXC provider
clint at ubuntu.com
Sun Jun 26 09:52:45 UTC 2011
I have been hacking on an LXC provider this week, and I believe its basically
consumable for those who are willing to deal with weirdness.
Here's how to play with it.
I have tested only on Natty..
* Install lxc and libvirt-bin to the point where virbr0 and dnsmasq are
setup properly. Basically if virt-manager works to boot vms, you're good
* Add this line to /etc/fstab to enable lxc to work properly:
cgroup /sys/fs/cgroup cgroup defaults 0 0
Note that if you have 'cgroup-bin' installed, everything will be
broken. Remove it and reboot.
* Make sure 'zookeeper' is installed, as well as ensemble's dependencies
* Make sure your terminal has sudo'd so it can run w/o password, or give
yourself NOPASSWD for lxc-*, mount, cp, rmdir, and rm
* bzr branch lp:~clint-fewbar/ensemble/lxc-container and chdir into the
* Copy debian/lxc-natty-uec into /usr/lib/lxc/templates
* REMOVE packaged ensemble (apt-get remove ensemble) .. interferes with
* Setup paths to use branch
* Put this in ~/.ensemble/environments.yaml:
* Note the storage-directory bit will have to be changed to your home dir.
* Note the mirror line assumes you have setup approx (which I do, since
I use it to speed up local chroot installs)
* Run the functional tests with
This should tell you if LXC works or not
* This should deploy a working wordpress on local containers:
ensemble deploy --repository=examples wordpress wp-blog
ensemble deploy --repository=examples mysql wpdb
ensemble add-relation wpdb:db wp-blog:db
* ensemble status should show the hostnames. To use them , you will need
to add '192.168.122.1' to /etc/resolv.conf. To hit the blog, its probably
'ensemble-1', so try
Some important notes:
* This is REALLY early stuff, but I am hoping others try it and can
* The code assumes you haven't messed with libvirt's networking which
sets up 192.168.122.0/24 as the network.
* I may have missed some setup steps. Please let me know if I did.
* Make container init faster (takes 2 minutes per container on my laptop's
slow hard drive because it has to install all of ensemble's dependencies)
* Make LXC/libvirt settings more configurable in environments.yaml
More information about the Ensemble