I have 4 drives for data storage, that i want to arrange in a software raid 10 (hardware raid is no option). I was asked to set all things up in a vm, so it is easier to change the hardware, if it is necessary. I have no experiences with software raid and vm's and I am wondering if it is even working. I am running ubuntu and i want to use kvm. I have a additional ssd where both are running. There are 2 ways that i can think about.

  1. Do the raid on the host and pass it to kvm
  2. Set up the raid in kvm.

I have a few concerns that both of these are really bad ideas(especially the 2.). So does it work? And if do i still have the advantages of a raid 10(faster, redundancy)? What is the best way to do this? 1. or 2. or a 3.?


Solution 1:

It does work, in the sense that you can achieve setting up raid... however there will be zero redundancy and completely invalidates the point of having it.

Here’s my advice:

  1. Create a mdadm raid 10 on the host
  2. Create lvm against the raid 10
  3. Use the lvm as the KVM disk

That way you’re getting all the redundancy benefits of raid10, but also gives the benefits of snapshotting the VM for example before a major change giving you rollback opportunities too! Although LVM IS optional