KVM Passthrough - Raid 0 SSD Array

Just wondered if anyone has tried this or can help me try this out. I have a couple of small SSDs in a raid 0 array to store games on. I can pass through one of the SSDs using the simple method

<disk type='block' device='disk'>
<source dev='/dev/disk/by-id/ata-(SSDID)' />
<target dev='hdc' bus='virtio' />
</disk>

I first tried to just physically pass through all of the SSDs, but that seems to come up with an error when there is more than one. So I though I could just pass through the raid array instead. But struggled to find any information on the best way to do this. Any ideas?

Using the standard KVM system on Linux Mint, if any other information is need to help with this just let me know what you need to know to help. Thank you in advance for any help.

How is the raid configured? Does Linux see it as one device?

What error are you getting when you have multiple disk devices in the config? Are the device address and target dev names unique for each device?

The way I would approach this would be to first raid the devices in Linux using something like BTRFS or MDADM and then assign the resulting block device to the guest.

Easiest way is with Qemu and use virt-manager. Doing it all in console with XML(forgot how else it was called, i though it was this.) is annoying if you make one typo it doesn't always return the error.

I used MDADM for the RAID. But do not know how to pass through the block device once its made.

I just went through the multiple SSD passthrough again and now I dont get an error, but the virtual machine no longer appears, showing that the method Im using for adding the SSDs is clearly wrong. Here are some of the different combinations of the code I used, prepare yourselves for some likely stupid attempts.

</disk>
    <disk type='block' device='disk'>
    <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC20990D'/>
    <target dev='hdc' bus='virtio' />
</disk>
</disk>
    <disk type='block' device='disk'>
    <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC21050F'/>
    <target dev='hdc' bus='virtio' />
</disk>



</disk>
    <disk type='block' device='disk'>
    <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC20990D'/>
    <target dev='hdc' bus='virtio' />
    <disk type='block' device='disk'>
    <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC21050F'/>
    <target dev='hdc' bus='virtio' />
</disk>

Both of these moethods above remove the VM from the KVM console so I cant launch it

</disk>
    <disk type='block' device='disk'>
    <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC20990D'/>
    <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC21050F'/>
    <target dev='hdc' bus='virtio' />
</disk>

This one the second SSD simply does not appear.

As you can see from the code, the SSDs do have different IDs so I dont think that is the problem just I dont know how to add multiple ones into the code. If you can help with either method it would be greatly appreciated.

I figured it out, as always something very simple that I always seem to miss.

</disk>
<disk type='block' device='disk'>
  <driver name='qemu' type='raw'/>
  <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC21050F'/>
  <target dev='vdb' bus='virtio'/>
</disk>
<disk type='block' device='disk'>
  <driver name='qemu' type='raw'/>
  <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC20990D'/>
  <target dev='vde' bus='virtio'/>
</disk>
<disk type='block' device='disk'>
  <driver name='qemu' type='raw'/>
  <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC21084K'/>
  <target dev='vdc' bus='virtio'/>
</disk>
<disk type='block' device='disk'>
  <driver name='qemu' type='raw'/>
  <source dev='/dev/disk/by-id/ata-Samsung_SSD_840_PRO_Series_S12RNEACC24516Y'/>
  <target dev='vdd' bus='virtio'/>
</disk>

I simply changed the target dev to hdx then changed the letters to a sequence and they all go through. Thank you both for your help.

1 Like

Good, I wanted to mention that, but though by myself it wouldn't be such a simple problem. XD