This page explains how to create a root filesystem to be used with Eucalyptus using xen and an iso image of the guest OS you want to install.
Prerequisite: You must have hardware virtualization support (hvm must be functioning on your system) and xen must be installed and properly functioning (i.e., you must be able to start domU).
These are the steps:
dd if=/dev/zero of=new.img bs=1M count=4096
name = "bootFromISO"
kernel = "/usr/lib/xen/boot/hvmloader"
memory = 1024
builder = "hvm"
device_model = "/usr/lib64/xen/bin/qemu-dm"
boot = "d"
disk = ['file:PATH_TO_ISO,hdc:cdrom,r',
'file:PATH_TO/new.img,sda,w']
vif = ['mac=00:01:01:00:00:03, bridge=xenbr0']
dhcp="on"
vnc = 1
vncdisplay = 7
pae = 1xen create xen.cfg
xvncviewer localhost:7
NOTE: Most distributions will remember the network interfaces by the MAC address so that interfaces will always be the same (that is eth0 and eth1 will not be inverted accidentally). In Eucalyptus you have to get the distribution to forget the NIC, so that every instance will see the interface as the first interface. To do so you may want to see to the specific distribution: for example debian/ubuntu uses udev so check /etc/udev/rules.d/*net* while centos may have something in /etc/network-scripts/ifcfg-eth0. Failure to do so may leave your instance without network.
parted new.img(parted) U
Unit? [compact]? bdd if=new.img of=rootfs.img bs=1 skip=32256 count=10000000
Now you have the file 'rootfs.img' which contains the root file system.
make sure that is compatible with the kernel/initrd you are using in your
cloud environment (in particular you may want to be sure you have the
modules of the kernel you are going to use).