VM crashes on USB-to-SATA Adapter removal

FaySmash

New Member
Feb 12, 2022
14
7
3
26
Hi there, as the title says my VMs (tested with a TrueNAS SCALE and Win 10 VM) are crashing when I disconnect my USB-to-SATA Adapter connected HDD.

Logs:

Code:
Windows 10
Jun 18 12:33:59 pve kernel: usb 4-4: USB disconnect, device number 8
Jun 18 12:34:01 pve QEMU[4046718]: kvm: libusb_release_interface: -4 [NO_DEVICE]
Jun 18 12:34:03 pve kernel: usb 4-4: new SuperSpeed USB device number 9 using xhci_hcd
Jun 18 12:34:03 pve kernel: usb 4-4: New USB device found, idVendor=174c, idProduct=55aa, bcdDevice= 1.00
Jun 18 12:34:03 pve kernel: usb 4-4: New USB device strings: Mfr=2, Product=3, SerialNumber=1
Jun 18 12:34:03 pve kernel: usb 4-4: Product: USB3-SATA-Device
Jun 18 12:34:03 pve kernel: usb 4-4: Manufacturer: CnMemory
Jun 18 12:34:03 pve kernel: usb 4-4: SerialNumber: 123456789012
Jun 18 12:34:03 pve kernel: usb-storage 4-4:1.0: USB Mass Storage device detected
Jun 18 12:34:03 pve kernel: usb-storage 4-4:1.0: Quirks match for vid 174c pid 55aa: 400000
Jun 18 12:34:03 pve kernel: scsi host6: usb-storage 4-4:1.0
Jun 18 12:34:03 pve QEMU[4046718]: kvm: ../hw/usb/host-libusb.c:899: usb_host_ep_update: Assertion `alt < conf->interface[i].num_altsetting' failed.
Jun 18 12:34:03 pve kernel:  zd16: p1 p2 p3 p4


TrueNAS SCALE
Jun 18 12:58:53 pve kernel: usb 4-4: USB disconnect, device number 10
Jun 18 12:58:53 pve QEMU[166682]: kvm: libusb_release_interface: -4 [NO_DEVICE]
Jun 18 12:58:56 pve kernel: usb 4-4: new SuperSpeed USB device number 11 using xhci_hcd
Jun 18 12:58:56 pve kernel: usb 4-4: New USB device found, idVendor=174c, idProduct=55aa, bcdDevice= 1.00
Jun 18 12:58:56 pve kernel: usb 4-4: New USB device strings: Mfr=2, Product=3, SerialNumber=1
Jun 18 12:58:56 pve kernel: usb 4-4: Product: USB3-SATA-Device
Jun 18 12:58:56 pve kernel: usb 4-4: Manufacturer: CnMemory
Jun 18 12:58:56 pve kernel: usb 4-4: SerialNumber: 123456789012
Jun 18 12:58:56 pve kernel: usb-storage 4-4:1.0: USB Mass Storage device detected
Jun 18 12:58:56 pve kernel: usb-storage 4-4:1.0: Quirks match for vid 174c pid 55aa: 400000
Jun 18 12:58:56 pve kernel: scsi host6: usb-storage 4-4:1.0
Jun 18 12:58:57 pve kernel: scsi 6:0:0:0: Direct-Access     CnMemory USB3-SATA-Device 0    PQ: 0 ANSI: 6
Jun 18 12:58:57 pve kernel: sd 6:0:0:0: Attached scsi generic sg6 type 0
Jun 18 12:58:57 pve kernel: sd 6:0:0:0: [sdg] Media removed, stopped polling
Jun 18 12:58:57 pve kernel: sd 6:0:0:0: [sdg] Attached SCSI removable disk
Jun 18 12:58:57 pve QEMU[166682]: kvm: ../hw/usb/host-libusb.c:899: usb_host_ep_update: Assertion `alt < conf->interface[i].num_altsetting' failed.
Jun 18 12:58:57 pve kernel:  zd32: p1 p2


I guess the important part is Assertion `alt < conf->interface[i].num_altsetting' failed, which leads to the crash. Part of the problem might be that when the USB-to-SATA Adapter loses connection to the HDD, it disconnects form the host and immediately reconnects with as a new USB device. It doesn't matter if I passthrough the USB device or the USB port and it doesn't happen with simple USB flash drives.

All help is greatly appreciated!

Kernel Version Linux 5.15.107-2-pve #1 SMP PVE 5.15.107-2 (2023-05-10T09:10Z)
PVE Manager Version pve-manager/7.4-13/46c37d9c
 
Last edited:
does it happen when you physically remove the adapter from the server, or when you hot-unplug it via the webui?

does it also happen with other devices?

i tried here to reproduce with various usb sticks (no sata-to-usb bridge though) and this made no problems...

also could you post the exact versions (pveversion -v) and the vm configs ?( qm config ID )
 
  • Like
Reactions: FaySmash
does it happen when you physically remove the adapter from the server, or when you hot-unplug it via the webui?

does it also happen with other devices?

i tried here to reproduce with various usb sticks (no sata-to-usb bridge though) and this made no problems...

also could you post the exact versions (pveversion -v) and the vm configs ?( qm config ID )
This does only happen when I physically remove the HDD from the HotSwap bay with the USB-to-SATA Adapter attached, not when it's hot-unplugged in the webui.

This doesn't happen with any other device I tried (an USB Stick, keyboard and an USB-to-SATA adapter without auxiliary 12V power).

I think the main problem is either an unsupported function of the adapter (num_altsetting) or the rapid disconnect and reconnect after the HDD was ejected.

I'm using this adapter: https://www.amazon.de/dp/B01K22TZ3I

proxmox-ve: 7.4-1 (running kernel: 5.15.107-2-pve)
pve-manager: 7.4-13 (running version: 7.4-13/46c37d9c)
pve-kernel-5.15: 7.4-3
pve-kernel-5.15.107-2-pve: 5.15.107-2
pve-kernel-5.15.107-1-pve: 5.15.107-1
pve-kernel-5.15.30-2-pve: 5.15.30-3
ceph-fuse: 15.2.16-pve1
corosync: 3.1.7-pve1
criu: 3.15-1+pve-1
glusterfs-client: 9.2-1
ifupdown2: 3.1.0-1+pmx4
ksm-control-daemon: 1.4-1
libjs-extjs: 7.0.0-1
libknet1: 1.24-pve2
libproxmox-acme-perl: 1.4.4
libproxmox-backup-qemu0: 1.3.1-1
libproxmox-rs-perl: 0.2.1
libpve-access-control: 7.4.1
libpve-apiclient-perl: 3.2-1
libpve-common-perl: 7.4-2
libpve-guest-common-perl: 4.2-4
libpve-http-server-perl: 4.2-3
libpve-rs-perl: 0.7.7
libpve-storage-perl: 7.4-3
libspice-server1: 0.14.3-2.1
lvm2: 2.03.11-2.1
lxc-pve: 5.0.2-2
lxcfs: 5.0.3-pve1
novnc-pve: 1.4.0-1
proxmox-backup-client: 2.4.2-1
proxmox-backup-file-restore: 2.4.2-1
proxmox-kernel-helper: 7.4-1
proxmox-mail-forward: 0.1.1-1
proxmox-mini-journalreader: 1.3-1
proxmox-offline-mirror-helper: 0.5.1-1
proxmox-widget-toolkit: 3.7.3
pve-cluster: 7.3-3
pve-container: 4.4-4
pve-docs: 7.4-2
pve-edk2-firmware: 3.20230228-4~bpo11+1
pve-firewall: 4.3-4
pve-firmware: 3.6-5
pve-ha-manager: 3.6.1
pve-i18n: 2.12-1
pve-qemu-kvm: 7.2.0-8
pve-xtermjs: 4.16.0-2
qemu-server: 7.4-3
smartmontools: 7.2-pve3
spiceterm: 3.2-2
swtpm: 0.8.0~bpo11+3
vncterm: 1.7-1
zfsutils-linux: 2.1.11-pve1
 
agent: 1
bios: ovmf
bootdisk: sata0
cores: 16
cpu: host
efidisk0: local-zfs:vm-230-disk-1,efitype=4m,pre-enrolled-keys=1,size=1M
hostpci0: 0000:04:00,pcie=1
hotplug: disk,network,usb
ide2: none,media=cdrom
machine: pc-q35-7.2
memory: 16384
name: Media-PC
net0: virtio=46:31:C1:B2:4E:F7,bridge=vmbr0,firewall=1
numa: 1
onboot: 1
ostype: win10
parent: autoautosnap230620190011
sata0: local-zfs:vm-230-disk-0,size=100G,ssd=1
scsihw: virtio-scsi-pci
smbios1: uuid=aead2443-0751-48b1-912b-c6c468072332
sockets: 1
startup: order=1
usb0: host=4-4
vmgenid: affdab19-bb67-4fb1-8736-c0b310cb96d9


boot: order=scsi0;ide2
cores: 8
cpu: host
ide2: none,media=cdrom
memory: 24576
name: truenas
net0: virtio=B6:B4:9F:57:EC:EA,bridge=vmbr0,firewall=1
numa: 1
onboot: 1
ostype: l26
parent: autoautosnap220714200042
scsi0: local-zfs:vm-210-disk-0,size=32G,ssd=1
scsi1: /dev/disk/by-id/ata-Samsung_SSD_860_EVO_1TB_S3Z9NY0M814795M,backup=0,size=976762584K,ssd=1
scsi2: /dev/disk/by-id/ata-WDC_WD8003FFBX-68B9AN0_VDGGN50D,backup=0,size=7814026584K
scsi3: /dev/disk/by-id/ata-WDC_WD8003FFBX-68B9AN0_VDGGS8GD,backup=0,size=7814026584K
scsi4: /dev/disk/by-id/ata-WDC_WD8003FFBX-68B9AN0_VDGGZ8ND,backup=0,size=7814026584K
scsi5: /dev/disk/by-id/ata-WDC_WD8003FFBX-68B9AN0_VGKY1GZG,backup=0,size=7814026584K
scsi6: /dev/disk/by-id/ata-WDC_WD8003FFBX-68B9AN0_VRG6K62K,backup=0,size=7814026584K
scsihw: virtio-scsi-pci
smbios1: uuid=9721471d-28b7-4b7a-9671-393cdd0206a3
sockets: 1
startup: order=1,up=100
tablet: 0
usb0: host=4-4
vmgenid: 402b049d-61ed-4916-b935-27ea73b5e7d0


(where usb0: host=4-4 is the pass-through USB device)

1687281753637.png
 
I had to use this adapter because I had no more SATA ports or PCI-E slots left on my board. Everything works fine, except the HDD disconnect.
Setup:
 

Attachments

  • 1687281814027.jpeg
    1687281814027.jpeg
    713.6 KB · Views: 11
The LINDY 43119 USB 3.0 to SATA and Silverstone SST-EP02B USB 3.0 to SATA Adapter don't have this problem, it's isolated to the CSL one using the ASM1153E chipset. I'll consider this case as solved, because it just seems to affect a very specific hardware combination.
 

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!