-
Epic
-
Resolution: Unresolved
-
Undefined
-
None
-
[Epic]: Resize logical volumes is not proper idempotent
-
Moderate
-
Red Hat Enterprise Linux
-
0% To Do, 0% In Progress, 100% Done
-
rhel-system-roles
-
False
-
-
Yes
-
Dev ack
Follow up issue to RHEL-25777.
It seems that resize is still not proper idempotent and even this issue is not covered by tests.
Please provide the package NVR for which the bug is seen:
rhel-system-roles-1.95.5-0.1.el9
How reproducible is this bug?:
always
Steps to reproduce
-
# modprobe scsi-debug dev_size_mb=2048
-
# ansible-playbook -v playbook.yml
- playbook.yml:
--- - name: Demo RHEL System Role Storage hosts: localhost collections: - redhat.rhel_system_roles tasks: - name: Apply Storage role ansible.builtin.import_role: name: redhat.rhel_system_roles.storage vars: storage_pools: - name: "vg01" disks: - sda volumes: - name: "lv01" size: "1.2 GiB" fs_type: "xfs" mount_point: "/mount/lv01" state: present
- run twice
Expected results
Playbook should pass without an error, skip modification tasks if volume parameters effectively did not changed.
Actual results
First run pass:
TASK [redhat.rhel_system_roles.storage : Manage /etc/crypttab to account for changes we just made] ***************************************************************************************************************************************** skipping: [localhost] => {"changed": false, "skipped_reason": "No items in the list"} TASK [redhat.rhel_system_roles.storage : Update facts] ************************************************************************************************************************************************************************************* ok: [localhost] PLAY RECAP ********************************************************************************************************************************************************************************************************************************* localhost : ok=27 changed=4 unreachable=0 failed=0 skipped=10 rescued=0 ignored=0
But second failed with an error like:
TASK [redhat.rhel_system_roles.storage : Set storage_cryptsetup_services] ****************************************************************************************************************************************************************** ok: [localhost] => {"ansible_facts": {"storage_cryptsetup_services": []}, "changed": false} TASK [redhat.rhel_system_roles.storage : Mask the systemd cryptsetup services] ************************************************************************************************************************************************************* skipping: [localhost] => {"changed": false, "skipped_reason": "No items in the list"} TASK [redhat.rhel_system_roles.storage : Manage the pools and volumes to match the specified state] **************************************************************************************************************************************** fatal: [localhost]: FAILED! => {"actions": [], "changed": false, "crypts": [], "leaves": [], "mounts": [], "msg": "volume 'lv01' cannot be resized to '1.2 GiB'", "packages": [], "pools": [], "volumes": []} TASK [redhat.rhel_system_roles.storage : Failed message] *********************************************************************************************************************************************************************************** fatal: [localhost]: FAILED! => {"changed": false, "msg": {"actions": [], "changed": false, "crypts": [], "failed": true, "invocation": {"module_args": {"disklabel_type": null, "diskvolume_mkfs_option_map": {}, "packages_only": false, "pool_defaults": {"disks": [], "encryption": false, "encryption_cipher": null, "encryption_key": null, "encryption_key_size": null, "encryption_luks_version": null, "encryption_password": null, "grow_to_fill": false, "raid_chunk_size": null, "raid_device_count": null, "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "shared": false, "state": "present", "type": "lvm", "volumes": []}, "pools": [{"disks": ["sda"], "encryption": false, "encryption_cipher": null, "encryption_clevis_pin": null, "encryption_key": null, "encryption_key_size": null, "encryption_luks_version": null, "encryption_password": null, "encryption_tang_thumbprint": null, "encryption_tang_url": null, "grow_to_fill": false, "name": "vg01", "raid_chunk_size": null, "raid_device_count": null, "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "shared": false, "state": "present", "type": "lvm", "volumes": [{"cache_devices": [], "cache_mode": null, "cache_size": 0, "cached": false, "compression": null, "deduplication": null, "disks": ["sda"], "encryption": false, "encryption_cipher": null, "encryption_key": null, "encryption_key_size": null, "encryption_luks_version": null, "encryption_password": null, "fs_create_options": "", "fs_label": "", "fs_overwrite_existing": true, "fs_type": "xfs", "mount_check": 0, "mount_device_identifier": "uuid", "mount_group": null, "mount_mode": null, "mount_options": "defaults", "mount_passno": 0, "mount_point": "/mount/lv01", "mount_user": null, "name": "lv01", "raid_chunk_size": null, "raid_device_count": null, "raid_disks": [], "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "raid_stripe_size": null, "size": "1.2 GiB", "state": "present", "thin": false, "thin_pool_name": null, "thin_pool_size": null, "type": "lvm", "vdo_pool_size": null}]}], "safe_mode": true, "use_partitions": null, "volume_defaults": {"cache_devices": [], "cache_mode": null, "cache_size": 0, "cached": false, "compression": null, "deduplication": null, "disks": [], "encryption": false, "encryption_cipher": null, "encryption_key": null, "encryption_key_size": null, "encryption_luks_version": null, "encryption_password": null, "fs_create_options": "", "fs_label": "", "fs_overwrite_existing": true, "fs_type": "xfs", "mount_check": 0, "mount_device_identifier": "uuid", "mount_options": "defaults", "mount_passno": 0, "mount_point": "", "raid_chunk_size": null, "raid_device_count": null, "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "raid_stripe_size": null, "size": 0, "state": "present", "thin": null, "thin_pool_name": null, "thin_pool_size": null, "type": "lvm", "vdo_pool_size": null}, "volumes": []}}, "leaves": [], "mounts": [], "msg": "volume 'lv01' cannot be resized to '1.2 GiB'", "packages": [], "pools": [], "volumes": []}} TASK [redhat.rhel_system_roles.storage : Unmask the systemd cryptsetup services] *********************************************************************************************************************************************************** skipping: [localhost] => {"changed": false, "skipped_reason": "No items in the list"} PLAY RECAP ********************************************************************************************************************************************************************************************************************************* localhost : ok=16 changed=0 unreachable=0 failed=1 skipped=6 rescued=1 ignored=0
Testing
Please also cover this scenario in some storage test, e.g. tests_resize.yml or so.
- links to