Nowadays the hardisks are almost cheaper so creating a RAID1 is a good way to keep your data safe without waste too much money. If you have two disks with same size use them to create mirrored Storage Repository in XEN with the help of mdadm raid software, by default installed in a XEN distribution.
SATA is always the best option to have a good I/O but as a test system IDE disks will be valid as well.
Let’s start. First, create the md devices in /dev
# cd /dev # MAKEDEV md
now create a RAID1 md device using two disks,
# mdadm --create /dev/md0 --force --level=raid1 --raid-devices=2 /dev/sdc /dev/sdd mdadm: array /dev/md0 started.
You can continue creating the repository, but to check the status of the RAID1 creation, you can do it with:
# cat /proc/mdstat Personalities : [raid1] md0 : active raid1 sdd1[1] sdc1[0] 732571904 blocks [2/2] [UU] [>....................] resync = 0.0% (588032/732571904) finish=165.9min speed=73504K/sec
Now, continue creating the repository with
# xe sr-create name-label="SR_RAID1_MD0" shared=false device-config-device=/dev/md0 type=lvm 2bcdd242-d809-99f9-a417-94573728a8db
where 2bcdd242-d809-99f9-a417-94573728a8db is the output of xe command with ID of the repository.
Now set it up as the default repository
# xe pool-param-set default-SR=2bcdd242-d809-99f9-a417-94573728a8db uuid=21e7cb23-37df-791c-e71d-cf0069a195e3
Now your machines will be stored by default on this RAID1 storage repository. As a good practice, remember always to backup your virtual machines outside XEN even having RAID1 repositories.