1

I have Intel Software RAID (Intel® VROC) configured on my Red Hat host machine, and I would like to access its status etc within a Debian-based KVM guest VM.

[root@localhost ~]# mdadm --detail-platform mdadm: imsm capabilities not found for controller: /sys/devices/pci0000:00/0000:00:17.0 (type SATA) mdadm: imsm capabilities not found for controller: /sys/devices/pci0000:00/0000:00:19.0 (type SATA) Platform : Intel(R) Virtual RAID on CPU Version : 8.5.0.1096 RAID Levels : raid0 raid1 raid10 Chunk Sizes : 4k 8k 16k 32k 64k 128k 2TB volumes : supported 2TB disks : supported Max Disks : 96 Max Volumes : 2 per array, 24 per controller 3rd party NVMe : supported I/O Controller : /sys/devices/pci0000:9a/0000:9a:00.5 (VMD) NVMe under VMD : /dev/nvme0n1 (S64FNN0X507593) Encryption(Ability|Status): SED|Unencrypted NVMe under VMD : /dev/nvme2n1 (S64FNN0X507591) Encryption(Ability|Status): SED|Unencrypted NVMe under VMD : /dev/nvme1n1 (S64FNN0X507583) Encryption(Ability|Status): SED|Unencrypted I/O Controller : /sys/devices/pci0000:c6/0000:c6:00.5 (VMD) [root@localhost ~]# sudo mdadm --detail /dev/md126 /dev/md126: Container : /dev/md/imsm, member 0 Raid Level : raid1 Array Size : 890806272 (849.54 GiB 912.19 GB) Used Dev Size : 890806272 (849.54 GiB 912.19 GB) Raid Devices : 2 Total Devices : 2 State : active Active Devices : 2 Working Devices : 2 Failed Devices : 0 Consistency Policy : resync UUID : 991e034f:faaee5eb:fc8c7c50:8482898a Number Major Minor RaidDevice State 1 259 0 0 active sync /dev/nvme0n1 0 259 2 1 active sync /dev/nvme1n1 

While I understand I can use PCI passthrough to directly expose the RAID controller to the guest, I am concerned about losing access to the RAID from the host.

One approach I’ve considered is using file sharing to dump all the required RAID data into a shared file, which can then be mounted by the VM. However, this method doesn’t feel flexible enough for my needs since, after rebooting the VM, I would need to manually remount the file. I also prefer not to add mount entries in the VM’s /etc/fstab.

Is there a better way to achieve this?

2 Answers 2

2

Have a monitoring system record the status of the host array, and make that data accessible to the guest.

Several existing monitoring scripts know how to check Linux md arrays. mdadm commands or /proc/mdstat. At least a couple essential metrics, like state or if the array is redundant.

If instead you need some custom mdadm commands, script that. Allow a specific user group to ssh in and run it, from the guest to the host. This breaks the usual isolation desired between guests and hosts for security reasons. But running the commands on the host is better than letting the guest control the host's disks.

1
0

I recently acquired the Virtiofs tool to enable file sharing between the RHEL host and KVM guest.

https://libvirt.org/kbase/virtiofs.html

Virt-Manager https^://libvirt.org/kbase/virtiofs.html

Steps to Share Files Between KVM Host and Debian Guest Using Virtiofs

  1. Enable XML Editing in Virt-Manager
  2. Edit Virtual Machine Settings
  3. Enable Shared Memory
  4. Add a Filesystem Device
  5. Configure the Shared Folder
    • Source Path: Shared folder on the host machine.
    • Target Path: Desired folder name for the shared folder on the guest.
  6. Start the VM
  7. Install virtiofs package on the guest VM
    sudo apt-get install virtiofsd (Debian) 
  8. Create a mount point for the shared folder
    sudo mkdir -p /mnt/shared 
    Example: /mnt/shared
  9. Mount the shared folder using virtiofs
    sudo mount -t virtiofs host_shared /mnt/shared 

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.