Creating a raid on a vm

GraphiqueXpert

New Member
Oct 3, 2022
7
0
1
Hello.
I have just created a vm STORAGE and added disks to it via the
Code:
qm set <vmid> -scsi1 /dev/disk/by-id/<my_disk>
command.

I want my vm STORAGE to be able to use a dedicated raid for it.

My problem is that I created my raid via MDADM, no worries, but once the server reboots, I lose my raid.

My question: How can I get raid via HDD passthrough on a VM without using a virtual disk?
Thanks and sorry for my english.
 
I'm facing a similar issue. Except, If I reboot the VM the raid is still there. If I reboot the host, it's gone. I have to recreate it everytime. Still no answer to the problem.
I've tried...
qm set <vmid> -virtio0 /dev/disk/by-id/<my_disk>
qm set <vmid> -sata0 /dev/disk/by-id/<my_disk>
Neither makes a difference.
I run these in the VM after a reboot or shutdown of the host.
mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/vda /dev/vdb /dev/vdc
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
update-initramfs -u


There must be some Id that changes somewhere when the host is rebooted. Maybe something is not written properly when running update-initramfs -u?
 
Last edited: