Configuring LVM filters for compute nodes

Configure LVM filters on each compute node according to its operating system disk layout. The choice does not depend on whether VM disks or guest operating systems use LVM. Improper LVM filter configuration on compute nodes can lead to issues during migration or upgrade operations.

  1. Determine whether the compute node OS uses LVM by running:

    # lsblk
    # vgs
    # lvs
  2. Configure the appropriate LVM filter:

    • If root and other system partitions are mounted from regular disk partitions and the compute node operating system does not use LVM, reject all devices under /dev/mapper/. This prevents LVs created on multipath-backed compute volumes from being activated on compute nodes.

      devices {
          filter = [ "r|/dev/mapper/|" ]
          global_filter = [ "r|/dev/mapper/|" ]
      }
      

      This configuration rejects any device under /dev/mapper/ and ensures that compute nodes ignore multipath-backed volumes entirely.

    • If the compute node OS uses LVM for root or other system volumes, for example, if the root filesystem is mounted from /dev/mapper/<vg>-<lv>, explicitly allow the system disk by using a persistent disk identifier and reject all multipath devices.

      Find the persistent identifier:

      # ls -l /dev/disk/by-id/

      Configure the filters:

      devices {
          filter = [ "a|/dev/disk/by-id/<disk-id>.*|", "r|/dev/mapper/|" ]
          global_filter = [ "a|/dev/disk/by-id/<disk-id>.*|", "r|/dev/mapper/|" ]
      }

      Replace <disk-id> with the actual identifier of the compute node system disk. This ensures the system LVs activate correctly on the compute node while all multipath devices remain rejected.

  3. Disable volume group autoactivation by adding the following to the activation section of /etc/lvm/lvm.conf:

    activation {
        auto_activation_volume_list = []
    }