xend refusing to start

We recently had a few power outages at work, some scheduled, some not, and this played havoc with our xen servers.

One of the problems we had was that xend would not start (and thus xendomains would also not start).

Checking /var/log/xen/xend.log gave us the following snippet:

<br /> inst = XendNode()<br /> File "/usr/lib/python2.5/site-packages/xen/xend/XendNode.py", line 164, in __init__<br /> saved_pifs = self.state_store.load_state('pif')<br /> File "/usr/lib/python2.5/site-packages/xen/xend/XendStateStore.py", line 104, in<br /> load_state<br /> dom = minidom.parse(xml_path)<br /> File "xml/dom/minidom.py", line 1913, in parse<br /> File "xml/dom/expatbuilder.py", line 924, in parse<br /> File "xml/dom/expatbuilder.py", line 211, in parseFile<br /> ExpatError: no element found: line 1, column 0<br /> [2008-03-10 21:37:40 18122] INFO (__init__:1094) Xend exited with status 1.<br />

Resize Xen Filesystem

We run a lot of Xen instances for our development and test servers and a few were starting to get full. Fortunately the disks in the real servers were very large and the xenlet partitions were made using LVM so resizing them to add more space was possible!

root@dev-myfiles0:~# df -h

Filesystem Size Used Avail Use% Mounted on

/dev/hda1 4.0G 3.8G 200M 95% /

varrun 257M 48K 257M 1% /var/run

varlock 257M 0 257M 0% /var/lock

udev 257M 40K 257M 1% /dev

devshm 257M 0 257M 0% /dev/shm

Basically we just have to shut down the xenlet, resize the partition and then restart the xenlet again, simple!