How does one properly approach having Ubuntu servers on a Xen hypervisor? I don't have any experience with RAID or Xen other than from a theoretical level.
Additional requirements:
- Use with mdadm Software RAID 5 (can be on separate disks) that multiple instances with access
- Paravirtualized Ubuntu Server guests instances
Possible ideas for now:
- Ubuntu host (dom0) with ubuntu-xen-server package (this purportedly isn't supported)
- dom0 host will "own" RAID 5 partition
- More Ubuntu servers as guests
- Citrix XenServer bare-metal host
- XenServer will own RAID
- Citrix XenServer bare-metal host
- Ubuntu guest instance creates and owns RAID
Questions and concerns:
- Can Ubuntu be used as a dom0 Xen host?
- Can XenServer install packages such as mdadm and create a partition?
- Can multiple guest access (R + W) to the same data partition (RAID)?
Note: since it may have a bearing on support, I'm referring to Ubuntu Server 10.04
Answers:
If you use software raid on Linux, you should create a partition for your dom0 instance and a big partition with the rest of the hard drive.
Then, you use this big partition as a lvm physical drive and you create one or more lvm logical drive per vm.
This enable you to increase/decrease easily the size of a particular logicial drive.
1. Can Ubuntu be used as a dom0 Xen host?
Set up Ubuntu 10.04 Server PV DomU at Xen 4.0 Dom0
Set up Libvirt 0.8.1 & Xen 4.0.1 Dom0
2. Can XenServer install packages such as mdadm and create a partition?
Installing can be little bit tricky but i might work. XenServer use RHEL 5 with custom kernel from rhel box you can ldd /path/to/mdadm and copy all linked libraries to XenServer on exact same locations. I might work ;)
**3. Can multiple guest access (R + W) to the same data partition (RAID)?****
I'm sure that you knew the answer.
Well in my experience, I just leave the details to libvirt. It hides the virtualization details for me. Typical setup would be to install a stock ubuntu, then libvirt and md tools. Assuming you have devices for your raid make sure that they have the right system (linux raid autodetect) in fdisk. Start fdisk, choose the partition/device, the use the t command to change it's type. An example for raid 1 is shown below. Adjust the level in your setup to 5 to get raid 5
You can start using you array even as it's sync'ing. So we start with lvm: Typically, you need to setup a PV, then a vg and finally your LV for individual VMs.
Create your physical volume using pvcreate, VG and LV
then view your handiwork
You may now use libvirt to install over such a typical LV (notice that you can change the virt-type from kvm to xen.. :) ) - You may need to remove the virtio parameter as this is KVM specific.
What I typically do is create a template VM and clone it to create worker vms (--conect might be kvm specific):
Now you can have fun using the virsh commands. See it's help.
Happy VM'ing