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

When adding a swap lv on a host built from image builder, the pre-existing rootvg gets removed from the lvm devices

    • None
    • Moderate
    • rhel-sst-system-roles
    • None
    • False
    • Hide

      None

      Show
      None
    • None
    • None
    • None
    • None
    • Bug Fix
    • None

      Description of problem:

      On a host with the following rootvg:

      ```
      [root@rhel9 rex]# vgs
      VG #PV #LV #SN Attr VSize VFree
      rootvg 1 7 0 wz-n 21.00g 0
      ``

      When running this playbook:
      ```

      • name: configure swap
        hosts: "{{ targeted_host }}"

      vars:
      storage_pools:

      • name: swapvg
        disks:
      • /dev/sdb
        volumes:
      • name: swap
        size: 80%
        fs_type: swap
        state: present

      roles:

      • name: redhat.rhel_system_roles.storage

      ```

      The pre-existing rootvg disappears from the lvm devices list.

      The data is kept.

      ```
      [root@rhel9 rex]# vgs
      VG #PV #LV #SN Attr VSize VFree
      swapvg 1 1 0 wz-n <2.00g 408.00m
      [root@rhel9 rex]#
      ```

      Version-Release number of selected component (if applicable):

      redhat.rhel_system_roles.storage 1.21.1

      How reproducible:

      Always

      Steps to Reproduce:
      1.
      2.
      3.

      Actual results:

      The rootvg disappears

      Expected results:

      The swapvg is added together with rootvg

      Additional info:

      The file /etc/lvm/devices/system.devices is missing.

      Workaround:

      Adding a pre_task to create the system.devices file with: vgimportdevices --all - fixes the issue.

      Output after re-running the playbook:

      ```

      1. vgs
        VG #PV #LV #SN Attr VSize VFree
        rootvg 1 7 0 wz-n 21.00g 0
        swapvg 1 1 0 wz-n <2.00g 408.00m
        ```

              vtrefny@redhat.com Vojtěch Trefný
              rhn-gps-gsigrisi Gianfranco Sigrisi (Inactive)
              Vojtěch Trefný Vojtěch Trefný
              rhel-cs-system-management-subsystem-qe Bot rhel-cs-system-management-subsystem-qe Bot
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated:
                Resolved: