Red Hat Bugzilla – Bug 1006369
Don't autostart (or simple start) an instance when raw device is already mounted
Last modified: 2016-04-10 10:44:11 EDT
Description of problem:
When autostarting an instance make sure that the devices used in the VM are not mounted on the host.
Version-Release number of selected component (if applicable):
Steps to Reproduce:
1. stop a machine for inspection
2. mount a device on the host for inspection
3. libvirtd gets restarted (either by monit or by hand)
4. VM mounts the device which does not hand concurent mounts (ext4 for example)
kernel oops in the VM, damaged data on the disk device.
the VM should not start and log a warning.
Sorry for the lack of a timely response, but Libvirt isn't really in the business of doing this type of checking... we don't even check if disk images are in use by other VMs which is the more likely case I suspect. Look into virtlockd daemon, it may be able to do what you want