[SOLVED] kvm: simulated disk removal via virsh
Posted: 2013/03/22 18:08:47
... or, another way of asking: how do I remove an IDE disk device from a domain using virsh?
I'm trying to review processes for recovering from disk failures. While I know KVM isn't exactly like physical boxes, it's boatloads cheaper than working on expensive production systems.
What I"m trying to simulate is a disk drive going south. On a physical box, I'd just go yank the thing out of the chassis. On the KVM, I'm having issues:
[code]
# virsh detach-disk guest /var/lib/libvirt/images/guest\-2.img
error: Failed to detach disk
error: unsupported configuration: This type of disk cannot be hot unplugged
[/code]
I got that when the domain was running. I shut it down and reran it and got:
[code]
# virsh detach-disk guest /var/lib/libvirt/images/guest\-2.img
error: Failed to detach disk
error: Requested operation is not valid: cannot do live update a device on inactive domain
[/code]
Interesting. I can't kill the disk when the system's live or dead... So, I'm apparently missing something.
I can remove the device through the virt-manager gui, but I'm working on this remotely and X11 is a pig over the net.
Can anyone clue me in on what I'm missing or how I could force a disk failure. Extra helping of eternal gratitude if there's a way to do it while the system's live so I can record lvm and mdadm errors...
Thanks.
Doug O'Leary
I'm trying to review processes for recovering from disk failures. While I know KVM isn't exactly like physical boxes, it's boatloads cheaper than working on expensive production systems.
What I"m trying to simulate is a disk drive going south. On a physical box, I'd just go yank the thing out of the chassis. On the KVM, I'm having issues:
[code]
# virsh detach-disk guest /var/lib/libvirt/images/guest\-2.img
error: Failed to detach disk
error: unsupported configuration: This type of disk cannot be hot unplugged
[/code]
I got that when the domain was running. I shut it down and reran it and got:
[code]
# virsh detach-disk guest /var/lib/libvirt/images/guest\-2.img
error: Failed to detach disk
error: Requested operation is not valid: cannot do live update a device on inactive domain
[/code]
Interesting. I can't kill the disk when the system's live or dead... So, I'm apparently missing something.
I can remove the device through the virt-manager gui, but I'm working on this remotely and X11 is a pig over the net.
Can anyone clue me in on what I'm missing or how I could force a disk failure. Extra helping of eternal gratitude if there's a way to do it while the system's live so I can record lvm and mdadm errors...
Thanks.
Doug O'Leary