#!/bin/bash

export PATH

HOSTNAME="$2"
DIST="$3"
MIRROR="$4"
IMAGESIZE="$5"
IP="$6"

VOLUME=/dev/mapper/xenvg-d_${HOSTNAME}_hda

cat > $VOLUME <<EOF
HOSTNAME=$HOSTNAME
DIST=$DIST
MIRROR=$MIRROR
IMAGESIZE=$IMAGESIZE
IP=$IP
return
EOF

xm create autoinstall.cfg target=$HOSTNAME guestip=$IP
