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

storage: Allow configuring max and min volume sizes for extra idempotency

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

    • Add max and min volume sizes for extra idempotency
    • 100% To Do, 0% In Progress, 0% Done
    • rhel-system-roles
    • False
    • Hide

      None

      Show
      None
    • Unspecified
    • Unspecified
    • Unspecified

      Description

      I need to configure a LV with size 10 GB minimum using storage system role.

      In the case, where LV size is smaller than 10GB, I want the role to extend the LV.

      In the case, where my LV's size is larger than 10GB, I want the role to ensure it and result in unchanged state.

      Currently, this is not possible, you can only specify the exact size, not min or max size.

      I found a manual workaround to this issue - get the current size and calculate if it's larger than the expected size or not, based on this calculation set the size within the role variable. Variable `hpc_rootlv_size` equals `10G` in this case:

       

      - name: Get current LV size of {{ hpc_rootlv_name }}
        vars:
          __hpc_lv: /dev/mapper/{{ hpc_rootvg_name }}-{{ hpc_rootlv_name }}
        command: lvs --noheadings --units g --nosuffix -o lv_size {{ __hpc_lv }}
        register: __hpc_rootlv_size_cmd
        changed_when: false
      - name: Configure storage
        include_role:
          name: linux-system-roles.storage
        vars:
          hpc_rootlv_size_expected: >-
            {{ hpc_rootlv_size | regex_replace('[^0-9]', '') | int }}
          hpc_rootlv_size_curr: "{{ __hpc_rootlv_size_cmd.stdout | int }}"
          __hpc_rootlv_size: >-
            {{ (hpc_rootlv_size_expected > hpc_rootlv_size_curr)
            | ternary(hpc_rootlv_size, hpc_rootlv_size_curr ~ "G") }}
          storage_pools:
            - name: "{{ hpc_rootvg_name }}"
              grow_to_fill: true
              volumes:
                - name: "{{ hpc_rootlv_name }}"
                  size: "{{ __hpc_rootlv_size }}"
                  mount_point: "{{ hpc_rootlv_mount }}"

       

       

      I would like the role to provide a way to set min_size and max_size for volumes so that it works idempotently.

      What SSTs and Layered Product teams should review this?

      rhel_sst_system_roles

      storage team

              rmeggins@redhat.com Richard Megginson
              spetros@redhat.com Sergei Petrosian
              Richard Megginson Richard Megginson
              David Jez David Jez
              Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

                Created:
                Updated: