pbs unable to detect tape drive within lxc environment

tmolberg

New Member
Jul 15, 2021
6
0
1
33
Hi,

For specific reasons i've seperated out pbs into a seperate lxc container - This is mainly due to the host being used for virutalization and other reasons.
I've been trying to get proxmox-tape to recognize my tape drive to no avail. Please note that the cephfs bind mount is only being used as a temporary storage area for pbs to be able to write to the tape machine. For harddrive backup I have another seperate pbs instance which is not tied together to cephfs. The intention here is to be able to store "the most vital" on a seperate storage medium.

Installing pbs directly on the host allows pbs to recognize the lto4 drive as I would expect.

What is somewhat strange is that mtx and mt works as I would expect but "proxmox-tape scan" does not.

For example:
mt
Code:
root@sh-pbs:~# mt -f /dev/st0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x46 (LTO-4).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN

mtx
Code:
root@sh-pbs:~# mt -f /dev/st0 status
SCSI 2 tape drive:
File number=0, block number=0, partition=0.
Tape block size 0 bytes. Density code 0x46 (LTO-4).
Soft error count since last status=0
General status bits on (41010000):
 BOT ONLINE IM_REP_EN
root@sh-pbs:~# mtx -f /dev/sg3 inquiry
Product Type: Tape Drive
Vendor ID: 'HP      '
Product ID: 'Ultrium 4-SCSI  '
Revision: 'W62D'
Attached Changer API: No

mtx towards the udev device...
Code:
root@sh-pbs:~# mtx -f /dev/tape/by-id/scsi-HUE1114VC5-sg inquiry
Product Type: Tape Drive
Vendor ID: 'HP      '
Product ID: 'Ultrium 4-SCSI  '
Revision: 'W62D'
Attached Changer API: No

To get going I've manually passed through the tape devices (and also the one exposed by ID created by the udev rules). I had to manually create the udev rules which follows the package of proxmox-backup-server

the lxc container is pretty much left fully open to access anything it want (I know its a security concearn :p)

Code:
arch: amd64
cores: 4
hostname: sh-pbs
memory: 8192
mp0: /mnt/pve/cephfs/sh-pbs/,mp=/srv/cephfs,shared=1
net0: name=eth0,bridge=vmbr0,hwaddr=76:EB:4B:84:0D:E0,ip=dhcp,tag=800,type=veth
ostype: debian
rootfs: NVME_Pool:vm-127-disk-0,size=8G
swap: 512
lxc.apparmor.profile: unconfined
lxc.cgroup2.devices.allow: a
lxc.mount.entry: /dev/st0 dev/st0 none bind,optional,create=file 0 0
lxc.mount.entry: /dev/nst0 dev/nst0 none bind,optional,create=file 0 0
lxc.mount.entry: /dev/sg3 dev/sg3 none bind,optional,create=file 0 0
lxc.mount.entry: /dev/tape/by-id/scsi-HUE1114VC5-sg dev/tape/by-id/scsi-HUE1114VC5-sg none bind,optional,create=file 0 0

If I try to bypass the scan and create the device regardless this happens;
Code:
root@sh-pbs:~# proxmox-tape drive create hp-ultrium-lto4 --path /dev/tape/by-id/scsi-HUE1114VC5-sg
Error: path '/dev/tape/by-id/scsi-HUE1114VC5-sg' is not a lto SCSI-generic tape device

I find it somewhat strange that proxmox-tape utility believes is not a scsi generic tape which lsscsi --generic seems to agree with me on...
Code:
root@sh-pbs:~# lsscsi --generic
[0:0:0:0]    disk    ATA      ST8000VN0022-2EL SC61  -          -       
[1:0:0:0]    disk    ATA      Samsung SSD 840  BB6Q  -          -       
[3:0:0:0]    disk    ATA      TOSHIBA HDWQ140  FJ1M  -          -       
[4:0:0:0]    disk    ATA      KINGSTON SA400S3 1103  -          -       
[6:0:6:0]    tape    HP       Ultrium 4-SCSI   W62D  /dev/st0   /dev/sg3
[N:0:0:1]    disk    INTEL SSDPE2ME012T4__1


Looking at strace im having a hard time actually understanding why it fails
(see attached file)

Any thoughts on what I've might done wrong in the lxc setup would be greately appriciated. I'm assuming that its just a device i havent passed through correctly or that ive misunderstood how a device should be passthroughed...
 

Attachments

  • stracepbsscan.txt
    17.8 KB · Views: 3
If I try to bypass the scan and create the device regardless this happens;
Code:
root@sh-pbs:~# proxmox-tape drive create hp-ultrium-lto4 --path /dev/tape/by-id/scsi-HUE1114VC5-sg
Error: path '/dev/tape/by-id/scsi-HUE1114VC5-sg' is not a lto SCSI-generic tape device

I find it somewhat strange that proxmox-tape utility believes is not a scsi generic tape which lsscsi --generic seems to agree with me on...
Please can you open a bug at bugzilla.proxmox.com?

As workaround, try to edit/create the file "/etc/proxmox-backup/tape.cfg" manually:

Code:
lto: hp-ultrium-lto4
    path /dev/tape/by-id/scsi-HUE1114VC5-sg
 
Please can you open a bug at bugzilla.proxmox.com?

As workaround, try to edit/create the file "/etc/proxmox-backup/tape.cfg" manually:

Code:
lto: hp-ultrium-lto4
    path /dev/tape/by-id/scsi-HUE1114VC5-sg

Hi,

I managed to get around it by this to the container config. For some reason it wouldn't detect with sys:ro or sys:mixed for that matter. I will try and remove as the the tape.cfg file has now been created.
Code:
lxc.mount.auto: sys:rw
 
Last edited:
Retested now with removing the lxc.mount.auto: sys:rw option and the drive still gets recognized and is still working correctly.

I've also filed a bug report though I wouldnt deem it vital for operations considering i've gone away from your guidelines (has to be running on the host)

https://bugzilla.proxmox.com/show_bug.cgi?id=3578
 
Last edited:

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!