Ubuntu Trusty DomU

# configure domU
[ -z $DOMAIN_NAME ] && DOMAIN_NAME=trusty
[ -z $DOMAIN_MAC ] && DOMAIN_MAC=00:00:00:00:aa:bb
[ -z $DOMAIN_RAM ] && DOMAIN_RAM=1Gb
[ -z $DOMAIN_HDD ] && DOMAIN_HDD=8Gb
 
# create domU on LVM (for image file use --dir=/root,)
xen-create-image \
--hostname=${DOMAIN_NAME} \
--dist=trusty \
--lvm=vg1 \
--fs=ext4 \
--dhcp \
--mac=${DOMAIN_MAC} \
--mirror=http://archive.ubuntu.com/ubuntu \
--size=${DOMAIN_HDD} \
--memory=${DOMAIN_RAM} \
--swap=${DOMAIN_RAM}
--genpass=0 \
--password=t00r \
--apt_proxy=http://apt-cacher:3142/ \
--vcpus $(cat /proc/cpuinfo | grep processor | wc -l)
 
# --role=udev
# --pygrub
 
# rename vm config
mv /etc/xen/${DOMAIN_NAME}.cfg /etc/xen/${DOMAIN_NAME}
 
# OPTIONAL: add to autostart
ln -s /etc/xen/${DOMAIN_NAME} /etc/xen/auto
 
# start domU
xm create -c ${DOMAIN_NAME}