5.3. Creating File System Images

Tycoon provides the flexibility for users to use their own file system images when creating virtual machines. This allows users to reduce the amount of configuration they have to do after creating host accounts. This section covers two topics: how to modify an existing Tycoon file system image and the requirements for a Tycoon file system image. For information on how to use the image once it is created, see the reference for the tycoon host create_account command.

5.3.1. Modifying a File System Image

  1. Download and decompress the image that you want to modify. The base image is at http://tycoon.hpl.hp.com/~tycoon/dl/images/centos.5-0.ext3.bz2.

    $ wget http://tycoon.hpl.hp.com/~tycoon/dl/images/centos.5-0.ext3.bz2
    $ bunzip2 centos.5-0.ext3.bz2
    
  2. Mount the image file using the loop back device:

    $ mkdir /mnt/tycoon_fs_image
    $ mount -o loop centos.5-0.ext3 /mnt/tycoon_fs_image
    
  3. Configure the image. If you are going to use yum to install packages, you at least need to copy in a resolv.conf file, and may also need to set a network proxy:

    $ cp /etc/resolv.conf /mnt/tycoon_fs_image/etc
    

  4. Change root. You must do this if you are going to use yum or rpm.

    $ chroot /mnt/tycoon_fs_image
    
  5. Mount proc file system. You must do this for yum and rpm.

    $ mount /proc
    
  6. Modify the image as you like.

    $ yum install ...
    
  7. Reverse the mounting process:

    $ umount /proc
    $ exit
    $ rm -f /mnt/tycoon_fs_image/etc/resolv.conf
    $ umount /mnt/tycoon_fs_image
    $ rm -fr /mnt/tycoon_fs_image
    
  8. Recompress and upload the image to a web server:

    $ bzip2 centos.5-0.ext3
    $ scp centos.5-0.ext3.bz2 ...
    
  9. Modify the auctioneer configuration to allow the new file system url. See the AllowedFileSystemImageRegexs setting in /etc/tycoon/tycoon_aucd.conf.

5.3.2. Requirements for Images

Tycoon auctioneers have several requirements to configure file system images correctly. In general, images based on RedHat Enterprise Linux or Fedora should work, while others probably will have limited or no functionality. The requirements are as follows, in order of importance:

Image file format.

The file must be an ext3 file system image. It can be compressed with bzip2, zip, or gzip. This is the absolute minimum for functionality.

OpenSSH

OpenSSH must be installed, the server must be configured to be started, and its configuration must be in /etc/ssh/sshd_config. If this does not work, users will not be able to log in.

/home

User accounts must be in /home This is necessary to create the user's home directory.

Network Interface Configuration

The network interface configuration must be in /etc/sysconfig/network-scripts/ifcfg-eth0, /etc/sysconfig/network-scripts/ifcfg-eth1, /etc/sysconfig/network, and /etc/hosts.

TTY configuration

Consoles must be configured through /etc/inittab> and /etc/securetty. This is necessary to access the console.

/etc/shadow

Passwords must be stored in /etc/shadow. This is necessary so "root"'s password can be reset.

TTY configuration

Consoles must be configured through /etc/inittab> and /etc/securetty. This is necessary to access the console.

glibc and Xen

The loader must support the file /etc/ld.so.conf.d/libc6-xen.conf. This is necessary to improve the performance of Xen.