I have a virtual server running in qemu on proxmox. It has two physical disks attached to the host using a virtio: directive in 101.cfg as folllows
virtio2: /dev/disk/by-id/ata-vol1,backup=0
virtio3: /dev/disk/by-id/ata-vol2,backup=0
These contain a mirrored ZFS volume from which my files are served using nextcloud. This all works fine because these disks are never removed from the guest.
I also have a rotation of three other physical disks to which I back up (the physical controller is an LSI raid controller in JBOD configuration (the physical hardware is an HP Proiliant DL380e). I do this by zfs sending an updated snapshot from the storage array to whatever backup disk is present on the system. I had added these to the VM as follows:
virtio4: /dev/disk/by-id/ata-backup1-volname,backup=0
virtio5: /dev/disk/by-id/ata-backup2-volname,backup=0
virtio6: /dev/disk/by-id/ata-backup3-volname,backup=0
This sort of works but the problem is that none of those disks are hot swappable, so if I remove and insert disks in rotation, the guest stops being able to see them. I have disk hotplug enabled in my qemu config.
My question is what is the correct way to dynamically attach and detach these disks to my VM as they are inserted and removed? Thanks.
virtio2: /dev/disk/by-id/ata-vol1,backup=0
virtio3: /dev/disk/by-id/ata-vol2,backup=0
These contain a mirrored ZFS volume from which my files are served using nextcloud. This all works fine because these disks are never removed from the guest.
I also have a rotation of three other physical disks to which I back up (the physical controller is an LSI raid controller in JBOD configuration (the physical hardware is an HP Proiliant DL380e). I do this by zfs sending an updated snapshot from the storage array to whatever backup disk is present on the system. I had added these to the VM as follows:
virtio4: /dev/disk/by-id/ata-backup1-volname,backup=0
virtio5: /dev/disk/by-id/ata-backup2-volname,backup=0
virtio6: /dev/disk/by-id/ata-backup3-volname,backup=0
This sort of works but the problem is that none of those disks are hot swappable, so if I remove and insert disks in rotation, the guest stops being able to see them. I have disk hotplug enabled in my qemu config.
My question is what is the correct way to dynamically attach and detach these disks to my VM as they are inserted and removed? Thanks.
Last edited: