RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2066880 - storage - support for adding/removing disks to/from storage pools
Summary: storage - support for adding/removing disks to/from storage pools
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rhel-system-roles
Version: 8.7
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: rc
: 8.7
Assignee: Rich Megginson
QA Contact: Lin Li
Gabi Fialová
URL:
Whiteboard: role:storage
Depends On: 2078801 2079220 2081276
Blocks: 2072742
TreeView+ depends on / blocked
 
Reported: 2022-03-22 16:39 UTC by Rich Megginson
Modified: 2022-11-08 10:35 UTC (History)
5 users (show)

Fixed In Version: rhel-system-roles-1.20.0-1.el8
Doc Type: Enhancement
Doc Text:
.Support for managing pool members in the `storage` RHEL System Role The `storage` RHEL System Role can now add or remove disks from existing LVM pools without removing the pool first. New disks can be added to the pool to increase the pool capacity and disks that are currently part of the pool can be freed for another use.
Clone Of:
: 2072742 (view as bug list)
Environment:
Last Closed: 2022-11-08 09:40:52 UTC
Type: Bug
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github linux-system-roles storage issues 166 0 None open vgextend failing to extend the volume group 2022-03-22 16:39:19 UTC
Github linux-system-roles storage pull 264 0 None Draft Add support for managing pool members 2022-04-27 21:40:39 UTC
Red Hat Issue Tracker RHELPLAN-116425 0 None None None 2022-03-22 16:48:23 UTC
Red Hat Product Errata RHEA-2022:7568 0 None None None 2022-11-08 09:41:17 UTC

Internal Links: 2076958

Description Rich Megginson 2022-03-22 16:39:20 UTC
Description of problem:
The storage role should be able to add and remove disks to/from storage pools

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


How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:


Expected results:


Additional info:

Comment 1 Lin Li 2022-04-21 03:01:15 UTC
Hi Vojtech,
Could you kindly tell me how to verify the bug?
Thanks in advance!

Comment 2 Rich Megginson 2022-04-25 22:31:26 UTC
(In reply to Lin Li from comment #1)
> Hi Vojtech,
> Could you kindly tell me how to verify the bug?
> Thanks in advance!

The bug has not been fixed yet - and I would expect there to be an automated test included with the role.  The BZ will be move to state POST once there is a fix to test.

Comment 3 Lin Li 2022-06-23 01:43:34 UTC
(In reply to Rich Megginson from comment #2)
> (In reply to Lin Li from comment #1)
> > Hi Vojtech,
> > Could you kindly tell me how to verify the bug?
> > Thanks in advance!
> 
> The bug has not been fixed yet - and I would expect there to be an automated
> test included with the role.  The BZ will be move to state POST once there
> is a fix to test.

Hi Rich,
Could you tell me which case can verify the bug?
Thanks in advance!

Comment 4 Rich Megginson 2022-06-23 16:47:51 UTC
(In reply to Lin Li from comment #3)
> (In reply to Rich Megginson from comment #2)
> > (In reply to Lin Li from comment #1)
> > > Hi Vojtech,
> > > Could you kindly tell me how to verify the bug?
> > > Thanks in advance!
> > 
> > The bug has not been fixed yet - and I would expect there to be an automated
> > test included with the role.  The BZ will be move to state POST once there
> > is a fix to test.
> 
> Hi Rich,
> Could you tell me which case can verify the bug?
> Thanks in advance!

tests/tests_lvm_pool_members.yml

Comment 6 Lin Li 2022-06-27 13:32:29 UTC
Hi Rich,
I hit below error when running tests/tests_lvm_pool_members.yml.
Could you login storageqe-05.sqe.lab.eng.bos.redhat.com/redhat to check it?
Thanks a lot!

[root@storageqe-05 rhel-system-roles.storage]# ansible-playbook tests/tests_lvm_pool_members.yml
TASK [Collect LUKS info for this member] *****************************************************************************************
fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "cryptsetup luksDump /dev/sdr1", "msg": "[Errno 2] No such file or directory: b'cryptsetup': b'cryptsetup'", "rc": 2, "stderr": "", "stderr_lines": [], "stdout": "", "stdout_lines": []}

PLAY RECAP ***********************************************************************************************************************
127.0.0.1                  : ok=373  changed=15   unreachable=0    failed=1    skipped=289  rescued=0    ignored=0

Comment 7 Rich Megginson 2022-06-27 13:59:57 UTC
(In reply to Lin Li from comment #6)
> Hi Rich,
> I hit below error when running tests/tests_lvm_pool_members.yml.
> Could you login storageqe-05.sqe.lab.eng.bos.redhat.com/redhat to check it?
> Thanks a lot!
> 
> [root@storageqe-05 rhel-system-roles.storage]# ansible-playbook
> tests/tests_lvm_pool_members.yml
> TASK [Collect LUKS info for this member]
> *****************************************************************************
> ************
> fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "cryptsetup
> luksDump /dev/sdr1", "msg": "[Errno 2] No such file or directory:
> b'cryptsetup': b'cryptsetup'", "rc": 2, "stderr": "", "stderr_lines": [],
> "stdout": "", "stdout_lines": []}
> 
> PLAY RECAP
> *****************************************************************************
> ******************************************
> 127.0.0.1                  : ok=373  changed=15   unreachable=0    failed=1 
> skipped=289  rescued=0    ignored=0

Which test is this?  basic-smoke-test or Upstream-testsuite?  Is this rhel 8.6 or rhel 8.7?

Comment 8 Lin Li 2022-06-27 14:21:25 UTC
(In reply to Rich Megginson from comment #7)
> (In reply to Lin Li from comment #6)
> > Hi Rich,
> > I hit below error when running tests/tests_lvm_pool_members.yml.
> > Could you login storageqe-05.sqe.lab.eng.bos.redhat.com/redhat to check it?
> > Thanks a lot!
> > 
> > [root@storageqe-05 rhel-system-roles.storage]# ansible-playbook
> > tests/tests_lvm_pool_members.yml
> > TASK [Collect LUKS info for this member]
> > *****************************************************************************
> > ************
> > fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "cryptsetup
> > luksDump /dev/sdr1", "msg": "[Errno 2] No such file or directory:
> > b'cryptsetup': b'cryptsetup'", "rc": 2, "stderr": "", "stderr_lines": [],
> > "stdout": "", "stdout_lines": []}
> > 
> > PLAY RECAP
> > *****************************************************************************
> > ******************************************
> > 127.0.0.1                  : ok=373  changed=15   unreachable=0    failed=1 
> > skipped=289  rescued=0    ignored=0
> 
> Which test is this?  basic-smoke-test or Upstream-testsuite?  Is this rhel
> 8.6 or rhel 8.7?

  
   DISTRO=RHEL-8.7.0-20220625.0
   wget http://brew-task-repos.usersys.redhat.com/repos/scratch/rmeggins/rhel-system-roles/1.19.3/0.2.el8/noarch/rhel-system-roles-1.19.3-0.2.el8.noarch.rpm
    
   rpm -ivh rhel-system-roles-1.19.3-0.2.el8.noarch.rpm
   cd /usr/share/ansible/roles/rhel-system-roles.storage
   ansible-playbook tests/tests_lvm_pool_members.yml

Comment 9 Vojtech Trefny 2022-06-27 14:52:16 UTC
(In reply to Lin Li from comment #6)
> fatal: [127.0.0.1]: FAILED! => {"changed": false, "cmd": "cryptsetup
> luksDump /dev/sdr1", "msg": "[Errno 2] No such file or directory:
> b'cryptsetup': b'cryptsetup'", "rc": 2, "stderr": "", "stderr_lines": [],
> "stdout": "", "stdout_lines": []}
> 

You need to install cryptsetup. We use it in tests to verify the role result and it's not used by the role (or blivet) directly so it isn't installed (blivet uses libcryptsetup). We should probably add cryptsetup to some list of test dependencies.

Comment 10 Lin Li 2022-06-27 15:00:41 UTC
I installed cryptsetup. The below error happened. Could you tell me why?


fatal: [127.0.0.1]: FAILED! => {"actions": [], "changed": false, "crypts": [], "leaves": [], "mounts": [], "msg": "encrypted pool 'foo' missing key/password", "packages": [], "pools": [], "volumes": []}

TASK [rhel-system-roles.storage : failed message] ********************************************************************************
fatal: [127.0.0.1]: 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, "raid_chunk_size": null, "raid_device_count": null, "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "state": "present", "type": "lvm", "volumes": []}, "pools": [{"disks": ["sds", "sdt", "sdu", "sdv", "sdw", "sdx", "sdy", "sdz"], "encryption": true, "encryption_cipher": null, "encryption_key": null, "encryption_key_size": 0, "encryption_luks_version": "luks2", "encryption_password": null, "name": "foo", "raid_chunk_size": null, "raid_device_count": null, "raid_level": null, "raid_metadata_version": null, "raid_spare_count": null, "state": "present", "type": "lvm", "volumes": []}], "safe_mode": false, "use_partitions": true, "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, "size": 0, "state": "present", "thin": null, "thin_pool_name": null, "thin_pool_size": null, "type": "lvm", "vdo_pool_size": null}, "volumes": []}}, "leaves": [], "mounts": [], "msg": "encrypted pool 'foo' missing key/password", "packages": [], "pools": [], "volumes": []}}

TASK [rhel-system-roles.storage : Unmask the systemd cryptsetup services] ********************************************************

PLAY RECAP ***********************************************************************************************************************
127.0.0.1                  : ok=34   changed=0    unreachable=0    failed=1    skipped=26   rescued=1    ignored=0

Comment 11 Vojtech Trefny 2022-06-27 15:48:12 UTC
I run the tests on the same machine and I think the issue was caused by the previously failed run from comment #6 -- it left behind the encrypted VG "foo" (the test unfortunately doesn't clean after itself when it fails) so when running the test case again it failed because the first step is "Create volume group 'foo' with 3 PVs", but because the VG already exists this translates to "add 2 more encrypted PVs to the existing VG" and at this step we don't provide the encryption passphrase so it fails.

Comment 12 Rich Megginson 2022-06-27 16:01:41 UTC
(In reply to Vojtech Trefny from comment #11)
> I run the tests on the same machine and I think the issue was caused by the
> previously failed run from comment #6 -- it left behind the encrypted VG
> "foo" (the test unfortunately doesn't clean after itself when it fails) so
> when running the test case again it failed because the first step is "Create
> volume group 'foo' with 3 PVs", but because the VG already exists this
> translates to "add 2 more encrypted PVs to the existing VG" and at this step
> we don't provide the encryption passphrase so it fails.

I have a fix for ensuring cryptsetup is present for the tests, and it makes the test pass on 8.7.  However, I am unable to run the test tests/tests_lvm_pool_members.yml on rhel 8.6 or centos-9:

TASK [linux-system-roles.storage : manage the pools and volumes to match the specified state] ***
task path: /home/rmeggins/linux-system-roles/storage/tests/roles/linux-system-roles.storage/tasks/main-blivet.yml:77
Monday 27 June 2022  10:00:34 -0600 (0:00:00.031)       0:01:55.009 *********** 
fatal: [/home/rmeggins/.cache/linux-system-roles/centos-9.qcow2]: FAILED! => {
    "actions": [],
    "changed": false,
    "crypts": [],
    "leaves": [],
    "mounts": [],
    "packages": [],
    "pools": [],
    "volumes": []
}

MSG:

failed to remove disk 'sda1' from pool 'foo': 'str' object has no attribute 'path'

Comment 13 Vojtech Trefny 2022-06-28 13:57:51 UTC
(In reply to Rich Megginson from comment #12)
> tests/tests_lvm_pool_members.yml on rhel 8.6 or centos-9:
> 
> failed to remove disk 'sda1' from pool 'foo': 'str' object has no attribute
> 'path'

Oh, I missed that, sorry. This is fixed in blivet on 8.7 and 9.1: https://bugzilla.redhat.com/show_bug.cgi?id=2079220 and https://bugzilla.redhat.com/show_bug.cgi?id=2079221 but not on older versions of RHEL. So our options are to either skip the entire test case with older blivet or to ask for zstream for these bugs for 8.6/9.0. We already skip part of the test with older blivet so that might be the easiest way.

Comment 14 Rich Megginson 2022-06-28 14:17:50 UTC
(In reply to Vojtech Trefny from comment #13)
> (In reply to Rich Megginson from comment #12)
> > tests/tests_lvm_pool_members.yml on rhel 8.6 or centos-9:
> > 
> > failed to remove disk 'sda1' from pool 'foo': 'str' object has no attribute
> > 'path'
> 
> Oh, I missed that, sorry. This is fixed in blivet on 8.7 and 9.1:
> https://bugzilla.redhat.com/show_bug.cgi?id=2079220 and
> https://bugzilla.redhat.com/show_bug.cgi?id=2079221 but not on older
> versions of RHEL. So our options are to either skip the entire test case
> with older blivet or to ask for zstream for these bugs for 8.6/9.0. We
> already skip part of the test with older blivet so that might be the easiest
> way.

I think we should skip the test case on older versions of blivet.  But tests_lvm_pool_members.yml already has this?  https://github.com/linux-system-roles/storage/blob/master/tests/tests_lvm_pool_members.yml#L251 - is that not working, or we need it somewhere else?

Comment 15 Rich Megginson 2022-06-29 13:10:33 UTC
(In reply to Rich Megginson from comment #14)
> (In reply to Vojtech Trefny from comment #13)
> > (In reply to Rich Megginson from comment #12)
> > > tests/tests_lvm_pool_members.yml on rhel 8.6 or centos-9:
> > > 
> > > failed to remove disk 'sda1' from pool 'foo': 'str' object has no attribute
> > > 'path'
> > 
> > Oh, I missed that, sorry. This is fixed in blivet on 8.7 and 9.1:
> > https://bugzilla.redhat.com/show_bug.cgi?id=2079220 and
> > https://bugzilla.redhat.com/show_bug.cgi?id=2079221 but not on older
> > versions of RHEL. So our options are to either skip the entire test case
> > with older blivet or to ask for zstream for these bugs for 8.6/9.0. We
> > already skip part of the test with older blivet so that might be the easiest
> > way.
> 
> I think we should skip the test case on older versions of blivet.  But
> tests_lvm_pool_members.yml already has this? 
> https://github.com/linux-system-roles/storage/blob/master/tests/
> tests_lvm_pool_members.yml#L251 - is that not working, or we need it
> somewhere else?

Thanks for the patch Vojtech.  merged.

Comment 19 Lin Li 2022-07-04 09:47:13 UTC
Verified on rhel-system-roles-1.19.3-1.el8
[root@storageqe-05 tests]# ansible-playbook tests_lvm_pool_members.yml
PLAY RECAP ***********************************************************************************************************************
127.0.0.1                  : ok=693  changed=37   unreachable=0    failed=0    skipped=500  rescued=0    ignored=0   



Move to verified.

Comment 21 errata-xmlrpc 2022-11-08 09:40:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (rhel-system-roles bug fix and enhancement update), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHEA-2022:7568


Note You need to log in before you can comment on or make changes to this bug.