I'm running Proxmox 8.1.4 and have an Ubuntu server 22.04.4 LTS VM that was a hardware server and I virtualized it. I successfully configured 3 hard drives from the Proxmox host to the Ubuntu VM. Those three drives were setup as a RAID 5 with mdadm before I virtualized it. I successfully re-added the RAID and updated the mdadm.conf file and ran update-initramfs -u. The RAID has a logical group called vault-vg and a logical volume called Vault on it that I mount with the UUID in the fstab. Everything works great. I reboot the vm, it remounts the RAID as it should. I shut down the vm and start it back up and it remounts the RAID as it should. However, If I shut down the vm and the proxmox host, and then power them both back up, the Ubuntu server vm loses the RAID. That causes the VM to fail to start and I have to go into emergency mode and comment out the Vault mount, then force the vm to power off. It never shut down or reboots gracefully at that point. Then once the VM is powered back up I have to do the following steps every time...
mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
update-initramfs -u
vi /etc/fstab and uncomment the RAID
mount -a
Is there a way to fix this? Am I even using the passthrough correctly? Should I create the RAID on the Proxmox server then pass that through to the VM?
mdadm --create --verbose /dev/md0 --level=5 --raid-devices=3 /dev/sdb /dev/sdc /dev/sdd
mdadm --detail --scan >> /etc/mdadm/mdadm.conf
update-initramfs -u
vi /etc/fstab and uncomment the RAID
mount -a
Is there a way to fix this? Am I even using the passthrough correctly? Should I create the RAID on the Proxmox server then pass that through to the VM?