Growing your Xen guest disks with xen-resize-guest

1 minute read

This morning I woke to a notification from nagios
telling me the disk was full on one of the slices I manage for a client. I knew
what I had to do. As we run Xen virtual servers on
dedicated hardware I could shut down the slice, increase the lvm size, grow the
filesystem and then fire up the slice again. What I didn’t look forward to was
reading man pages and googling to find out exactly how to do that.

I was glad to discover that Steve Kemp’s
xen-tools-3.9 (a
collection of scripts for creating and managing xen virtual machines) contains
a command that does just what I needed. This script is not included in Ubuntu
7.10’s package (xen-tools-3.5) so I just copied the script from the source
distribution.

Xen-tools is well thought out, simple to use and easy to extend. I’ve been
using it since I started using Xen and highly recommend it.

xen-tools-resize allowed me to grow the main disk for my gateway slices from
2GB to 10GB in about a minute with just one command. That left me with time to
tell you about Steve’s awesome toolkit! Steve’s also got some great sysadmin
tips at http://www.debian-administration.org/