Difference between revisions of "LXC"
Line 3: | Line 3: | ||
− | <pre><nowiki> | + | <pre><nowiki> |
sudo mkdir /cgroup | sudo mkdir /cgroup | ||
sudo mount none -t cgroup /cgroup | sudo mount none -t cgroup /cgroup | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
And add to your /etc/fstab | And add to your /etc/fstab | ||
− | <pre><nowiki> | + | <pre><nowiki> |
none /cgroup cgroup defaults 0 0 | none /cgroup cgroup defaults 0 0 | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
− | + | '''Note: '''You will need to download a newer version of libvirt 0.8.8. | |
+ | |||
* Download the ttylinux from [http://people.canonical.com/~chucks/openstack/lxc-natty-amd64.img.tar.gz here.] | * Download the ttylinux from [http://people.canonical.com/~chucks/openstack/lxc-natty-amd64.img.tar.gz here.] | ||
* In order to use LXC in nova you have to add "--libvirt-type=lxc" to your config. | * In order to use LXC in nova you have to add "--libvirt-type=lxc" to your config. | ||
Line 24: | Line 23: | ||
− | <pre><nowiki> | + | <pre><nowiki> |
− | euca-bundle-image -i lxc-natty-amd64.img | + | euca-bundle-image -i lxc-natty-amd64.img |
euca-upload-bundle -b mybucket -m /tmp/ttylinux-lxc-natty-2.6.38-5.img.manifest.xml | euca-upload-bundle -b mybucket -m /tmp/ttylinux-lxc-natty-2.6.38-5.img.manifest.xml | ||
euca-register mybucket/lxc-natty-amd64.img.manifest.xml | euca-register mybucket/lxc-natty-amd64.img.manifest.xml | ||
</nowiki></pre> | </nowiki></pre> | ||
− | |||
If you want to use a normal UEC image with LXC, before bundling it you have to install the lxcguest package: | If you want to use a normal UEC image with LXC, before bundling it you have to install the lxcguest package: | ||
− | <pre><nowiki> | + | <pre><nowiki> |
sudo mount -o loop <image name> <mount point> | sudo mount -o loop <image name> <mount point> | ||
sudo mount -o bind /proc <mount point>/proc | sudo mount -o bind /proc <mount point>/proc | ||
Line 44: | Line 42: | ||
sudo umount <mount point> | sudo umount <mount point> | ||
</nowiki></pre> | </nowiki></pre> | ||
− |
Revision as of 14:21, 1 March 2011
If you want to play with LXC on nova, here is how you do it. Before setting up LXC with nova you have to enable cgroups:
sudo mkdir /cgroup sudo mount none -t cgroup /cgroup
And add to your /etc/fstab
none /cgroup cgroup defaults 0 0
Note: You will need to download a newer version of libvirt 0.8.8.
- Download the ttylinux from here.
- In order to use LXC in nova you have to add "--libvirt-type=lxc" to your config.
Bundle your image as you normally would:
euca-bundle-image -i lxc-natty-amd64.img euca-upload-bundle -b mybucket -m /tmp/ttylinux-lxc-natty-2.6.38-5.img.manifest.xml euca-register mybucket/lxc-natty-amd64.img.manifest.xml
If you want to use a normal UEC image with LXC, before bundling it you have to install the lxcguest package:
sudo mount -o loop <image name> <mount point> sudo mount -o bind /proc <mount point>/proc sudo cp /etc/resolv.conf <mount point>/etc sudo chroot <mount point> apt-get install lxcguest <exit the chroot> sudo umount <mount point>/proc sudo umount <mount point>