Bug 1678328

Summary: add user message for share creation failure because of no share-type
Product: Red Hat OpenStack Reporter: lkuchlan <lkuchlan>
Component: openstack-manilaAssignee: Ashley R <ashrodri>
Status: CLOSED CURRENTRELEASE QA Contact: lkuchlan <lkuchlan>
Severity: low Docs Contact: RHOS Documentation Team <rhos-docs>
Priority: low    
Version: 16.2 (Train)CC: apevec, ashrodri, astillma, gcharot, gfidente, gouthamr, kgilliga, lhh, tshefi, vhariria, vimartin
Target Milestone: z3Keywords: Bugfix, Improvement, TestOnly, Triaged, ZStream
Target Release: 16.2 (Train on RHEL 8.4)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: openstack-manila-9.1.6-2.20220111161349.2cebaa9.el8ost Doc Type: Bug Fix
Doc Text:
If you create a share without specifying a default share type, the share creation fails. Before this update, the share creation failed without an error message. With this update, an error message is displayed to help you address the reason for the failure.
Story Points: ---
Clone Of: Environment:
Last Closed: 2022-05-19 10:38:53 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:
Attachments:
Description Flags
Manila scheduler log none

Description lkuchlan 2019-02-18 14:12:19 UTC
Description of problem:
Although 'share type' is a mandatory argument while creating a share it is
displayed as an optional argument in the command description.

Version-Release number of selected component (if applicable):
python2-manilaclient-1.24.1-0.20180809180957.316bd21.el7ost.noarch


How reproducible:
100%

Steps to Reproduce:
# create a share without specifying share type.

(overcloud) [stack@undercloud-0 ~]$ manila create NFS 1 --name share1
+---------------------------------------+--------------------------------------+
| Property                              | Value                                |
+---------------------------------------+--------------------------------------+
| status                                | creating                             |
| share_type_name                       | None                                 |
| description                           | None                                 |
| availability_zone                     | None                                 |
| share_network_id                      | None                                 |
| share_server_id                       | None                                 |
| share_group_id                        | None                                 |
| host                                  |                                      |
| revert_to_snapshot_support            | False                                |
| access_rules_status                   | active                               |
| snapshot_id                           | None                                 |
| create_share_from_snapshot_support    | False                                |
| is_public                             | False                                |
| task_state                            | None                                 |
| snapshot_support                      | False                                |
| id                                    | 4c95b542-46c5-4200-a1f1-80a374bd9139 |
| size                                  | 1                                    |
| source_share_group_snapshot_member_id | None                                 |
| user_id                               | ceee86a910d54af1bc1a629022033da2     |
| name                                  | share1                               |
| share_type                            | None                                 |
| has_replicas                          | False                                |
| replication_type                      | None                                 |
| created_at                            | 2019-02-18T13:46:27.000000           |
| share_proto                           | NFS                                  |
| mount_snapshot_support                | False                                |
| project_id                            | fd808698c9c34580a92266ff52b11b0d     |
| metadata                              | {}                                   |
+---------------------------------------+--------------------------------------+

(overcloud) [stack@undercloud-0 ~]$ manila list
+--------------------------------------+--------+------+-------------+--------+-----------+-----------------+------+-------------------+
| ID                                   | Name   | Size | Share Proto | Status | Is Public | Share Type Name | Host | Availability Zone |
+--------------------------------------+--------+------+-------------+--------+-----------+-----------------+------+-------------------+
| 4c95b542-46c5-4200-a1f1-80a374bd9139 | share1 | 1    | NFS         | error  | False     | None            |      | None              |
+--------------------------------------+--------+------+-------------+--------+-----------+-----------------+------+-------------------+

Actual results:
Share type is displayed as an optional argument in manila create command.

overcloud) [stack@undercloud-0 ~]$ manila help create
usage: manila create [--snapshot-id <snapshot-id>] [--name <name>]
                     [--metadata [<key=value> [<key=value> ...]]]
                     [--share-network <network-info>]
                     [--description <description>] [--share-type <share-type>]
                     [--public] [--availability-zone <availability-zone>]
                     [--share-group <share-group>]
                     <share_protocol> <size>

Creates a new share (NFS, CIFS, CephFS, GlusterFS, HDFS or MAPRFS).

Positional arguments:
  <share_protocol>      Share protocol (NFS, CIFS, CephFS, GlusterFS, HDFS or
                        MAPRFS).
  <size>                Share size in GiB.

Optional arguments:
  --snapshot-id <snapshot-id>, --snapshot_id <snapshot-id>
                        Optional snapshot ID to create the share from.
                        (Default=None)
  --name <name>         Optional share name. (Default=None)
  --metadata [<key=value> [<key=value> ...]]
                        Metadata key=value pairs (Optional, Default=None).
  --share-network <network-info>, --share_network <network-info>
                        Optional network info ID or name.
  --description <description>
                        Optional share description. (Default=None)
############################
  --share-type <share-type>, --share_type <share-type>, --volume-type <share-type>, --volume_type <share-type>
                        Optional share type. Use of optional volume type is
                        deprecated. (Default=None)
############################
  --public              Level of visibility for share. Defines whether other
                        tenants are able to see it or not.
  --availability-zone <availability-zone>, --availability_zone <availability-zone>, --az <availability-zone>
                        Availability zone in which share should be created.
  --share-group <share-group>, --share_group <share-group>, --group <share-group>
                        Optional share group name or ID in which to create the
                        share (Experimental, Default=None).


Expected results:
Share type should be displayed as a positional argument in manila create command. 

Additional info:

manila-scheduler.log:
=====================
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server     result = func(ctxt, **new_args)
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/manila/scheduler/manager.py", line 121, in create_share_instance
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server     context, ex, request_spec)
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 220, in __exit__
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server     self.force_reraise()
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/oslo_utils/excutils.py", line 196, in force_reraise
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server     six.reraise(self.type_, self.value, self.tb)
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/manila/scheduler/manager.py", line 111, in create_share_instance
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server     filter_properties)
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/manila/scheduler/drivers/filter.py", line 84, in schedule_create_share
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server     filter_properties)
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/manila/scheduler/drivers/filter.py", line 202, in _schedule_share
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server     context, filter_properties, request_spec)
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server   File "/usr/lib/python2.7/site-packages/manila/scheduler/drivers/filter.py", line 145, in _format_filter_properties
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server     raise exception.InvalidParameterValue(err=msg)
2019-02-18 13:46:28.090 1 ERROR oslo_messaging.rpc.server InvalidParameterValue: You must create a share type in advance, and specify in request body or set default_share_type in manila.conf.

Comment 1 Tzach Shefi 2019-02-18 14:14:24 UTC
Created attachment 1535973 [details]
Manila scheduler log

Posting log on behalf of Liron.

Comment 2 Goutham Pacha Ravi 2019-02-25 17:37:54 UTC
In simple single-tenant clouds, specifying a share type is optional. An administrator can configure a "default" share type [1] that will be used if a user does not specify a share type during share creation. In multi-tenant clouds, using a "default" share type is less desired, depending on what scheduling hints (extra-specs) the default share type might contain. 

I disagree this is a client bug although we might be missing some documentation to make this clearer. I think we should bring this up in the upstream manila community, either on Launchpad [2] or via the weekly meeting [3].

[1] https://access.redhat.com/documentation/en-us/red_hat_openstack_platform/13/html/netapp_back_end_guide_for_the_shared_file_system_service/default-share-type
[2] https://bugs.launchpad.net/manila
[3] https://wiki.openstack.org/wiki/Manila/Meetings

Comment 3 lkuchlan 2019-02-26 08:07:14 UTC
I thinks it's better practise to provide a hint message while trying to create a share
without specifying share type rather than creating a share with error status.

Comment 5 Tom Barron 2019-08-01 18:15:23 UTC
Liron, you and Goutham disagree about whether this is a bug.  His disagreement doesn't settle the issue -- next step as he suggested is to bring up the issue via Launchpad or the weekly meeting.  Are you planning taking one of these actions?

Comment 6 Goutham Pacha Ravi 2019-08-01 19:03:04 UTC
(In reply to lkuchlan from comment #3)
> I thinks it's better practise to provide a hint message while trying to
> create a share
> without specifying share type rather than creating a share with error status.

Hmmm, I agree with this - but the bug is still not in manila client? You can try adding a user message for this failure perhaps?

Comment 7 lkuchlan 2019-08-05 08:34:57 UTC
Perhaps, it's more appropriate to define it as RFE and not a bug.
In my first experience with creating a share, it took me a while to figure out that
share requires a type, only when I have looked into the logs I figured out it.
So my suggestion is first to change this bug to RFE and second in case user doesn't 
specify a share type and share type is not defined in manila.conf is to drop an error 
message, something like: "You must specify a share type or populate default_share_type in manila.conf".

Comment 20 lkuchlan 2022-02-07 13:45:35 UTC
Tested using:
openstack-manila-9.1.6-2.20220111161349.2cebaa9.el8ost.noarch

Verification steps:
(overcloud) [stack@undercloud-0 ~]$ manila type-list
+----+------+------------+------------+----------------------+----------------------+-------------+
| ID | Name | visibility | is_default | required_extra_specs | optional_extra_specs | Description |
+----+------+------------+------------+----------------------+----------------------+-------------+
+----+------+------------+------------+----------------------+----------------------+-------------+
(overcloud) [stack@undercloud-0 ~]$ manila create nfs 1
+---------------------------------------+--------------------------------------+
| Property                              | Value                                |
+---------------------------------------+--------------------------------------+
| id                                    | dd33f6a0-a9ee-458e-9a78-741eed5b316b |
| size                                  | 1                                    |
| availability_zone                     | None                                 |
| created_at                            | 2022-02-07T13:37:39.000000           |
| status                                | creating                             |
| name                                  | None                                 |
| description                           | None                                 |
| project_id                            | e50b293b17a44811ab55fd3df25f43d1     |
| snapshot_id                           | None                                 |
| share_network_id                      | None                                 |
| share_proto                           | NFS                                  |
| metadata                              | {}                                   |
| share_type                            | None                                 |
| is_public                             | False                                |
| snapshot_support                      | False                                |
| task_state                            | None                                 |
| share_type_name                       | None                                 |
| access_rules_status                   | active                               |
| replication_type                      | None                                 |
| has_replicas                          | False                                |
| user_id                               | fdc9015ed3b34a72aabca483d32a14d0     |
| create_share_from_snapshot_support    | False                                |
| revert_to_snapshot_support            | False                                |
| share_group_id                        | None                                 |
| source_share_group_snapshot_member_id | None                                 |
| mount_snapshot_support                | False                                |
| share_server_id                       | None                                 |
| host                                  |                                      |
+---------------------------------------+--------------------------------------+
(overcloud) [stack@undercloud-0 ~]$ manila list
+--------------------------------------+------+------+-------------+--------+-----------+-----------------+------+-------------------+
| ID                                   | Name | Size | Share Proto | Status | Is Public | Share Type Name | Host | Availability Zone |
+--------------------------------------+------+------+-------------+--------+-----------+-----------------+------+-------------------+
| dd33f6a0-a9ee-458e-9a78-741eed5b316b | None | 1    | NFS         | error  | False     | None            |      | None              |
+--------------------------------------+------+------+-------------+--------+-----------+-----------------+------+-------------------+
(overcloud) [stack@undercloud-0 ~]$ manila help create
usage: manila create [--snapshot-id <snapshot-id>] [--name <name>]
                     [--metadata [<key=value> [<key=value> ...]]]
                     [--share-network <network-info>]
                     [--description <description>] [--share-type <share-type>]
                     [--public] [--availability-zone <availability-zone>]
                     [--share-group <share-group>]
                     <share_protocol> <size>

Creates a new share (NFS, CIFS, CephFS, GlusterFS, HDFS or MAPRFS).

Positional arguments:
  <share_protocol>      Share protocol (NFS, CIFS, CephFS, GlusterFS, HDFS or
                        MAPRFS).
  <size>                Share size in GiB.

Optional arguments:
  --snapshot-id <snapshot-id>, --snapshot_id <snapshot-id>
                        Optional snapshot ID to create the share from.
                        (Default=None)
  --name <name>         Optional share name. (Default=None)
  --metadata [<key=value> [<key=value> ...]]
                        Metadata key=value pairs (Optional, Default=None).
  --share-network <network-info>, --share_network <network-info>
                        Optional network info ID or name.
  --description <description>
                        Optional share description. (Default=None)
  --share-type <share-type>, --share_type <share-type>, --volume-type <share-type>, --volume_type <share-type>
                        Optional share type. Use of optional volume type is
                        deprecated. (Default=None)
  --public              Level of visibility for share. Defines whether other
                        tenants are able to see it or not. (Default=False)
  --availability-zone <availability-zone>, --availability_zone <availability-zone>, --az <availability-zone>
                        Availability zone in which share should be created.
  --share-group <share-group>, --share_group <share-group>, --group <share-group>
                        Optional share group name or ID in which to create the
                        share (Experimental, Default=None).

Comment 21 Goutham Pacha Ravi 2022-02-08 00:30:12 UTC
Liron, 

I don't see:

 $ manila message-list --resource dd33f6a0-a9ee-458e-9a78-741eed5b316b

in the verification steps. Did you try it?

Comment 22 lkuchlan 2022-02-08 09:46:36 UTC
(In reply to Goutham Pacha Ravi from comment #21)
> Liron, 
> 
> I don't see:
> 
>  $ manila message-list --resource dd33f6a0-a9ee-458e-9a78-741eed5b316b
> 
> in the verification steps. Did you try it?

Indeed we see the error message, as you can see:

(overcloud) [stack@undercloud-0 ~]$ manila message-list --resource dd33f6a0-a9ee-458e-9a78-741eed5b316b
+--------------------------------------+---------------+--------------------------------------+-----------+-----------------------------------------------------------------------------------------------------------+-----------+----------------------------+
| ID                                   | Resource Type | Resource ID                          | Action ID | User Message                                                                                              | Detail ID | Created At                 |
+--------------------------------------+---------------+--------------------------------------+-----------+-----------------------------------------------------------------------------------------------------------+-----------+----------------------------+
| 98009281-b0ca-49ae-8687-6892e23badd3 | SHARE         | dd33f6a0-a9ee-458e-9a78-741eed5b316b | 002       | create: No default share type has been made available. You must specify a share type for creating shares. | 024       | 2022-02-07T13:37:40.000000 |
+--------------------------------------+---------------+--------------------------------------+-----------+-----------------------------------------------------------------------------------------------------------+-----------+----------------------------+

But I thought in addition we were expecting an error message in CLI without creating the share.

Comment 25 Goutham Pacha Ravi 2022-02-08 17:36:58 UTC
(In reply to lkuchlan from comment #22)
> (In reply to Goutham Pacha Ravi from comment #21)
> But I thought in addition we were expecting an error message in CLI without
> creating the share.


This part wasn't done; it'll need a separate BZ because python-manilaclient is a different component; per c#9 however, the *must*-have portion of the fix has been committed. Don't you think we can get this BZ with that?

Comment 27 OSP Team 2022-05-12 10:37:12 UTC
According to our records, this should be resolved by openstack-manila-9.1.6-2.20220111161349.2cebaa9.el8ost.  This build is available now.

Comment 30 lkuchlan 2022-05-18 06:40:18 UTC
Hi Goutham,

I tested it using openstack-manila-9.1.6-2.20220407135644.9e27715.el8ost.noarch
There is no a CLI error notification.

I didn't see the below fix is included:
https://review.opendev.org/c/openstack/python-manilaclient/+/835891

Comment 31 Goutham Pacha Ravi 2022-05-18 12:56:18 UTC
(In reply to lkuchlan from comment #30)
> Hi Goutham,
> 
> I tested it using
> openstack-manila-9.1.6-2.20220407135644.9e27715.el8ost.noarch
> There is no a CLI error notification.
> 
> I didn't see the below fix is included:
> https://review.opendev.org/c/openstack/python-manilaclient/+/835891

Hi Liron, 

The CLI fix you're referring to is associated with https://bugzilla.redhat.com/show_bug.cgi?id=2052585 
That bug is still in post. As python-manilaclient is no longer released for stable/train upstream, a manual update in RDO was warranted: https://review.rdoproject.org/r/c/rdoinfo/+/41895 - but it landed pretty recently.

So the client BZ has moved to z4. 

Seeing Comment #22, shouldn't we move this to VERIFIED?

Comment 32 lkuchlan 2022-05-18 13:16:53 UTC
(In reply to Goutham Pacha Ravi from comment #31)
> (In reply to lkuchlan from comment #30)
> > Hi Goutham,
> > 
> > I tested it using
> > openstack-manila-9.1.6-2.20220407135644.9e27715.el8ost.noarch
> > There is no a CLI error notification.
> > 
> > I didn't see the below fix is included:
> > https://review.opendev.org/c/openstack/python-manilaclient/+/835891
> 
> Hi Liron, 
> 
> The CLI fix you're referring to is associated with
> https://bugzilla.redhat.com/show_bug.cgi?id=2052585 
> That bug is still in post. As python-manilaclient is no longer released for
> stable/train upstream, a manual update in RDO was warranted:
> https://review.rdoproject.org/r/c/rdoinfo/+/41895 - but it landed pretty
> recently.
> 
> So the client BZ has moved to z4. 
> 
> Seeing Comment #22, shouldn't we move this to VERIFIED?

Moving it to VERIFIED.

Comment 33 lkuchlan 2022-05-18 13:18:02 UTC
Tested it using openstack-manila-9.1.6-2.20220407135644.9e27715.el8ost.noarch

Verification steps:

(overcloud) [stack@undercloud-0 ~]$ manila create nfs 1
+---------------------------------------+--------------------------------------+
| Property                              | Value                                |
+---------------------------------------+--------------------------------------+
| id                                    | 61ad0b3d-6c48-432a-a5c0-23e39035c671 |
| size                                  | 1                                    |
| availability_zone                     | None                                 |
| created_at                            | 2022-05-18T13:14:53.000000           |
| status                                | creating                             |
| name                                  | None                                 |
| description                           | None                                 |
| project_id                            | 92a0658d726546b1a63dc0badd972ef8     |
| snapshot_id                           | None                                 |
| share_network_id                      | None                                 |
| share_proto                           | NFS                                  |
| metadata                              | {}                                   |
| share_type                            | None                                 |
| is_public                             | False                                |
| snapshot_support                      | False                                |
| task_state                            | None                                 |
| share_type_name                       | None                                 |
| access_rules_status                   | active                               |
| replication_type                      | None                                 |
| has_replicas                          | False                                |
| user_id                               | 13396dce63c340d895a1916345522ce7     |
| create_share_from_snapshot_support    | False                                |
| revert_to_snapshot_support            | False                                |
| share_group_id                        | None                                 |
| source_share_group_snapshot_member_id | None                                 |
| mount_snapshot_support                | False                                |
| share_server_id                       | None                                 |
| host                                  |                                      |
+---------------------------------------+--------------------------------------+
(overcloud) [stack@undercloud-0 ~]$ manila list
+--------------------------------------+------+------+-------------+--------+-----------+-----------------+------+-------------------+
| ID                                   | Name | Size | Share Proto | Status | Is Public | Share Type Name | Host | Availability Zone |
+--------------------------------------+------+------+-------------+--------+-----------+-----------------+------+-------------------+
| 61ad0b3d-6c48-432a-a5c0-23e39035c671 | None | 1    | NFS         | error  | False     | None            |      | None              |
+--------------------------------------+------+------+-------------+--------+-----------+-----------------+------+-------------------+
(overcloud) [stack@undercloud-0 ~]$ manila message-list --resource 61ad0b3d-6c48-432a-a5c0-23e39035c671
+--------------------------------------+---------------+--------------------------------------+-----------+-----------------------------------------------------------------------------------------------------------+-----------+----------------------------+
| ID                                   | Resource Type | Resource ID                          | Action ID | User Message                                                                                              | Detail ID | Created At                 |
+--------------------------------------+---------------+--------------------------------------+-----------+-----------------------------------------------------------------------------------------------------------+-----------+----------------------------+
| be9a6e54-3d7d-4d3d-95ab-fd5f04ac1709 | SHARE         | 61ad0b3d-6c48-432a-a5c0-23e39035c671 | 002       | create: No default share type has been made available. You must specify a share type for creating shares. | 024       | 2022-05-18T13:14:53.000000 |
+--------------------------------------+---------------+--------------------------------------+-----------+-----------------------------------------------------------------------------------------------------------+-----------+----------------------------+