Installing a Scripts guest on a Xen host
----------------------------------------

You need to create the volumes to use:

    lvcreate -n $MACHINE-root --size 50.00G $HOST
    lvcreate -n $MACHINE-swap --size 10.00G $HOST
    lvcreate -n $MACHINE-cache --size 11.00G $HOST

/-------------------------------------------------------------------\
    Note: If you need to manually format the the swap and cache
    partitions (for example, you are migrating a host from 'migrate'),
    these commands should work.  If in doubt, consult the kickstart.

        # Use fdisk to generate a DOS partition table, and a single
        # partition extending the entire volume.
        fdisk /dev/$HOST/$MACHINE-swap
        fdisk /dev/$HOST/$MACHINE-cache
        # Figure out what kpartx is going to make the devices as
        # (e.g. $SWAP_DEV and $CACHE_DEV)
        kpartx -l /dev/$HOST/$MACHINE-swap
        kpartx -l /dev/$HOST/$MACHINE-cache
        # Read out the partition tables
        kpartx -a /dev/$HOST/$MACHINE-swap
        kpartx -a /dev/$HOST/$MACHINE-cache

        # FORMAT!
        mkswap $SWAP_DEV
        mkfs.ext4 -O ^has_journal -m 0 -N 1000000 $CACHE_DEV

        # Remove the devices
        kpartx -d /dev/$HOST/$MACHINE-swap
        kpartx -d /dev/$HOST/$MACHINE-cache
\-------------------------------------------------------------------/

Make sure that the console has an entry for this host:

    vim /etc/conserver/conserver.cf

If it doesn't, add:

    console $MACHINE {
        master $HOST;
        include xen;
    }

We use Kickstart to to initial Fedora configuration.  Installing a new
vanilla machine is as easy as:

    xm create scripts-server machine_name=$MACHINE install=fXX && console $MACHINE

The only prompt (near the beginning of the install process) should be
for the root password, and at the end, when it asks you to reboot.
Say yes, and the machine will power down, and then restart without
the install parameter:

    xm create scripts-server machine_name=$MACHINE && console $MACHINE

Networking and Subversion
~~~~~~~~~~~~~~~~~~~~~~~~~

Our Subversion repository lives at svn://scripts.mit.edu/. Our hosts bind to
scripts.mit.edu on localhost. Unfortunately, this means that checking out the
subversion repository on a new server while you're in the process of setting it
up sometimes won't work. In particular, if the server is already binding the
scripts.mit.edu IP address, but not yet serving svn, your attempt to do the
checkout will connect to the local machine and fail.

Any of the following should let you evade this issue:
* Avoid doing any svn operations between your first reboot and when svn is
  working. The networking changes from the install won't take effect until you
  reboot. Ordinarily, you won't need to do any commits or updates between the
  reboot and when LDAP and svn:// serving are working.
* Temporarily down the lo alias with the scripts.mit.edu IP address
  (18.181.0.43; seems to be lo:3 semi-consistently)
* Do your svn checkout from a current host, instead of scripts.mit.edu
  (for example, use svn://whole-enchilada.mit.edu/). Don't forget to
  svn switch --relocate to scripts.mit.edu once the server is set up.
