attaching a specific usb device to vm
Greetings, I have two identical hdd to usb enclosures connected to a server which run two vms, lets call the foo and goo. I'm looking for the ability to connect a specific hdd to a specific vm, naturally using vendor and device is not possible and using bus+port will provide what I need however it does not persists incase of port change. I saw that using the hooks, libvirt provides the xml to the hook and read it from the output of the hook. I tried adding detection and adding accurate hostdev xml tag to the vm xml and I see it from the output of the hook execution in the prepare stage however, the system boots but the hdd is not visible in guest. the docs reference this feature only for migrate and restore ops, does this means I cannot use it in the prepare stage? if so, is there another way to do what I want? Thanks, Dagg
Sent: Friday, April 10, 2026 at 5:10 PM From: "daggs via Users" <users@lists.libvirt.org> To: users@lists.libvirt.org Subject: attaching a specific usb device to vm
Greetings,
I have two identical hdd to usb enclosures connected to a server which run two vms, lets call the foo and goo. I'm looking for the ability to connect a specific hdd to a specific vm, naturally using vendor and device is not possible and using bus+port will provide what I need however it does not persists incase of port change. I saw that using the hooks, libvirt provides the xml to the hook and read it from the output of the hook. I tried adding detection and adding accurate hostdev xml tag to the vm xml and I see it from the output of the hook execution in the prepare stage however, the system boots but the hdd is not visible in guest.
the docs reference this feature only for migrate and restore ops, does this means I cannot use it in the prepare stage? if so, is there another way to do what I want?
Thanks,
Dagg
I forgot a small but important detail, I'm running both vms in session mode, each as a different user
Greetings
Sent: Saturday, April 11, 2026 at 4:13 AM From: "brent s." <bts@square-r00t.net> To: users@lists.libvirt.org Subject: Re: attaching a specific usb device to vm
use address instead. https://libvirt.org/formatdomain.html#usb-pci-scsi-devices
On Apr 10, 2026 10:10, daggs via Users <users@lists.libvirt.org> wrote: Greetings,
I have two identical hdd to usb enclosures connected to a server which run two vms, lets call the foo and goo. I'm looking for the ability to connect a specific hdd to a specific vm, naturally using vendor and device is not possible and using bus+port will provide what I need however it does >>not persists incase of port change. I saw that using the hooks, libvirt provides the xml to the hook and read it from the output of the hook. I tried adding detection and adding accurate hostdev xml tag to the vm xml and I see it from the output of the hook execution in the prepare stage however, the system boots but the hdd is not visible in guest.
the docs reference this feature only for migrate and restore ops, does this means I cannot use it in the prepare stage? if so, is there another way to do what I want?
Thanks,
Dagg
Thank you for the suggestion, however as I've explained in the initial question, using address is the solution if there is no port change, that isn't my case, the port can change Dagg
A very good escort, worthy of your enjoyment, 100% intimate experience. You are welcome to call Here are what you like, come and watch, absolutely enjoy. https://www.vipnewsonline.com/escorts/thailandescortslist_com~202511
participants (3)
-
brent s. -
daggs -
pijat83406@mypethealh.com