Problems with passthrough hard drives

axsim

Member
Jun 19, 2021
13
1
8
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?
 
I have no experience with dmadm but /dev/sda etc. are not stable. Maybe use /dev/disk/by-id/... or /dev/disk/by-path/... instead?
Maybe instead of attaching a HD like this qm set 3000 -sata0 /dev/disk/by-id/wwn-0x50014ee262bb97b7 I should do it like this qm set 3000 -virtio0 /dev/disk/by-id/wwn-0x50014ee262bb97b7 ?
 

About

The Proxmox community has been around for many years and offers help and support for Proxmox VE, Proxmox Backup Server, and Proxmox Mail Gateway.
We think our community is one of the best thanks to people like you!

Get your subscription!

The Proxmox team works very hard to make sure you are running the best software and getting stable updates and security enhancements, as well as quick enterprise support. Tens of thousands of happy customers have a Proxmox subscription. Get yours easily in our online shop.

Buy now!