XCP-ng
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Register
    • Login

    Attach a Physical HD to a VM?

    Scheduled Pinned Locked Moved Management
    3 Posts 3 Posters 36 Views 3 Watching
    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.
    • N Offline
      nasheayahu
      last edited by

      Afternoon, I converted my Red hat 10 desktop server/workstation to the XCP-ng, it had:

      • 1x NVMe SSD 1TB (XCP-ng default install + VMs)
      • 2x SSD 1TB (SR for VMs)
      • 3x WD 2TB (It was used for storage via NFS)

      I want to create a NSF VM to manage those WD 2TB HDs. I'm assuming it possible, any cons doing it this would be welcome, I can not find instructions how to attach a drive to a VM in the XCP-ng docs. I don't want to destroy the data on these drives until I get a storage device to transfer them too.

      The need to do it this way for now is, I don't have the equipment to setup a full blown network infrastructure. So I want to simulate one until I do. The purpose is to learn and master XCP-ng and Networking. The VMs will be simulating servers, so when I get all the needed equipment, I would know how to setup my network infrastructure.

      I have another Redhat 10 server/workstation setup similar and will convert this one a well. It has:

      • 1x NVMe SSD 1TB (default install for XCP-ng + VMs)
      • 2x SSD 500GB (for VMs)
      • 2x ST 2TB (used for storage as well, currently uploading to cloud storage to use for VMs as well)

      I will be managing both XCP-ng severs from another workstation (Windows 10 Pro).

      Thanks for your feedback!

      P dthenotD 2 Replies Last reply Reply Quote 0
      • P Offline
        Pilow @nasheayahu
        last edited by

        @nasheayahu Hi, you could passthrough the controller hosting these disks if its independant of the disks hosting the XCP itself I guess...

        but not really recommended ? perhaps someone has another solution

        1 Reply Last reply Reply Quote 0
        • dthenotD Online
          dthenot Vates 🪐 XCP-ng Team @nasheayahu
          last edited by dthenot

          @nasheayahu Hello,

          I do this with a my homelab disk since I imported it from a physical machine:

          mkdir /srv/NAS
          xe sr-create type=udev sm-config:location=/srv/NAS name-label="NAS Disks"
          

          Then you make a symlink to the device:

          ln -s /dev/sda /srv/NAS/sda #although it might be better to use a stable identifier if you have multiple disks
          xe sr-scan uuid=<UUID of the udev SR>
          

          The disk will appear as a VDI in the SR that you can then plug to a VM.

          I also renamed the VDI [NOSNAP][NOBAK] NAS Drive
          [NOSNAP][NOBAK] instruct XO to not snapshot and export the disk in backups (since it can't).

          It's not passthrough, as in the disk is not directly given to the VM, but tapdisk (the process virtualizing storage) will give access to the whole disk to the guest, so it can mount any FS on it.

          The udevSR is usually used for plugging USB from what I could gather from existing code. But users in homelabs have been using it like this for a while.
          Though you will likely not have native performance level since it's not exactly passthrough.

          1 Reply Last reply Reply Quote 1

          Hello! It looks like you're interested in this conversation, but you don't have an account yet.

          Getting fed up of having to scroll through the same posts each visit? When you register for an account, you'll always come back to exactly where you were before, and choose to be notified of new replies (either via email, or push notification). You'll also be able to save bookmarks and upvote posts to show your appreciation to other community members.

          With your input, this post could be even better 💗

          Register Login
          • First post
            Last post