XCP-ng

    • Register
    • Login
    • Search
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups

    Attaching USB storage via XOA

    Xen Orchestra
    5
    16
    2426
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • Peek
      Peek last edited by

      I have 2x external USB3 drives I'd prefer passed thru to a specific VM.

      With XCP-ng Center it's quite simple once one is aware of the navigational routes. That being

      • "General > Properties > USB > Attach" once the device has been passed thru, and
      • "Storage > Attach Disk" if not.

      However, it seems undoable via XOA...

      i.e. How would one go about to accomplish the following in XOA:

      • enable passthru for USB device
      • assign USB device to VM

      or

      attach USB storage to VM (without enabling passthru)

      In addition, I also found that the USB devices list and can be attached in XCP-ng Center, yet would not list in XOA ("VM > Disks").

      If they are passed thru and attached to a VM (via XCP-ng center), they then do not reflect within the VM...

      1 Reply Last reply Reply Quote 1
      • olivierlambert
        olivierlambert Vates 🪐 Founder & CEO 🦸 last edited by

        It's because there's not such demands on that so far. But contributions are very welcome 🙂

        Peek K 2 Replies Last reply Reply Quote 0
        • Peek
          Peek @olivierlambert last edited by

          @olivierlambert I wouldn't know where to start 😳

          1 Reply Last reply Reply Quote 1
          • olivierlambert
            olivierlambert Vates 🪐 Founder & CEO 🦸 last edited by

            You can already write a spec, and even also use our "inspector" to see exactly what commands are done by XCP-ng Center, so we just have to know which one to use 🙂 https://github.com/vatesfr/xapi-inspector
            Actually, it's a non-negligible part of the work (and also test the branch after we do it).

            Before investing time doing that in the UI, we'll first implement it via xo-cli.

            About the proxy,

            1 Reply Last reply Reply Quote 0
            • K
              kevnich2 @olivierlambert last edited by

              @olivierlambert
              Is there somewhere to create a request for this feature? I understand it's definitely not typical but situations that require a VM/Instance to have a USB security key, external USB devices, etc are still out there and it would certainly be that niche case that would help give XCP-NG/Xen Orchestra the added edge in this capability.

              Thankfully this is possible through XCP-NG Center but I also don't know how long this will be a viable product in that it doesn't seem to have much support behind it and I have a particular situation that requires a VM to have a usb key for a software license key and at first had to eliminate this as a possibility to even use until I stumbled upon this.

              1 Reply Last reply Reply Quote 0
              • olivierlambert
                olivierlambert Vates 🪐 Founder & CEO 🦸 last edited by

                Same message, if you tell us which commands are used exactly and how do you imagine it, that might help to get a faster integration 🙂

                K 2 Replies Last reply Reply Quote 0
                • K
                  kevnich2 @olivierlambert last edited by

                  @olivierlambert
                  I have no idea what commands are actually being used, other than the steps inside XCP-Center that I do on the host and then inside the instance itself. I don't mind needing to use XCP-NG Center for this one specific task or setting, I'm just concerned that won't always be available to use as the years go on as opposed to Xen Orchestra.

                  1 Reply Last reply Reply Quote 0
                  • K
                    kevnich2 @olivierlambert last edited by

                    @olivierlambert
                    If there's a way to capture the commands being sent, I would be happy to undo the USB pass-through and then go through it again under Center? I just started XCP-NG and XOA in the past few months so I'm definitely new.

                    1 Reply Last reply Reply Quote 0
                    • olivierlambert
                      olivierlambert Vates 🪐 Founder & CEO 🦸 last edited by

                      That's exactly what I wrote originally. You need to setup https://github.com/vatesfr/xapi-inspector and connect your XCP-ng Center to it. This will intercept all calls 🙂

                      rlyons20 1 Reply Last reply Reply Quote 0
                      • rlyons20
                        rlyons20 @olivierlambert last edited by

                        @olivierlambert I actually have this need too, but it's not for USB storage. I'm running HomeAssistant on a VM, and I'd like to passthrough my Zigbee and Zwave USB devices.

                        Here is the xenserver doc on the topic: https://support.citrix.com/article/CTX235042

                        I think it actually includes the cli commands.

                        Hopefully that's helpful!

                        1 Reply Last reply Reply Quote 0
                        • olivierlambert
                          olivierlambert Vates 🪐 Founder & CEO 🦸 last edited by

                          We need the XAPI commands 🙂 Again, if you want this to be done at some point, we need more spec (because it means less time to actually develop)

                          rlyons20 1 Reply Last reply Reply Quote 0
                          • rlyons20
                            rlyons20 @olivierlambert last edited by

                            @olivierlambert unfortunately, I can't get the xe pusb-list command to return my USB devices, even though I see them with dmesg.

                            So, I may have bigger problems here...

                            rlyons20 1 Reply Last reply Reply Quote 0
                            • rlyons20
                              rlyons20 @rlyons20 last edited by rlyons20

                              @rlyons20 soooo... xe pusb-list only exposes STORAGE devices. I verified by plugging in a USB thumb drive, and that shows up.

                              So, my use case of running HomeAssistant as a VM with Zigbee/Zwave USB devices is probably dead in the water.

                              That's disappointing...

                              1 Reply Last reply Reply Quote 0
                              • olivierlambert
                                olivierlambert Vates 🪐 Founder & CEO 🦸 last edited by

                                You might modify the filter to get your dongle detected 🙂

                                1 Reply Last reply Reply Quote 0
                                • G
                                  gpoole last edited by

                                  I wrote a script to set up USB device passthrough for a specific device by name to a specific VM by name in the same basic way the XCP-ng Centre UI does it when you follow the steps described in the original post. Here's the script: https://gist.github.com/gpoole/c89807e9de9cb5c87bbcc2da27e0c3e4

                                  Are those the commands you're looking for @olivierlambert?

                                  Either way hopefully useful to anyone who wants to do this without using XCP-ng Centre. I've found it needs to be done every boot, so the script is intended to be something I can quickly SSH in and run. I'm sure it could be automated properly but works for me.

                                  1 Reply Last reply Reply Quote 0
                                  • olivierlambert
                                    olivierlambert Vates 🪐 Founder & CEO 🦸 last edited by

                                    Thanks for the commands. I just find it weird you need to do it at each boot, I don't remember having to do it here 🤔

                                    1 Reply Last reply Reply Quote 0
                                    • First post
                                      Last post