1

I discovered that one of our servers runs in a VMWware virtual machine and it has a software RAID.

The admin is not reachable during the next days.

I think a software-raid in a VM does not make sense. I think RAID is something that should be handled by the hypervisor, not inside the VM.

What could be a feasible reason do this?

cat /proc/mdstat

Personalities : [raid10] 
md127 : active raid10 sde1[3] sdc1[1] sdb1[0] sdd1[2]
      209712128 blocks super 1.0 512K chunks 2 near-copies [4/4] [UUUU]
      bitmap: 0/2 pages [0KB], 65536KB chunk

unused devices: <none>
guettli
  • 3,591
  • 17
  • 72
  • 123
  • 1
    I have seen people use software raid to create larger volumes to overcome (more or less self-imposed or actual) limits on the maximum size of virtual disk images – HBruijn Dec 12 '18 at 12:16
  • 3
    `What could be the reason do this?` - We couldn't possibly answer why your admin set this up. What could be the reason? Legion. Ask your admin. Even if we gave you a list of reasons that wouldn't tell you why yours is set up like that. – joeqwerty Dec 12 '18 at 12:42
  • @joeqwerty yes, you are right. I updated the sentence. "What could be a feasible reason" is better, since that's what I ask for. – guettli Dec 12 '18 at 12:46
  • Again, how would any reason we give you help you know why yours is set up that way? Do you want to know the possible reasons or do you want to know the actual reason? We can't tell you why yours is set up that way and I don't see how knowing the possible reasons is in any way helpful to you. – joeqwerty Dec 12 '18 at 12:49
  • @joeqwerty I updated the question: I think a software-raid in a VM does not make sense. That's something that should be handled by the hypervisor. – guettli Dec 12 '18 at 13:05
  • 3
    It may or may not make sense. I'm not trying to be difficult. My point is that no matter what you, or I, or we think about the reasons... none of that matters. What matters is knowing why your admin set it up that way... which is a question none of us can answer. – joeqwerty Dec 12 '18 at 13:09
  • @joeqwerty Yes, you are right. It matters why the admin did this. But there is a different aspect, too. I am curious. The admin can have reason X. But maybe there is a feasible reason Y, too. I am curious. – guettli Dec 12 '18 at 13:30
  • Might depend on where the actual disk images are located. Are they on separate file systems (RAIDed or not) on the host machine? If using something like ESXi are they even on the same host? – ivanivan Dec 12 '18 at 14:33

1 Answers1

13

In general, it doesn't make sense to do this most of the time.

However, there are a handful of special cases where it does make sense (this is not an exhaustive list, just the stuff I can think of):

  • The admin knew how to set up software RAID arrays on Linux, but not on VMWare, so he set it up where he knew he could properly manage it. This would be my first guess in your particular case given that you didn't provide much other info on the server.
  • If it has to be software RAID regardless, it may be more efficient to handle it inside the VM instead of outside. This may or may not be the case for whatever particular VMWare product you're using (I doubt it would be for ESXi, but it wouldn't surprise me if it were for some of the other VMWare products).
  • If the guest started life on a physical server and you then need to virtualize it, it makes more sense to just keep the storage stack as-is in the guest because it simplifies the conversion process and reduces the chances that something in the guest will stop working because of the different configuration.
  • If the purpose of the VM is to test a particular software configuration that will be used on real hardware, the configuration inside the VM should be kept as close as possible to what will actually be used on the real hardware, which includes using the same storage stack.
  • Not the case here, but if using BTRFS/ZFS inside the VM but not outside, it makes more sense to have any replication and/or parity inside the VM so that you can get take full advantage of the block checksumming provided by BTRFS/ZFS for error recovery. The same argument can be applied in reverse if you have BTRFS or ZFS as a storage backend on the host but don't' use them inside the guests.
  • If there's a need for each copy to be stored on physically separate hardware, it may be easier to achieve that by putting the RAID layer inside the VM. This is easily demonstrated with QEMU on Linux and disks on iSCSI, with the RAID layer on the host you have to route things through multiple layers within the host's block layer, while putting the RAID layer inside the VM means that you don't have to even touch the host's block layer (because QEMU can natively speak iSCSI).
  • Whatever application is running in the guest OS may actually care about fine-grained control of the replication or detailed performance statistics relating to it, neither of which is easy to provide if the RAID array is handled on the host.
Austin Hemmelgarn
  • 2,295
  • 9
  • 15
  • I read your answer and summarize it to: "in general, it does not make sense to run a software RAID in a VM. But there are special cases where it makes sense". Do you agree? – guettli Jan 03 '19 at 15:11
  • 1
    Yes, that's pretty much the case. I'll edit the answer to reflect that a bit better. – Austin Hemmelgarn Jan 03 '19 at 16:33