[SOLVED] Best way to share Linux RAID 10 across multiple Hyper-V VMs?

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
I am designing a new server project for my home network and have run into an interesting roadblock...

I currently have my home server running 1 instance of Ubuntu Server 19, and have a RAID 10 array set up with mdadm (the machine is only running 1 OS with no VM's, and the RAID 10 is on 4 physical drives). This RAID 10 provides data redundancy to my nginx configuration (runs Nextcloud over the internet) and my local Samba service. This works fine right now, because nginx and samba run on the same machine, and are connected to the same network.

The new server I am designing will use Hyper-V Server to utilize different VMs for different services. I will run 1 Ubuntu Server VM for nginx, inside a virtual DMZ (achieved through Hyper-V virtual networking). Then of course, I will run another VM for samba, but connect this one to my local network. I want the samba server to be detached from the DMZ.

The problem I can't solve is the RAID 10. If I give the nginx server the RAID 10 for data redundancy, the samba server won't get to use it; or vice versa. They would be on entirely different networks and on separate VMs.

What would be the best way to share the RAID 10 between the two VM's?
 
Solution
Do you have a hardware RAID controller available? If so then create 2 RAID volumes. 1 will be for Hyper-V and the other will be your storage pool. Install Hyper-V on the small pool and then attach the other storage pool to it to install your VMs.

If you don't have a hardware RAID you will have to do software RAID via Windows and then have that software RAID storage pool available to Hyper-V. You would then create virtual disks to put onto the pool that would be for your 2 VMs.

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
Is this RAID 10 array done via hardware or software? Are the drives local to the server in which Hyper-V will be your hypervisor?
The RAID is running through mdadm on Ubuntu and the drives are local to the machine that will run Hyper-V Server.

I also just read somewhere today that running a RAID inside a VM is a little dangerous, so this might need to be rethought
 
Do you have a hardware RAID controller available? If so then create 2 RAID volumes. 1 will be for Hyper-V and the other will be your storage pool. Install Hyper-V on the small pool and then attach the other storage pool to it to install your VMs.

If you don't have a hardware RAID you will have to do software RAID via Windows and then have that software RAID storage pool available to Hyper-V. You would then create virtual disks to put onto the pool that would be for your 2 VMs.
 
Solution

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
Do you have a hardware RAID controller available? If so then create 2 RAID volumes. 1 will be for Hyper-V and the other will be your storage pool. Install Hyper-V on the small pool and then attach the other storage pool to it to install your VMs.

If you don't have a hardware RAID you will have to do software RAID via Windows and then have that software RAID storage pool available to Hyper-V. You would then create virtual disks to put onto the pool that would be for your 2 VMs.
Perfect! Thank you. I am not running Windows Server, just the free Hyper-V Core. So I think this means I might have to make my storage pool in Windows 10 Pro before I install Hyper-V. Not too sure what capabilities the free version has around storage solutions
 

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
I hope that you have really good backup of your RAID data. You will have to scratch dat data when you move it over to HyperV, since this is where the disks will be attached to, and RAID managed from. Your VMs don't see RAID, they see simple disk drive.
Yeah it’s going to be an issue. I am looking into using Proxmox instead so I don’t have to redo my RAID configuration. I know it’s off-topic, so I won’t go into details on this thread
Thank you guys for your help!
 
Yeah it’s going to be an issue. I am looking into using Proxmox instead so I don’t have to redo my RAID configuration. I know it’s off-topic, so I won’t go into details on this thread
Thank you guys for your help!
Proxmox is a decent Hypervisor but you could also get VMware vSphere and run it is free mode. For what you are doing the free mode would be more than enough. In the end both of them are Type 1 hypervisors which is an advantage. Do you have a hardware RAID controller?
 

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
Proxmox is a decent Hypervisor but you could also get VMware vSphere and run it is free mode. For what you are doing the free mode would be more than enough. In the end both of them are Type 1 hypervisors which is an advantage. Do you have a hardware RAID controller?
I'll will look into that as well, thank you. I do not have a hardware RAID controller unfortunately... but I can look into getting one of those as well. The main reason I don't use one is because I go to College away from home, and if I had a hardware RAID setup I couldn't really do maintenance on it remotely or know when the thing would stop working
 
I'll will look into that as well, thank you. I do not have a hardware RAID controller unfortunately... but I can look into getting one of those as well. The main reason I don't use one is because I go to College away from home, and if I had a hardware RAID setup I couldn't really do maintenance on it remotely or know when the thing would stop working
I wouldn't worry about the RAID controller stopping working. Just find a decent refurbished enterprise SAS/SATA controller card, make sure the battery is new, and plug it in and don't worry about it for 3 years when you need to replace the battery again.
 

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
I wouldn't worry about the RAID controller stopping working. Just find a decent refurbished enterprise SAS/SATA controller card, make sure the battery is new, and plug it in and don't worry about it for 3 years when you need to replace the battery again.
Cool! Thanks for the info. Are these cards usually Linux and Windows (or Hyper-V) compatible?
 
Generally they are, but when I work with them I have to configure them from the BIOS. I would make sure that what you get is compatible with your hardware, but since it is PCIe based it shouldn't be difficult. The nice thing is that since it is hardware based you create your storage pool before the OS is loaded. For example I have 3 different RAID volumes on 1 of my servers, 2 large volumes and 1 small volume. The small volume has ESXi installed on it and the large volumes are my storage pools.
 

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
Generally they are, but when I work with them I have to configure them from the BIOS. I would make sure that what you get is compatible with your hardware, but since it is PCIe based it shouldn't be difficult. The nice thing is that since it is hardware based you create your storage pool before the OS is loaded. For example I have 3 different RAID volumes on 1 of my servers, 2 large volumes and 1 small volume. The small volume has ESXi installed on it and the large volumes are my storage pools.
Wait so I can assign 1 storage pool to multiple VMs simultaneously? What is this called / how is this done? That sounds awesome
 
Wait so I can assign 1 storage pool to multiple VMs simultaneously? What is this called / how is this done? That sounds awesome
What happens is in the Hypervisor you create virtual hard drives (VHD) for your VMs and those virtual disks are stored on the storage pool that you setup. The hypervisor sees the storage pool as one big datastore and doesn't care how many VMs are running on the storage, as long as there is enough space on the datastore. A datastore can be from a physical Storage Area Network (SAN), virtual SAN, Network Attached Storage (NAS), or local disk to the host.
View: https://www.youtube.com/watch?v=cJM67FsMEQg
View: https://www.youtube.com/watch?v=DFjO7ZZ9jBs
 

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
What happens is in the Hypervisor you create virtual hard drives (VHD) for your VMs and those virtual disks are stored on the storage pool that you setup. The hypervisor sees the storage pool as one big datastore and doesn't care how many VMs are running on the storage, as long as there is enough space on the datastore. A datastore can be from a physical Storage Area Network (SAN), virtual SAN, Network Attached Storage (NAS), or local disk to the host.
View: https://www.youtube.com/watch?v=cJM67FsMEQg
View: https://www.youtube.com/watch?v=DFjO7ZZ9jBs
That's easier than I thought. I assumed that if you just simply make a virtual disk inside of a RAID, it would just be another thing to fail (an additional filesystem). I know I keep asking questions haha, but what if the virtual disk filesystem fails? Would the data be destroyed?
 
That's easier than I thought. I assumed that if you just simply make a virtual disk inside of a RAID, it would just be another thing to fail (an additional filesystem). I know I keep asking questions haha, but what if the virtual disk filesystem fails? Would the data be destroyed?
Yes the data would be destroyed, but that is why you have backups. That being said if you are using VMware you have an enterprise grade file system. Like Windows NTFS I have never seen VMware VMFS fail. The Virtual Disks themselves are resilient as well. I have never had a virtual disk fail, only the Linux EXT4 filesystem of the VMs OS get corrupted.
 

Tyler334

Reputable
Dec 27, 2016
12
0
4,510
Yes the data would be destroyed, but that is why you have backups. That being said if you are using VMware you have an enterprise grade file system. Like Windows NTFS I have never seen VMware VMFS fail. The Virtual Disks themselves are resilient as well. I have never had a virtual disk fail, only the Linux EXT4 filesystem of the VMs OS get corrupted.
Very nice. Thanks so much again for all of your help! Hopefully I don't run into more issues down the road haha