Hello, I have a HPE LTO tape reader+changer connected via a SAS card that I want to use from inside a qemu VM on proxmox.
After a bit of reading, I have been able to connect it like follows (I put here the full process, in case other people are interested) :
On the pve, I find out which are the "raw" scsi devices that correspond to the tape reader and tape changer:
In order to find which is the reader and which is the changer, I can check with dmesg, although it is not strictly necessary:
So it is st->sg7 (the tape drive) and ch->st8 (the tape changer robot)
I can then add the device by hand in the qemu configuration file, in my case /etc/pve/nodes/pve01/qemu-server/123.conf, by adding the following line (I have the line unrolled it for readability, but it has to be put on a single line, or potentially several "args" lines?):
This works perfectly fine, the two devices appear inside the VM and I can use them.
I have, however, two questions:
1. Is I correct to use the same virtual bus for both? Would it make any difference to use different buses?
2. The configuration is a bit fragile, i.e. the number of the devices can change after a reboot. It usually does not, but it will if, for example, I modify the iSCSI drives which are also attached. Is there a way to make this more solid? I could make a script to modify the file during boot, or poke around with udev configuration, but they both seem dangerous to me.
Also, I use scsi virtual devices 2 and 3, because I already have 0 and 1 configured directly from proxmox interface. If I add a new drive in proxmox and forget to update the file by hand, problems could arise. Ideally, a native proxmox supports for raw scsi device could solve all these problems.
Thank you anyway, and I hope this could be useful to someone else.
After a bit of reading, I have been able to connect it like follows (I put here the full process, in case other people are interested) :
On the pve, I find out which are the "raw" scsi devices that correspond to the tape reader and tape changer:
Code:
# ls -l /dev/sg*|grep tape
crw-rw---- 1 root tape 21, 7 11 avril 14:23 /dev/sg7
crw-rw---- 1 root tape 21, 8 11 avril 14:23 /dev/sg8
Code:
# dmesg|grep sg[78]
[101770.048401] st 1:0:2:0: Attached scsi generic sg7 type 1
[101770.721470] ch 1:0:2:1: Attached scsi generic sg8 type 8
I can then add the device by hand in the qemu configuration file, in my case /etc/pve/nodes/pve01/qemu-server/123.conf, by adding the following line (I have the line unrolled it for readability, but it has to be put on a single line, or potentially several "args" lines?):
Code:
args: -drive id=footape,
if=none,
format=raw,
readonly=off,
file=/dev/sg7
-device virtio-scsi-pci,
id=scsi2
-device scsi-generic,
bus=scsihw0.0,
drive=footape
-drive id=foochgr,
if=none,
format=raw,
readonly=off,
file=/dev/sg8
-device virtio-scsi-pci,
id=scsi3
-device scsi-generic,
bus=scsihw0.0,
drive=foochgr
This works perfectly fine, the two devices appear inside the VM and I can use them.
I have, however, two questions:
1. Is I correct to use the same virtual bus for both? Would it make any difference to use different buses?
2. The configuration is a bit fragile, i.e. the number of the devices can change after a reboot. It usually does not, but it will if, for example, I modify the iSCSI drives which are also attached. Is there a way to make this more solid? I could make a script to modify the file during boot, or poke around with udev configuration, but they both seem dangerous to me.
Also, I use scsi virtual devices 2 and 3, because I already have 0 and 1 configured directly from proxmox interface. If I add a new drive in proxmox and forget to update the file by hand, problems could arise. Ideally, a native proxmox supports for raw scsi device could solve all these problems.
Thank you anyway, and I hope this could be useful to someone else.