New to Proxmox - Difficulty with USB passthrough reliability

  • Thread starter Thread starter aluminumpork
  • Start date Start date
A

aluminumpork

Guest
I've been using Proxmox for about a month now and have been loving it so far. I've been slowly migrating our existing file server over to a Proxmox VM running Ubuntu. We have two external Maxtor USB drives that are swapped in and out every couple of weeks. A cronjob on the file server does nightly backups to this drive. My client does this on his own, whenever he wants without notifying me. I had my udev rules setup to automatically symlink any USB drive with the vendor "Maxtor" to create an additional symlink to /dev/usb_backup and then run a mount command to /mnt/archive. This setup worked great for around 4 years.

I've been trying to get this same setup working with my Proxmox VM using USB passthrough. I have the two USB hosts in the qemu configuration (101.conf) and the file reads as follows:

Code:
name: destiny
ide2: local:iso/ubuntu-10.10-server-amd64.iso,media=cdrom
bootdisk: ide0
ostype: l26
ide0: local:101/vm-101-disk-1.raw
memory: 4096
onboot: 1
sockets: 1
vlan0: e1000=8E:D9:96:96:C1:BE
hostusb: 0d49:7200,0bc2:50a1

This seems to work, especially if I reset the VM. The usb host shows up (via lsusb), the udev rules run and the mount happens. However, if I unplug the drive and plug it back in again (or the other drive), no events happen. Using 'udevadm monitor' confirms this. If I run 'lsusb' after re-plugging the drive in, it takes 3-4 seconds to run and displays the list (not including the Maxtor drive), but the udev rules run. If I run 'lsusb' again, it now shows the Maxtor.

Any thoughts on the best way to accomplish what I need, or why this issue is happening? The same behavior happens using the qm monitor 'usb_add' command. The command does not trigger any usb 'events' in the VM until the VM runs the 'lsusb' command.

Thanks in advance for any assistance. It's greatly appreciated.

[edit]Oh, I'm running the 2.6.32-4-pve kernel[/edit]
 
Last edited by a moderator:
Apologize for the *bump*. Anyone have any thoughts on this? Thanks.
 
Well, I ended up taking a different tact to accomplish what I needed (admittedly, this probably should have been the first thing I tried).

I simply setup my udev rules on the Proxmox host itself, symlinking the drive to /dev/usb_backup and then mounting it to /mnt/archive. From there I added the following to my fileserver VM:

Code:
virtio0: volume=/dev/usb_backup

This essentially makes my USB drive available as "vda" in my VM. I then added an fstab entry on the VM mounting /dev/vda to /mnt/usb_backup.

Transfer speeds are MUCH faster now and the reliability I was expecting seems to be there now. Any potential issues anyone sees with this solution? Should I have not used a virtio volume? I guess I didn't know what differences there would be between using ide, scsi or virtio.
 
...
I simply setup my udev rules on the Proxmox host itself, symlinking the drive to /dev/usb_backup and then mounting it to /mnt/archive. From there I added the following to my fileserver VM:
...
This essentially makes my USB drive available as "vda" in my VM. I then added an fstab entry on the VM mounting /dev/vda to /mnt/usb_backup.
...
Hi,
you mount the filesystem on the host and inside the VM? This is very dangerous (without clusterfilesystem). You can easily get dataloss!

Is it not enough to mount the filesystem inside the VM?

Udo
 
Whoops! I'm not sure why I did it that way. You are right, I had no reason to mount it in both. I'm having udev only add the symlink 'usb_backup' now. Thanks for the reminder.

Now, I have yet to test what happens when the USB drive gets unplugged. How will qemu handle it?