1

I have a SATA hot-swap cage in my Linux box. Is it possible to pass-through the SATA disk which is injected in that cage to a KVM guest? I have multiple disks however the SATA port will be always the same.

Ideally it should work just as without virtualization which means I can start the VM if no drive is present, can add it later without any manual intervention and remove it at any time (provided of course that OS does not access the drive anymore).

1 Answer 1

1

You cannot pass-through inexistent device. But you can dynamically attach and detach it when you plug it in and out. You can use libvirt's virsh attach-disk/detach disk to simplify this.

I don't think there is a ready script doing that on VM start/stop, but it's not that hard to write one.

1
  • It is also possible to write custom udev rules to automate attaching/detaching disk to VM
    – DukeLion
    May 29, 2012 at 10:50

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .