Ask Your Question

ubuntu image for libvirt_type=lxc

asked 2013-01-15 12:53:26 -0500

alan-mcduff gravatar image

Hello, I am looking for an image of ubuntu 12.04 that can be used with lxc virtualization in a devstack system.

Here: ( is a vague explanation, how to convert an existing (cirros) image for lxc ("Make a copy of cirros-0.3.0-x86_64-blank.img (name it cirros-lxc.img or whatever), mount, and copy everything from foobar over"). But I would need precise steps with clear links to the original file, that may be possibly converted for lxc.

Can any of the images at ( be converted for lxc? I have made several attempts extracting the "/" filesystem from these images and converting them to raw image format with qemu-img, but none of them boots in the openstack dashboard (going to "Error" state everytime). I have also created a lxc root filesystem (using "lxc-create -t ubuntu"). Can I use this for lxc under devstack?

Thanks Alan

edit retag flag offensive close merge delete

2 answers

Sort by ยป oldest newest most voted

answered 2014-07-03 12:02:03 -0500

darragh-oreilly gravatar image

updated 2014-07-03 12:03:34 -0500

Here are the steps I used:

# download a tar file of a root file system

# create a backing file and a loopback device to it
truncate --size 2GB precise.img
sudo losetup -f precise.img

# find what /dev/loopX was used - it was /dev/loop1 this time
losetup -a

# write out a filesystem and mount it
sudo mkfs /dev/loop1
mkdir mnt
sudo mount /dev/loop1 mnt

# extract the root fs tar into the image file
cd mnt
tar -xvf ../precise-server-cloudimg-amd64-root.tar.gz

cd ../
sudo umount /dev/loop1 

glance image-create --name precise-rootfs --is-public True \
    --disk-format raw --container-format bare \
    --progress --file precise.img
edit flag offensive delete link more


How to access the lxc container once its booted using above precise.img ?

raviinroorkee.7 gravatar imageraviinroorkee.7 ( 2015-07-16 02:53:50 -0500 )edit

answered 2013-01-22 11:18:44 -0500

Alan, the LXC virtualization type has been discontinued by Openstack. Important tasks such as migrating or stopping/restarting an instance is not possible at the moment., because saving all processes state to disk won't be possible until the LXC developers integrate the necessary functions into the Linux kernel.

The "LXC Containers - Coming soon!" notice on the devstack homepage has now been removed. You can still use the nova LXC components from previous Openstack releases, but there is no support offering LXC based cloud images. Good luck!

edit flag offensive delete link more


Where did you see that LXC has been discontinued by OpenStack? It still seems to work ok and is on the supported hypervisor matrix.

darragh-oreilly gravatar imagedarragh-oreilly ( 2014-07-03 12:05:49 -0500 )edit

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower


Asked: 2013-01-15 12:53:26 -0500

Seen: 1,275 times

Last updated: Jul 03 '14