Why Are There No Good Automated Deployment Tools for Xen on Enterprise Linux?
Currently, when I create a new Xen DomU, I have to create a new logical volume, edit a configuration template, install the OS, and finally modify the configuration file to its final post-install parameters. This is a time-consuming process that should be avoided if at all possible, yet I have not been able to find tools to do so.
I came across xen-tools, but its mainly for Debian based systems. It does have some tools to assist in deploying rpm based systems, but they appear to be clunky. The required rinse tool basically downloads packages twice to do the install. Why?
There is also the Red Hat provided Virtual Machine Manager which is GUI based. I like to stick to command line, but that’s OK since they have a tool called virt-install that will either prompt you for information or will accept arguments to configure the new DomU. The issue here is that virt-install creates the sxp file in /var/lib/xend/domains/(hex number)/ making it impossible to restart the machine after it has been started, as well as place a copy in the /etc/xen/auto folder for automatic startup at boot. However, there is a tool to parse the sxp formatted configuration file, back to the normal format… but its an extra step. Why can’t it just use the simple configuration file format from the start?
All I want is a simple tool that I can throw a few arguments at such as hostname and ip addreess to pass to kickstart, something I can have create the LVM partitions for me, and something that will properly output the configuration file to /etc/xen. Why is this so hard and why has this not been done yet?
Ryan, I understand your situation. To me it looks like Xen management is focusing on GUI tools and for the command line they are abandoning the old config formats. It does not help when RedHat announced they are switching to KVM.
To my unwelcome surprise, when I upgraded my CentOS 5 box to the latest Xen 3.3.0, virt-install would no longer create the old config formats. What I have done to go around the SXP file format (which will probably be ungreppable if it gets big enough) is make a shell script to create old config file for you. (On openSUSE, I believe the vminstall command makes both, so maybe SLES is the same)
#!/bin/sh
#auto create script using kickstart
vpsname=$1
xenvg=”xen”
sysmem=1024
tmp=/tmp/xentmp
if [ ! "$vpsname" ]; then
echo “Syntax: $0 vps_name”
exit
elif [ ! -b /dev/$xenvg/$vpsname ]; then
echo “No block device: /dev/$xenvg/$vpsname”
exit 1
fi
#paravirt
#works
virt-install -p –location=http://x.x.x.x/centos52-32 –noautoconsole –file=/dev/$xenvg/$vpsname –name=$vpsname –ram=$sysmem –vnc -x “ks=http://x.x.x.x/kickstart/xen-guest.ks” $2
#hvm
#still working on it
#qemu-kvm
#doesn’t yet work
#create old-style xm config file
sleep 2
xm list –long $vpsname > $tmp
sed ’s/(//g;s/)//g’ $tmp > $tmp.1
uuid=`grep -m 1 uuid $tmp.1 | awk ‘{print $2}’`
mac=`grep mac $tmp.1 | awk ‘{print $2}’`
( cat < /etc/xen/$vpsname
(i’m hoping none of that gets eaten) You can probably replace that elif block to do an lvcreate automatically for you.