Bug 1888012

Summary: stratis.py - Update plugin to include new feature output
Product: Red Hat Enterprise Linux 8 Reporter: Dennis Keefe <dkeefe>
Component: sosAssignee: Pavel Moravec <pmoravec>
Status: CLOSED ERRATA QA Contact: Miroslav Hradílek <mhradile>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.4CC: agk, bmr, cww, mhradile, plambri, sbradley
Target Milestone: rcKeywords: FutureFeature, OtherQA
Target Release: 8.0   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: sos-4.0-2.el8 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2021-05-18 14:48:58 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Dennis Keefe 2020-10-13 19:45:29 UTC
Description of problem:
New output for stratis should be included in sos-report

see: https://github.com/sosreport/sos/issues/2273

List of commands that should be added to sos' stratis.py plugin.

"stratis key list" - collect a list of key descriptions
"stratis report engine_state_report" - collect the current state of Stratis' engine
"stratis --version" - collect the version of stratis-cli

Comment 1 Pavel Moravec 2020-10-14 06:39:07 UTC
Hello,
thanks for filing the BZ and upstream issue; I raised upstream PR for the same.

To ensure the fix lands already in 8.4, would you be able to verify it against a candidate package (once that ready), please?

Comment 2 Dennis Keefe 2020-10-14 12:57:18 UTC
Yes, I can verify it.

Comment 3 Dennis Keefe 2020-10-20 20:19:51 UTC
(In reply to Pavel Moravec from comment #1)
> Hello,
> thanks for filing the BZ and upstream issue; I raised upstream PR for the
> same.
> 
> To ensure the fix lands already in 8.4, would you be able to verify it
> against a candidate package (once that ready), please?

Output looks good to me.

Here is the output from the test. 

Output of sosreport collecting new stratis commands output (report engine state report, stratis --version, stratis key list, stratis daemon version)

cd ./sosreport-ci-vm-testStratis-2020-10-20-fotcmlj/sos_commands/stratis
ls -trlh
total 44K
-rw-r--r--. 1 root root 3.7K Oct 20 16:03 systemctl_status_stratisd
-rw-r--r--. 1 root root  102 Oct 20 16:03 stratis_pool_list
-rw-r--r--. 1 root root  200 Oct 20 16:03 stratis_filesystem_list
-rw-r--r--. 1 root root   94 Oct 20 16:03 stratis_blockdev_list
-rw-r--r--. 1 root root   32 Oct 20 16:03 stratis_key_list
-rw-r--r--. 1 root root    8 Oct 20 16:03 stratis_daemon_redundancy
-rw-r--r--. 1 root root    6 Oct 20 16:03 stratis_daemon_version
-rw-r--r--. 1 root root    6 Oct 20 16:03 stratis_--version
-rw-r--r--. 1 root root  637 Oct 20 16:03 stratis_report_engine_state_report
-rw-r--r--. 1 root root 4.5K Oct 20 16:03 journalctl_--no-pager_--unit_stratisd
# cat stratis_report_engine_state_report
{
    "errored_pools": [],
    "hopeless_devices": [],
    "pools": [
        {
            "blockdevs": {
                "cachedevs": [],
                "datadevs": [
                    {
                        "path": "/dev/loop1",
                        "uuid": "a08e20e8d8d24cf1958e0f2a8148ccb1"
                    }
                ]
            },
            "filesystems": [
                {
                    "name": "fs1",
                    "uuid": "4a320661fbde42a6aafb3bd0765b23e1"
                }
            ],
            "name": "p1",
            "uuid": "ae064f72156b43e697d39fecce58a935"
        }
    ]
}
# cat stratis_--version
2.1.1
# cat stratis_key_list
Key Description
foo            
# cat stratis_daemon_version
2.1.0

Comment 4 Miroslav Hradílek 2020-10-22 13:35:40 UTC
Granting QA_Ack based on commitment to test (OtherQE) in comment 2.

Comment 7 Pavel Moravec 2020-10-29 11:56:38 UTC
Hello,
can you please verify the bug against below build? Thanks in advance.


A yum repository for the build of sos-4.0-2.el8 (task 32548242) is available at:

http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/

You can install the rpms locally by putting this .repo file in your /etc/yum.repos.d/ directory:

http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/sos-4.0-2.el8.repo

RPMs and build logs can be found in the following locations:
http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/noarch/

The full list of available rpms is:
http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/noarch/sos-4.0-2.el8.src.rpm
http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/noarch/sos-4.0-2.el8.noarch.rpm
http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/noarch/sos-audit-4.0-2.el8.noarch.rpm

The repository will be available for the next 60 days. Scratch build output will be deleted
earlier, based on the Brew scratch build retention policy.

Comment 8 Dennis Keefe 2020-10-29 15:12:28 UTC
test passed - works as expected.

Process
--------
using RHEL 8 VM

1. yum -y install stratis-cli stratisd
2. systemctl enable stratisd --now
3. echo "testkey" > /tmp/testkey
4. stratis key set testkey --keyfile-path /tmp/testkey
5. stratis pool create --key-desc testkey EP1 /dev/vdb
6. create repo using http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/sos-4.0-2.el8.repo
7. yum -y install sos  (rpm -qa|grep sos - sos-4.0-2.el8.noarch)
8. run sosreport
9. extract tar testsosreport10292020-2020-10-29-isosawm.tar.xz
10. cd testsosreport10292020-2020-10-29-isosawm/sos_commands/stratis/
11. cat files:

# cat stratis_--version
2.1.1
# cat stratis_key_list
Key Description
testkey        
# cat stratis_report_engine_state_report
{
    "errored_pools": [],
    "hopeless_devices": [],
    "pools": [
        {
            "blockdevs": {
                "cachedevs": [],
                "datadevs": [
                    {
                        "path": "/dev/vdb",
                        "uuid": "7e0ac89d680f4362a1d0052d3da1dc89"
                    }
                ]
            },
            "filesystems": [],
            "name": "EP1",
            "uuid": "6f82a37a41254cc59c2691edeb77ece6"
        }
    ]
}
(In reply to Pavel Moravec from comment #7)
> Hello,
> can you please verify the bug against below build? Thanks in advance.
> 
> 
> A yum repository for the build of sos-4.0-2.el8 (task 32548242) is available
> at:
> 
> http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/
> 
> You can install the rpms locally by putting this .repo file in your
> /etc/yum.repos.d/ directory:
> 
> http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/sos-4.
> 0-2.el8.repo
> 
> RPMs and build logs can be found in the following locations:
> http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/
> noarch/
> 
> The full list of available rpms is:
> http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/
> noarch/sos-4.0-2.el8.src.rpm
> http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/
> noarch/sos-4.0-2.el8.noarch.rpm
> http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/
> noarch/sos-audit-4.0-2.el8.noarch.rpm
> 
> The repository will be available for the next 60 days. Scratch build output
> will be deleted
> earlier, based on the Brew scratch build retention policy.

test passed - works as expected.

Process
--------
using RHEL 8 VM

1. yum -y install stratis-cli stratisd
2. systemctl enable stratisd --now
3. echo "testkey" > /tmp/testkey
4. stratis key set testkey --keyfile-path /tmp/testkey
5. stratis pool create --key-desc testkey EP1 /dev/vdb
6. create repo using http://brew-task-repos.usersys.redhat.com/repos/official/sos/4.0/2.el8/sos-4.0-2.el8.repo
7. yum -y install sos  (rpm -qa|grep sos - sos-4.0-2.el8.noarch)
8. run sosreport
9. extract tar testsosreport10292020-2020-10-29-isosawm.tar.xz
10. cd testsosreport10292020-2020-10-29-isosawm/sos_commands/stratis/
11. cat files:

# cat stratis_--version
2.1.1
# cat stratis_key_list
Key Description
testkey        
# cat stratis_report_engine_state_report
{
    "errored_pools": [],
    "hopeless_devices": [],
    "pools": [
        {
            "blockdevs": {
                "cachedevs": [],
                "datadevs": [
                    {
                        "path": "/dev/vdb",
                        "uuid": "7e0ac89d680f4362a1d0052d3da1dc89"
                    }
                ]
            },
            "filesystems": [],
            "name": "EP1",
            "uuid": "6f82a37a41254cc59c2691edeb77ece6"
        }
    ]
}

Comment 12 errata-xmlrpc 2021-05-18 14:48:58 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 (sos 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:1604