0

I use a snaphost for backup my machines based on KVM

But on one server I can`t make snapshots of one machine

Get a error, I dont how to repair the problem.

Using default stripesize 64.00 KiB.
  WARNING: PV vhB8b0-EeEk-kQIL-Y2Gx-V4uZ-aKx2-ilMglh on /dev/pev2/snap-475-2 was already found on /dev/pev2/vm-475-disk-2.
  WARNING: PV vhB8b0-EeEk-kQIL-Y2Gx-V4uZ-aKx2-ilMglh prefers device /dev/pev2/vm-475-disk-2 because device was seen first.

If run a lvscan

root@pro04:~/backups# lvscan
  WARNING: PV vhB8b0-EeEk-kQIL-Y2Gx-V4uZ-aKx2-ilMglh on /dev/pev2/snap-475-2 was already found on /dev/pev2/vm-475-disk-2.
  WARNING: PV vhB8b0-EeEk-kQIL-Y2Gx-V4uZ-aKx2-ilMglh prefers device /dev/pev2/vm-475-disk-2 because device was seen first.
 ...
ACTIVE            '/dev/pev2/vm-475-disk-1' [25.00 GiB] inherit
ACTIVE            '/dev/pev2/vm-475-disk-2' [25.00 GiB] inherit
ACTIVE            '/dev/pev2/vm-475-disk-3' [25.00 GiB] inherit
ACTIVE            '/dev/pev2/vm-475-disk-4' [25.00 GiB] inherit
abkrim
  • 407
  • 6
  • 18

1 Answers1

1

The affected virtual machine is directly using /dev/vdb virtual device without any protective MBR on it:

[root@kvm475 ~]# pvs -a
  PV            VG  Fmt  Attr PSize   PFree
  /dev/loop0             ---       0      0
  /dev/lvm/root          ---       0      0
  /dev/lvm/swap          ---       0      0
  /dev/vda1              ---       0      0
  /dev/vda2     lvm lvm2 a--  <24,51g     0
  /dev/vdb          lvm2 ---   25,00g 25,00g
  /dev/vdc1     lvm lvm2 a--  <25,00g     0
  /dev/vdd1     lvm lvm2 a--  <25,00g 32,00m

On such a setup the host-side LVM can be confused on what is under it's management opposed on LVs which are managed from/by VMs themselves.

You have two possibilities:

  • use an exclude filter on the host machine to explicitly filter out any unwanted volumes. To accomplish that, you had to edit both the filter and global_filter properties on the host's /etc/lvm/lvm.conffile. For example, use:
    filter = [ "r/pev2/" ]
    global_filter = [ "r/pev2/" ]

WARNING: a wrong filter value can make the system unbootable.

  • do not use "unprotected" PVs inside guests. In other words, do not directly use devices as vdb to create PVs; rather, partition them via MBR/GPT (a "protective MBR") and using partitions to create PVs.
shodanshok
  • 44,038
  • 6
  • 98
  • 162