[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: XEN 4.12, redirect tape drive to domu


  • To: xen-users@xxxxxxxxxxxxxxxxxxxx
  • From: Éliás Tamás <et@xxxxxxx>
  • Date: Mon, 28 Sep 2020 11:05:01 +0200
  • Delivery-date: Mon, 28 Sep 2020 09:06:07 +0000
  • Dkim-filter: OpenDKIM Filter v2.10.3 mail.etit.hu 6870B327EC1
  • List-id: Xen user discussion <xen-users.lists.xenproject.org>

Hi!

Thank you for the responses. At the moment when I'm using PCI passthorugh I receive the follwoing error:


[ 17.592149] scsi 4:0:6:0: Sequential-Access IBM DDS Gen5 A1B0 PQ: 0 ANSI: 3
[   17.607179] scsi target4:0:6: Beginning Domain Validation
[   17.612790] scsi target4:0:6: wide asynchronous
[ 17.616625] scsi target4:0:6: FAST-20 WIDE SCSI 40.0 MB/s ST (50 ns, offset 32)
[   17.619668] scsi target4:0:6: Domain Validation skipping write tests
[   17.619670] scsi target4:0:6: Ending Domain Validation
[   19.677562] scsi 4:0:6:0: Attached scsi generic sg9 type 1
[   19.683814] st: Version 20160209, fixed bufsize 32768, s/g segs 256
[   19.685623] st 4:0:6:0: Attached scsi tape st0
[   19.685626] st 4:0:6:0: st0: try direct i/o: yes (alignment 4 B)
[19057.309731] st 4:0:6:0: Power-on or device reset occurred
[19121.837625] st 4:0:6:0: [st0] Block limits 1 - 16777215 bytes.
[20183.205282] INFO: task mt:12738 blocked for more than 120 seconds.
[20183.205408]       Not tainted 5.4.0-48-generic #52~18.04.1-Ubuntu
[20183.205516] "echo 0 > /proc/sys/kernel/hung_task_timeout_secs" disables this message.
[20183.205644] mt              D    0 12738  12736 0x00000000
[20183.205649] Call Trace:
[20183.205668]  __schedule+0x293/0x720
[20183.205672]  schedule+0x33/0xa0
[20183.205675]  schedule_timeout+0x1d3/0x320
[20183.205684]  ? __blk_mq_delay_run_hw_queue+0x107/0x160
[20183.205687]  ? blk_mq_run_hw_queue+0x56/0x100
[20183.205690]  wait_for_completion+0xba/0x140
[20183.205696]  ? wake_up_q+0x80/0x80
[20183.205704]  st_do_scsi.constprop.29+0x37f/0x420 [st]
[20183.205707]  st_int_ioctl+0x28f/0xf80 [st]
[20183.205711]  ? st_int_ioctl+0x28f/0xf80 [st]
[20183.205714]  st_ioctl+0x6b4/0x1770 [st]
[20183.205721]  ? _copy_to_user+0x26/0x30
[20183.205728]  ? cp_new_stat+0x152/0x180
[20183.205732]  do_vfs_ioctl+0xa9/0x640
[20183.205735]  ? __do_sys_newfstat+0x44/0x70
[20183.205738]  ksys_ioctl+0x75/0x80
[20183.205740]  __x64_sys_ioctl+0x1a/0x20
[20183.205747]  do_syscall_64+0x57/0x190
[20183.205749]  entry_SYSCALL_64_after_hwframe+0x44/0xa9
[20183.205753] RIP: 0033:0x7fc44fdca6d7
[20183.205777] Code: Bad RIP value.
[20183.205779] RSP: 002b:00007ffc346c4f78 EFLAGS: 00000246 ORIG_RAX: 0000000000000010 [20183.205781] RAX: ffffffffffffffda RBX: 00007ffc346c5802 RCX: 00007fc44fdca6d7 [20183.205783] RDX: 00007ffc346c4f80 RSI: 0000000040086d01 RDI: 0000000000000003 [20183.205784] RBP: 00007ffc346c5802 R08: 0000000000000000 R09: 0000000000000000 [20183.205785] R10: 0000000000000000 R11: 0000000000000246 R12: 00005578d705fcf0 [20183.205787] R13: 00007ffc346c50a0 R14: 0000000000000000 R15: 0000000000000000
[20185.674286] st 4:0:6:0: [st0] Sense Key : Medium Error [current]
[20185.674291] st 4:0:6:0: [st0] Add. Sense: Excessive write errors

If I reboot the system, tape drive works from dom0, but I get the above message from domu. I guess there should be some kind of fine-tuning available for pci passthrough?

I admint the pci device is an old one, it does not even supports function level reset:
29:01.0 SCSI storage controller: Adaptec AIC-7892A U160/m (rev 02)
        Subsystem: Adaptec 29160 Ultra160 SCSI Controller
Control: I/O- Mem+ BusMaster+ SpecCycle- MemWINV+ VGASnoop- ParErr+ Stepping- SERR+ FastB2B- DisINTx- Status: Cap+ 66MHz+ UDF- FastB2B+ ParErr- DEVSEL=medium >TAbort- <TAbort- <MAbort- >SERR- <PERR- INTx-
        Latency: 64 (10000ns min, 6250ns max), Cache Line Size: 64 bytes
        Interrupt: pin A routed to IRQ 16
        BIST result: 00
        Region 0: I/O ports at 1000 [disabled] [size=256]
        Region 1: Memory at 97900000 (64-bit, non-prefetchable) [size=4K]
        Expansion ROM at 97920000 [disabled] [size=128K]
        Capabilities: [dc] Power Management version 2
Flags: PMEClk- DSI- D1- D2- AuxCurrent=0mA PME(D0-,D1-,D2-,D3hot-,D3cold-)
                Status: D0 NoSoftRst- PME-Enable- DSel=0 DScale=0 PME-
        Kernel driver in use: aic7xxx
        Kernel modules: aic7xxx


These io-specific functions are supported by my server:


(XEN) I/O virtualisation disabled
(XEN) ENABLING IO-APIC IRQs
(XEN)  -> Using new ACK method
(XEN) Allocated console ring of 16 KiB.
(XEN) VMX: Supported advanced features:
(XEN)  - APIC MMIO access virtualisation
(XEN)  - APIC TPR shadow
(XEN)  - Extended Page Tables (EPT)
(XEN)  - Virtual-Processor Identifiers (VPID)
(XEN)  - Virtual NMI
(XEN)  - MSR direct-access bitmap
(XEN) HVM: ASIDs enabled.
(XEN) VMX: Disabling executable EPT superpages due to CVE-2018-12207
(XEN) HVM: VMX enabled
(XEN) HVM: Hardware Assisted Paging (HAP) detected
(XEN) HVM: HAP page sizes: 4kB, 2MB

[ 0.000000] DMI: IBM IBM System x3400 M3 Server -[7379KTG]-/69Y4356, BIOS -[Y4E159AUS-1.14]- 05/06/2013




2020. 09. 28. 10:36 keltezéssel, Niels Dettenbach írta:
Am Freitag, 25. September 2020, 15:20:53 CEST schrieb Éliás Tamás:
My question is, should it be possible to passthrough this tape drive, or
the complete scsi card sitting on the pci (due to it's only aim is to
provide access to the tape), somehow? Are there any specialities?
hmm,
if just one DomU should gain access to that PCI device, PCI passthrough may
work, but if you want to use it from different DomU things may get
complicated, because only one DomU at a time should get access to it. If xen
allows to attach tape scsci devices (never tried it) this may be a way to
instead.

If you want to use it i.e., for a daily/nightly backup of all DomU, PCI
hotplug and PCI attach (or storage device attach/detach iif it works with
tape) may be way to "connect" -> backup -> "disconnect" to the volumes of
each DomU.

I wrote a xenbackup tool (shell scripts) for Dom0 side backup of LVM based
DomU storages (with snapshots) - by default for backup-manager, but it may be
a base to adapt it to your "batch" application with PCI passthrough and some
ssh command to do the backup "from within" the DomUs if you need that.

https://www.syndicat.com/open_source/projekte/xenbackup/
https://github.com/nielsd/xen-host-allbackup

you would have to adapt the snaps_backup_mount / snaps_backup_umount scripts

DomUs/storages could be configured in:
/etc/xenback_vols



hth,


niels.


--

Éliás Tamás
Thomas Elias

ETIT[nwpro] KFT, Ügyvezető-Hálózatbiztonsági specialista
ETIT[nwpro] Ltd, General Manager-Network security specialist

Tel. HU: +36/30-497-1626
OpenPGP pubkey: http://etit.hu/doc/et-pub.asc

Okleveles mérnök-informatikus (MSC)
Master of Science in Information Technology (MSC)
Licenced Penetration Tester (TM15-047)

Kapcsolat: http://etit.hu/index.php/hu/kapcsolat
Jogi nyilatkozat: http://etit.hu/disclaimer-email-hu.txt
Contact: http://etit.hu/index.php/en/contact
Disclaimer: http://etit.hu/disclaimer-email-en.txt



 


Rackspace

Lists.xenproject.org is hosted with RackSpace, monitoring our
servers 24x7x365 and backed by RackSpace's Fanatical Support®.