name="xen-guest" cpu="2" ram="2048" disk="8" virt-install \ --paravirt \ --file=/var/lib/xen/images/$name.img \ --name $name \ --vcpus=$cpu \ --ram $ram \ --file-size=$disk \ --nonsparse \ --check-cpu \ --nographics \ --location=http://kickstart.server.com/rhel5.3/ \ -x ks="http://kickstart.server.com/xen.cfg"Note that the --location option contains the contents of a mounted ISO file, not the ISO file itself. I.e. it was made by mounting the ISO file for the distro as a loop back device inside of /var/www/html/rhel5.3. It is from this mounted ISO file that virt-install downloads the initrd and kernel to boot from and start the install. The kickstart file is then followed and should contain where to get the medium for the install. I did this because I wanted to have a VM which was based on a config which is standard to all of my servers. However, now that I have a Xen guest that I like I've just been using virt-clone and variations of my backup script to create copies and move them between servers.
Monday, June 29, 2009
Xen Kickstart
Xen Backups
I have three Xen servers and each copies its VMs to the other [backup_target = server_N + 1 % count(xen_servers)]. I shut down each VM, make a snapshot and bring each back up. This results in a 60 second outage for all of the VMs plus boot time with doing a virsh shutdown and then xm create for each VM. I am copying only the image files from /var/lib/xen/images/ and each VM's config file from /etc/xen/.
The majority of time is then spent doing an rsync, however it is not time without service because the VMs would already be back up and the snapshot serves a stable shutdown VM for the backup. My rsync user has the scpsftprsynconly shell, which works nicely and is cleaner than setting up chroot jail. I then only need to boot the VMs on their other host to restore service if there is a hardware problem.
Monday, June 8, 2009
Copying Xen images with minimal downtime & Automating Xen Deployment
Saturday, June 6, 2009
rhel tcptraceroute
$ ls -l `which tcptraceroute` lrwxrwxrwx 1 root root 10 May 29 05:35 /bin/tcptraceroute -> traceroute $They also have nothing in their repository that you can 'yum install'. Come on RedHat, it's GPL'd! To get past this you can update your repository or simply:
wget http://ftp.belnet.be/packages/dries.ulyssis.org/redhat/el5/en/x86_64/RPMS.dries/tcptraceroute-1.5-0.beta7.el5.rf.x86_64.rpm rpm -iv tcptraceroute-1.5-0.beta7.el5.rf.x86_64.rpm rm /bin/tcptraceroute which tcptracerouteThe 'rm' removes the symlink and the 'which' should return /usr/bin/tcptraceroute.