I'm running libvirt with QEMU/KVM and I have disk images for the VMs in LVM logical volumes. Naturally, many of the guest VMs use LVM for their disks, too.
partprobe on my hypervisor and it detected all of the VM guest partitions, so now the LVM tools (
lvs, etc.) list all of the guest's LVM entities along with the host's.
Is there a way to remove all of these LVM physical volumes from the host's knowledge (without affecting the guests, of course)? Rebooting the host isn't an option; several of these VMs need to stay running.
In case it helps, here's what the LVM layers look like, more or less:
/dev/sdb1 - host PV | vg_hostname_vms - host VG | +-lv_vm1 - host LV, used as a disk image for vm1 | +-part1 - vm1 boot partition | +-part2 - vm1 PV | | | vg_vm1 - vm1 VG | +-lv_root - vm1 LV - / | +-lv_swap - vm1 LV - swap | +-lv_vm2 - host LV, used as a disk image for vm2 +-part1 - vm1 boot partition +-part2 - vm2 PV | vg_vm2 +-lv_root - vm2 LV - / +-lv_swap - vm2 LV - swap +-lv_home - vm2 LV - /home
Now, when I run
vgs, here's what I see:
VG #PV #LV #SN Attr VSize VFree vg_hostname_vms 1 2 0 wz--n- 10.91t 9.53t vg_vm1 1 2 0 wz--n- 9.76g 0 vg_vm2 1 3 0 wz--n- 97.16g 0
I only want to see the host's volume groups (and only its physical and logical volumes).
I'm running all of this on a Scientific Linux 6.5 host. The guest OSes vary.