Bug 1872211 - [RHOSP 16.1] [os-brick] Backport: Replace sg_scan with lsscsi to get '[H:C:T:L]'
Summary: [RHOSP 16.1] [os-brick] Backport: Replace sg_scan with lsscsi to get '[H:C:T:L]'
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat OpenStack
Classification: Red Hat
Component: python-os-brick
Version: 16.1 (Train)
Hardware: Unspecified
OS: Unspecified
urgent
urgent
Target Milestone: z2
: 16.1 (Train on RHEL 8.2)
Assignee: Pablo Caruana
QA Contact: Tzach Shefi
URL:
Whiteboard:
: 1889728 (view as bug list)
Depends On: 1862541
Blocks: 1595325 1715964
TreeView+ depends on / blocked
 
Reported: 2020-08-25 08:57 UTC by Pablo Caruana
Modified: 2023-12-15 19:00 UTC (History)
30 users (show)

Fixed In Version: python-os-brick-2.10.5-1.20200916163418.634fb4a.el8ost
Doc Type: Bug Fix
Doc Text:
This update modifies `get_device_info` to use lsscsi to get `[H:C:T:L]` values, making it possible to support more than 255 logical unit numbers (LUNs) and host logical unit (HLU) ID values. + Previously, `get_device_info` used sg_scan to get these values, with a limit of 255. + You can get two device types with `get_device_info`: ** o /dev/disk/by-path/xxx, which is a symlink to /dev/sdX ** o /dev/sdX + sg_scan can process any device name, but lsscsi only shows /dev/sdx names. + If the device is a symlink, `get_device_info` uses the device name that the device links to. Otherwise `get_device_info` uses the device name directly. + Then `get_device_info` gets the device info '[H:C:T:L]' by comparing the device name with the last column of lsscsi output.
Clone Of: 1862541
Environment:
Last Closed: 2020-10-28 15:39:26 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
OpenStack gerrit 742784 0 None MERGED Replace sg_scan with lsscsi to get '[H:C:T:L]' 2021-02-10 12:32:07 UTC
RDO 28756 0 None None None 2020-08-26 14:44:39 UTC
RDO 29368 0 None None None 2020-10-20 12:21:18 UTC
Red Hat Product Errata RHEA-2020:4284 0 None None None 2020-10-28 15:39:55 UTC

Internal Links: 1889728

Description Pablo Caruana 2020-08-25 08:57:27 UTC
+++ This bug was initially created as a clone of Bug #1862541 +++

Description of problem:
Backport: PowerStore Cinder Driver into RHOSp 16.1 Z-Stream

It breaks down the specific changes of os-brick required with the introduction of the new driver.


https://bugs.launchpad.net/os-brick/+bug/1793259 is the launch pad related bug these patches
The fix https://review.opendev.org/#/c/742784/


--- Additional comment from Rajini Karthik on 2020-08-24 18:06:23 UTC ---

New patch requrired for this is under review https://review.opendev.org/#/c/747417/

--- Additional comment from Sam Wan on 2020-08-25 07:57:48 UTC ---

No need for this  https://review.opendev.org/#/c/747417/, it's abandoned.
The bug has been fixed in lsscsi-0.29 and RHEL8.2 has lsscsi-0.30.

Comment 7 Luigi Toscano 2020-08-25 13:05:13 UTC
Doesn't this change introduce a new dependency on the container? Or is it already available?

Comment 8 Rajini Karthik 2020-08-25 15:04:17 UTC
This change is ABANDONED because the bug has been fixed in lsscsi-0.29. 

No longer needed

Comment 9 Sam Wan 2020-08-26 01:17:06 UTC
Rajini,

We still need this https://review.opendev.org/#/c/742784/,
but don't need this https://review.opendev.org/#/c/747417/,

just to be clear.
thans and regards
Sam

Comment 10 Sam Wan 2020-08-26 01:34:31 UTC
Hi Luigi Toscano,

backport of https://review.opendev.org/#/c/742784/ requires 'lsscsi' (>=0.29)  on the containers. (to replace sg_scan)
thanks and regards
Sam

Comment 11 Alan Bishop 2020-08-26 14:19:11 UTC
(In reply to Luigi Toscano from comment #7)
> Doesn't this change introduce a new dependency on the container? Or is it
> already available?

The results of my investigation (I checked a recent OSP-16.1 c-vol container image) it is *not* present. This means we'll need to update the cinder requirements in RDO first, and then backport to OSP.

Comment 12 Alan Bishop 2020-08-26 14:20:52 UTC
Correction: we need to update the os-brick (not cinder) requirements

Comment 14 Rajini Karthik 2020-08-26 16:43:19 UTC
(In reply to Sam Wan from comment #9)
> Rajini,
> 
> We still need this https://review.opendev.org/#/c/742784/,
> but don't need this https://review.opendev.org/#/c/747417/,
> 
> just to be clear.
> thans and regards
> Sam

Thanks for the clarification sam

Comment 18 arkady kanevsky 2020-09-11 14:29:49 UTC
This is needed in z2.
This is part of Hot Fix that customers are using and promised in next z-stream.
Plus certification of powerflex that is z2 dependent to get rid of hotfix.

Comment 23 Alan Bishop 2020-09-18 15:55:09 UTC
This has been confirmed to be included in z2.

Comment 28 Sam Wan 2020-10-20 10:40:12 UTC
lsscsi is not in the z2 pre-rc container image.
rhosp16-openstack-cinder-backup:16.1_20201003.1 container image

=====================
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server   File "/usr/lib/python3.6/site-packages/os_brick/initiator/linuxscsi.py", line 114, in get_device_info
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server     (out, _err) = self._execute('lsscsi')
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server   File "/usr/lib/python3.6/site-packages/os_brick/executor.py", line 52, in _execute
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server     result = self.__execute(*args, **kwargs)
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server   File "/usr/lib/python3.6/site-packages/os_brick/privileged/rootwrap.py", line 187, in execute
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server     cmd=sanitized_cmd, description=six.text_type(e))
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server oslo_concurrency.processutils.ProcessExecutionError: [Errno 2] No such file or directory: 'lsscsi': 'lsscsi'
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server Command: lsscsi
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server Exit code: -
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server Stdout: None
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server Stderr: None
2020-10-20 10:32:52.430 25 ERROR oslo_messaging.rpc.server
====================

please make sure it's in the osp16.1.2 GA release.
thanks and regards
Sam

Comment 29 Sam Wan 2020-10-20 10:42:32 UTC
also not in rh-osbs/rhosp16-openstack-cinder-volume:16.1_20201003.1 yet

Comment 30 Luigi Toscano 2020-10-20 11:10:59 UTC
The added dependency has never been added. We need python-os-brick-2.10.5-1.20200915203416.634fb4a.el8ost, not the older python-os-brick-2.10.5-1.20200914153442.634fb4a.el8ost.

Comment 31 Sam Wan 2020-10-20 11:16:08 UTC
luigk,

I don't understand what you mean.
I just want to know that if the final RHOSP16.1.2 GA release will have 'lsscsi' in cinder-volume and cinder-backup container images.
thanks and regards
Sam

Comment 32 Luigi Toscano 2020-10-20 11:24:05 UTC
(In reply to Sam Wan from comment #31)
> luigk,
> 
> I don't understand what you mean.

Sorry for not clarifying that, I was explaining what happened internally.

> I just want to know that if the final RHOSP16.1.2 GA release will have
> 'lsscsi' in cinder-volume and cinder-backup container images.

I apologize, but it won't.

Comment 33 Sam Wan 2020-10-20 11:32:03 UTC
Hi Luigi,

Do you mean that the final ROHSP16.1.2 GA will not have 'lsscsi' in cinder-volume and cinder-backup images?
If it won't, then there will be problems for powerstore cinder driver.

Comment 35 Lon Hohberger 2020-10-20 15:28:11 UTC
The existing build python-os-brick-2.10.5-1.20200914153442.634fb4a.el8ost introduces a regression. Because code paths have shifted to all require lsscsi, existing features may break if lsscsi is not included as per https://review.rdoproject.org/r/29368

As such, python-os-brick-2.10.5-1.20200914153443.634fb4a.el8ost has been built to add the lsscsi and iscsi-initiator-utils packages as dependencies.

Comment 36 Lon Hohberger 2020-10-20 19:06:11 UTC
python-os-brick-2.10.5-1.20200916163418.634fb4a.el8ost automated build is in sync with the build I did above - switching to that

Comment 40 Sam Wan 2020-10-21 02:07:51 UTC
(In reply to Lon Hohberger from comment #36)
> python-os-brick-2.10.5-1.20200916163418.634fb4a.el8ost automated build is in
> sync with the build I did above - switching to that

Hi Lon,

Is this 'python-os-brick-2.10.5-1.20200916163418.634fb4a.el8ost' in Z2 GA or z3?
I see this bug is targeted to z2, so this package should be released with z2, right?

thanks and regards
Sam

Comment 42 Eric Harney 2020-10-22 12:31:21 UTC
*** Bug 1889728 has been marked as a duplicate of this bug. ***

Comment 43 Tzach Shefi 2020-10-27 11:34:31 UTC
Verfied on: 
python3-os-brick-2.10.5-1.20200916163418.634fb4a.el8ost.noarch

Installed a recent build which includes lsscsi in c-vol docker. 
A previous build before fix didn't have it included.


()[root@controller-0 /]# rpm -qa | grep brick
python3-os-brick-2.10.5-1.20200916163418.634fb4a.el8ost.noarch
()[root@controller-0 /]# rpm -qa | grep lss
lsscsi-0.30-1.el8.x86_64


I also managed to create a volume from an image, on an FC backed 3par system,
which before the fix had also failed due to same missing lsscsi

(overcloud) [stack@puma51 ~]$ cinder create 4 --image cirros --name testVolFromImage
+--------------------------------+--------------------------------------+
| Property                       | Value                                |
+--------------------------------+--------------------------------------+
| attachments                    | []                                   |
| availability_zone              | nova                                 |
| bootable                       | false                                |
| consistencygroup_id            | None                                 |
| created_at                     | 2020-10-27T11:31:50.000000           |
| description                    | None                                 |
| encrypted                      | False                                |
| id                             | e345fcac-38f1-4f46-8395-f0a2f066244f |
| metadata                       | {}                                   |
| migration_status               | None                                 |
| multiattach                    | False                                |
| name                           | testVolFromImage                     |
| os-vol-host-attr:host          | None                                 |
| os-vol-mig-status-attr:migstat | None                                 |
| os-vol-mig-status-attr:name_id | None                                 |
| os-vol-tenant-attr:tenant_id   | bef0016c32e34f23baefcd5a0066f0b1     |
| replication_status             | None                                 |
| size                           | 4                                    |
| snapshot_id                    | None                                 |
| source_volid                   | None                                 |
| status                         | creating                             |
| updated_at                     | None                                 |
| user_id                        | 3b8e230756374ed994464921c8c9a0a4     |
| volume_type                    | tripleo                              |
+--------------------------------+--------------------------------------+

(overcloud) [stack@puma51 ~]$ cinder list
+--------------------------------------+-----------+------------------+------+-------------+----------+-------------+
| ID                                   | Status    | Name             | Size | Volume Type | Bootable | Attached to |
+--------------------------------------+-----------+------------------+------+-------------+----------+-------------+
| e345fcac-38f1-4f46-8395-f0a2f066244f | available | testVolFromImage | 4    | tripleo     | true     |             |


OK to verify.

Comment 48 errata-xmlrpc 2020-10-28 15:39:26 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 (Red Hat OpenStack Platform 16.1 bug fix and enhancement advisory), 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-2020:4284


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