Ask Your Question
1

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: https://answers.launchpad.net/devstack/+question/189704 (https://answers.launchpad.net/devstac...) 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 http://cloud-images.ubuntu.com/precise/current/ (http://cloud-images.ubuntu.com/precis...) 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
0

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
wget https://cloud-images.ubuntu.com/precise/current/precise-server-cloudimg-amd64-root.tar.gz

# 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

Comments

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
0

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

Comments

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

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

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

Seen: 1,194 times

Last updated: Jul 03 '14