Uploaded image for project: 'RHEL'
  1. RHEL
  2. RHEL-118871

[RHEL10] Can not split LV from VG with cachevol

Linking RHIVOS CVEs to...Migration: Automation ...RHELPRIO AssignedTeam ...SWIFT: POC ConversionSync from "Extern...XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • Icon: Normal Normal
    • rhel-10.2
    • rhel-10.0
    • lvm2
    • None
    • lvm2-2.03.35-1.el10
    • No
    • Moderate
    • rhel-storage-lvm
    • None
    • False
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • Pass
    • None
    • Unspecified
    • Unspecified
    • Unspecified
    • None

      vgsplit: fix check for not splitting an LV between two VGs for cachevol

      When cachevol was used for the cache LV, the check for not splitting an
      LV between two VGs was incorrect, not allowing to split the VG in cases
      it should have been possible.

      For example, splitting a VG which contains the cache LV with cachevol
      only on two devices (sda and sdb here) and leaving third device completely
      unused (sdc here) should clearly allow us to split it into a new VG:

      ❯ vgcreate vg /dev/sd

      {a..c}
      Physical volume "/dev/sda" successfully created.
      Physical volume "/dev/sdb" successfully created.
      Physical volume "/dev/sdc" successfully created.
      Volume group "vg" successfully created

      ❯ lvcreate -l2 -n main vg /dev/sda
      Logical volume "main" created.

      ❯ lvcreate -l2 -n fast vg /dev/sdb
      Logical volume "fast" created.

      ❯ lvconvert -y --type cache --cachevol fast vg/main
      Logical volume vg/main is now cached.

      ❯ lvs -a -o name,devices vg
      lv_name devices
      [fast_cvol] /dev/sdb(0)
      main main_corig(0)
      [main_corig] /dev/sda(0)

      ❯ lsblk -o name /dev/sd{a..c}

      NAME
      sda
      └─vg-main_corig
      └─vg-main
      sdb
      └─vg-fast_cvol
      ├─vg-fast_cvol-cdata
      │ └─vg-main
      └─vg-fast_cvol-cmeta
      └─vg-main
      sdc

      Before this patch:

      ❯ vgsplit vg vg2 /dev/sdc
      Logical volume vg/main must be inactive.

      ❯ vgchange -an vg
      0 logical volume(s) in volume group "vg" now active

      ❯ vgsplit vg vg2 /dev/sdc
      Can't split LV main between two Volume Groups

      With this patch applied:

      ❯ vgsplit vg vg2 /dev/sdc
      New volume group "vg2" successfully split from "vg"

              cmarthal@redhat.com Corey Marthaler
              mcsontos@redhat.com Marian Csontos
              lvm-team lvm-team
              Corey Marthaler Corey Marthaler
              Votes:
              0 Vote for this issue
              Watchers:
              7 Start watching this issue

                Created:
                Updated: