-
Epic
-
Resolution: Unresolved
-
Major
-
None
-
None
-
Add max and min volume sizes for extra idempotency
-
None
-
rhel-system-roles
-
None
-
False
-
False
-
-
None
-
None
-
None
-
None
-
Unspecified
-
Unspecified
-
Unspecified
-
None
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
- relates to
-
RHEL-121561 storage: Allow configuring max and min volume sizes for extra idempotency
-
- New
-