Take the 2-minute tour ×
Server Fault is a question and answer site for system and network administrators. It's 100% free, no registration required.

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).

share|improve this question

1 Answer 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.

share|improve this answer
    
It is also possible to write custom udev rules to automate attaching/detaching disk to VM –  DukeLion May 29 '12 at 10:50

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.