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 1894676 - storage: must list disks in order to identify an existing pool
Summary: storage: must list disks in order to identify an existing pool
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 8
Classification: Red Hat
Component: rhel-system-roles
Version: 8.3
Hardware: All
OS: Linux
unspecified
unspecified
Target Milestone: rc
: 8.0
Assignee: Pavel Cahyna
QA Contact: guazhang@redhat.com
URL:
Whiteboard: role:storage
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2020-11-04 18:41 UTC by David Lehman
Modified: 2022-08-02 18:10 UTC (History)
5 users (show)

Fixed In Version: rhel-system-roles-1.0.0-28.el8
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-05-18 16:02:34 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 96 0 None open Creating new LV in existing VG requires specifying disk 2021-02-16 17:53:51 UTC
Github linux-system-roles storage pull 201 0 None open Look up pool by name without disk list 2021-02-16 17:55:10 UTC

Description David Lehman 2020-11-04 18:41:56 UTC
Description of problem:
The role currently does not allow the user to identify an existing pool only by name. This is unnecessarily difficult for users who may want to manage an existing pool by creating new volumes within it.

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


How reproducible:
Always

Steps to Reproduce:
1. create a pool
2. use the role in a playbook that will manage volumes within that pool, but without listing the disks that back the pool


Actual results:
Error indicating that the disk list is required.

Expected results:
Successful management of the pool.

Additional info:

Comment 1 guazhang@redhat.com 2021-01-10 13:39:05 UTC
Hi,

How to rest the bug ?
Could you provide the test playbook ?

Comment 2 guazhang@redhat.com 2021-01-15 12:15:31 UTC
HI

acked the bug and run the case in upstream.
https://github.com/linux-system-roles/storage/pull/59

Comment 3 guazhang@redhat.com 2021-01-16 10:05:40 UTC
cat tests_existing_lvm_pool.yml 
---
- hosts: all
  become: true
  vars:
    mount_location: '/opt/test1'
    volume_group_size: '6g'
    volume_size: '2g'
    pool_name: foo

  tasks:
    - include_role:
        name: linux-system-roles.storage

    - include_tasks: get_unused_disk.yml
      vars:
        min_size: "{{ volume_group_size }}"
        max_return: 1

    - name: Create one LVM logical volume under one volume group
      include_role:
        name: linux-system-roles.storage
      vars:
          storage_pools:
            - name: "{{ pool_name }}"
              disks: "{{ unused_disks }}"
              volumes:
                - name: test1
                  size: "{{ volume_size }}"

    - include_tasks: verify-role-results.yml

    - name: Create another volume in the existing pool, identified only by name.
      include_role:
        name: linux-system-roles.storage
      vars:
        storage_pools:
          - name: "{{ pool_name }}"
            volumes:
              - name: newvol
                size: '2 GiB'
                fs_type: ext4
                fs_label: newvol

    - include_tasks: verify-role-results.yml

    - name: Clean up.
      include_role:
        name: linux-system-roles.storage
      vars:
        storage_pools:
          - name: "{{ pool_name }}"
            state: absent

    - include_tasks: verify-role-results.yml



TASK [linux-system-roles.storage : manage the pools and volumes to match the specified state] ********************************
task path: /usr/share/ansible/roles/rhel-system-roles.storage/tasks/main-blivet.yml:104
An exception occurred during task execution. To see the full traceback, use -vvv. The error was: KeyError: 'disks'
fatal: [localhost]: FAILED! => {"changed": false, "module_stderr": "Traceback (most recent call last):\n  File \"/root/.ansible/tmp/ansible-tmp-1610790067.2291336-242204-36942466005033/AnsiballZ_blivet.py\", line 102, in <module>\n    _ansiballz_main()\n  File \"/root/.ansible/tmp/ansible-tmp-1610790067.2291336-242204-36942466005033/AnsiballZ_blivet.py\", line 94, in _ansiballz_main\n    invoke_module(zipped_mod, temp_path, ANSIBALLZ_PARAMS)\n  File \"/root/.ansible/tmp/ansible-tmp-1610790067.2291336-242204-36942466005033/AnsiballZ_blivet.py\", line 40, in invoke_module\n    runpy.run_module(mod_name='ansible.modules.blivet', init_globals=None, run_name='__main__', alter_sys=True)\n  File \"/usr/lib64/python3.6/runpy.py\", line 205, in run_module\n    return _run_module_code(code, init_globals, run_name, mod_spec)\n  File \"/usr/lib64/python3.6/runpy.py\", line 96, in _run_module_code\n    mod_name, mod_spec, pkg_name, script_name)\n  File \"/usr/lib64/python3.6/runpy.py\", line 85, in _run_code\n    exec(code, run_globals)\n  File \"/tmp/ansible_blivet_payload_yd6izuvk/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1265, in <module>\n  File \"/tmp/ansible_blivet_payload_yd6izuvk/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1262, in main\n  File \"/tmp/ansible_blivet_payload_yd6izuvk/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 1215, in run_module\n  File \"/tmp/ansible_blivet_payload_yd6izuvk/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 947, in manage_pool\n  File \"/tmp/ansible_blivet_payload_yd6izuvk/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 837, in manage\n  File \"/tmp/ansible_blivet_payload_yd6izuvk/ansible_blivet_payload.zip/ansible/modules/blivet.py\", line 747, in _look_up_disks\nKeyError: 'disks'\n", "module_stdout": "", "msg": "MODULE FAILURE\nSee stdout/stderr for the exact error", "rc": 1}


rhel-system-roles-1.0-23.el8.noarch

Comment 4 David Lehman 2021-01-26 13:37:01 UTC
The test case you posted is good. I have pulled this change out of the referenced pull request for clarity. Once that pull request is final/merged I will post a new pull request with only the changes related to this bug, which are minimal.

Comment 5 guazhang@redhat.com 2021-01-27 01:02:39 UTC
Hi,

thanks for the updated, please posted your final PR to the bug and build the fixed package for the bug, 
so I can test it in time.

Comment 6 David Lehman 2021-02-16 17:55:11 UTC
Pull Request: https://github.com/linux-system-roles/storage/pull/201

Comment 8 guazhang@redhat.com 2021-02-17 12:53:32 UTC
Hi

test pass with rhel-system-roles-1.0.0-28.el8.noarch.

ansible-playbook -vv -i host tests_existing_lvm_pool.yml

Comment 11 guazhang@redhat.com 2021-02-18 04:13:25 UTC
move to verified

Comment 13 errata-xmlrpc 2021-05-18 16:02:34 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-2021:1909


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