Creating Xen Templates from Stacklet.com images

From The FluidVM Wiki

Jump to: navigation, search

http://stacklet.com (earlier http://jailtime.org) provides some good quality Xen images. Linux distros like CentOS, Ubuntu, Fedora and Gentoo are available from there. However, these images are available as Xen file system images. These are of the EXT3 file system format. FluidVM uses LVM to store VM data and thus needs the images to be available as a tar archive. The conversion process is a very simple one. Please run all these commands as root or use 'sudo'. Here are the steps:

I start by creating a working directory and changing into it:

# mkdir images
# cd images

Then download a template of your choice and untar it.

# wget -c http://stacklet.com/sites/default/files/centos/centos.5-3.x86.20090423.img.tar.bz2
# tar xjf centos.5-3.x86.20090423.img.tar.bz2 

Create a temporary directory and loop-mount the image to that directory

# mkdir root_fs 
# mount centos.5-3.x86.img root_fs -o loop

Change into the mount point and create a tar file in the gzip format. Follow the naming convention of distro-version-architecture.tar.gz so that you know what each template is later on.

# cd root_fs
# tar czf ../centos.5-3.i386.tar.gz *
# cd ..
# umount root_fs

Copy the new tar file into the /xen-templates directory on the management server. It will be made available from there to all compute nodes.

Personal tools