Software Raid on Xenserver 5.6 SP2 using mdadm

I finally got my virtualization servers in, and all of my components to get them humming with XenServer 5.6 Sp2. The only problem I found was that the onboard RAID controller on HP GL160G6 BV110i is really a HostRAID or FakeRAID solution. Fake raid controller only does the work of writing and the parity bit are maaintained by driver at the cost of CPU.

My advise: Stay miles away from the FakeRaid instead use MDADM or software raid. In case you made it work some how. You will realise my world as gold when you got a failure. One upgrade of OS you RAID will fail as the driver will mismatch and leaving you high and dry. You need to do simultaneous upgrade of firmware and  OS provided you got the update firmware.

XenServer does support software RAID though using Linux mdadm. I find Linux software RAID is pretty stable. Plus since it’s only RAID 1 I am unlikely to see a huge performance hit.

The only problem with the tutorial I found is that it takes a lot of terminal commands to get software RAID configured properly, and if I have to do this on more than one server that would be a pain. So I decided to copy all the commands into one handy dandy shell script!

You can download that sucker here: (XenServer RAID 1 Script) (Please save the content in text file)

In order to run it, you must have two hard drives of the same size. Run the XenServer install like normal, and only select the SDA drive as the installation point, as well as for the VM containers. Make sure that you leave SDB unchecked when configuring your VM containers. After that, follow the prompts like normal to complete the install.

Once the install is done, you can ssh into your newly installed XenServer from another machine, then run the following:

chmod +x


That’s it pal! Just wait a few minutes, answer a few questions with ‘Y’ for yes, and you will have a software RAID 1 implementation of XenServer 5.6 is no time! I have tested it three times in a row, and it works great! I have also taken out one drive at a time to verify that XenServer still boots, and it’s worked flawlessly!


PS: Once it reboot do a cat /proc/mdstat and there might be a chance that one of the RAID device is not added

To add a raid device

mdamd –manage /dev/md0|1 –add /dev/sda|b1|3

Use of the values in | as per your configuration


4 thoughts on “Software Raid on Xenserver 5.6 SP2 using mdadm

    • What additional Features you are looking for in version 6.0. If your server is running stable and in production then stick with it. If an experimental server then you know what to do. Are you using the Community Edition Xen Server 5.6 SP2.

      • I need to do a hardware upgrade on a production system. And as far as I remember its easier to cope with changed NICs in the version 6.
        What I did now was to remove the raid1 so that the boot cd detects the existing installation again. But I could not upgrade yet. I learned that I would have to start the upgrade on the pool master, but the new hardware is already in the pool member… 😦

      • I would suggest stick to 5.6 SP2. Lot of people have problem with 6. You can always manage a upgrade on NIC and all using command line xe. Basically all resource got an reference in Xen. We need to recreated that.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out /  Change )

Google+ photo

You are commenting using your Google+ account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )


Connecting to %s