Create share from snapshot command failed when share type is not specified - HTTP 400

Bug #1980985 reported by Vida Haririan
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
manila-ui
Invalid
Undecided
Unassigned
python-manilaclient
Fix Released
Medium
Goutham Pacha Ravi

Bug Description

Create share from snapshot command failed when share type is not specified

Per the command line help: If a share type is not specified when requesting a new share from a snapshot, the share type of the source share will be applied to the new share.

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

How reproducible:
100%

Steps to Reproduce:
1. Create share type sup-snapshot
2. Create a share using type sup-snapshot
3. Create snapshot of share in step 2
4. Create a new share from snapshot in step 4

Actual results:
Share creation fails due to share type not explicitly specified

Expected results:
Expected the share type of the source share will be applied to the new share.

Additional info:
Share creation succeeded When share type was specified

Screen captures below:
(overcloud) [stack@undercloud-0 ~]$ openstack share type create sup-snapshot false --extra-specs --create-share-from-snapshot-support=True --snapshot-support=True
+----------------------+-------------------------------------------+
| Field | Value |
+----------------------+-------------------------------------------+
| id | 5e232f46-63d3-4757-b2b6-aebe7f19bbd6 |
| name | sup-snapshot |
| visibility | public |
| is_default | False |
| required_extra_specs | driver_handles_share_servers : False |
| optional_extra_specs | snapshot_support : True |
| | create_share_from_snapshot_support : True |
| description | None |
+----------------------+-------------------------------------------+
(overcloud) [stack@undercloud-0 ~]$ openstack share create nfs 1 --share-type sup-snapshot --name share1
+---------------------------------------+--------------------------------------+
| Field | Value |
+---------------------------------------+--------------------------------------+
| access_rules_status | active |
| availability_zone | None |
| create_share_from_snapshot_support | True |
| created_at | 2022-07-06T20:36:07.291591 |
| description | None |
| has_replicas | False |
| host | |
| id | 37e14ebd-9709-4c81-8986-4e8d57ad744a |
| is_public | False |
| metadata | {} |
| mount_snapshot_support | False |
| name | share1 |
| progress | None |
| project_id | 32fa480757b740c199eebd755ccc3537 |
| replication_type | None |
| revert_to_snapshot_support | False |
| share_group_id | None |
| share_network_id | None |
| share_proto | NFS |
| share_server_id | None |
| share_type | 5e232f46-63d3-4757-b2b6-aebe7f19bbd6 |
| share_type_name | sup-snapshot |
| size | 1 |
| snapshot_id | None |
| snapshot_support | True |
| source_share_group_snapshot_member_id | None |
| status | creating |
| task_state | None |
| user_id | a149175623a74fa88cae5805e17c36af |
| volume_type | sup-snapshot |
+---------------------------------------+--------------------------------------+
(overcloud) [stack@undercloud-0 ~]$ openstack share snapshot create share1
+-------------------+--------------------------------------+
| Field | Value |
+-------------------+--------------------------------------+
| created_at | 2022-07-06T20:36:17.617046 |
| description | None |
| id | 179605f5-2a59-426a-a3b1-8753ece02e99 |
| name | None |
| project_id | 32fa480757b740c199eebd755ccc3537 |
| provider_location | None |
| share_id | 37e14ebd-9709-4c81-8986-4e8d57ad744a |
| share_proto | NFS |
| share_size | 1 |
| size | 1 |
| status | creating |
| user_id | a149175623a74fa88cae5805e17c36af |
+-------------------+--------------------------------------+
(overcloud) [stack@undercloud-0 ~]$ openstack share create nfs 1 --snapshot-id 179605f5-2a59-426a-a3b1-8753ece02e99 --name sha-from-share1-snapshot-02e99
Invalid input received: Invalid share type specified: the requested share type must match the type of the source share. If a share type is not specified when requesting a new share from a snapshot, the share type of the source share will be applied to the new share. (HTTP 400) (Request-ID: req-27c8ca2d-c29d-43e2-9388-f96674bcd344)

# Share creation succeeded When share type was specified
(overcloud) [stack@undercloud-0 ~]$ openstack share create nfs 1 --snapshot-id 179605f5-2a59-426a-a3b1-8753ece02e99 --name sha-from-share1-snapshot-02e99 --share-type sup-snapshot
+---------------------------------------+--------------------------------------+
| Field | Value |
+---------------------------------------+--------------------------------------+
| access_rules_status | active |
| availability_zone | nova |
| create_share_from_snapshot_support | True |
| created_at | 2022-07-06T20:37:57.821859 |
| description | None |
| has_replicas | False |
| host | hostgroup@cephfs#cephfs |
| id | e815a31e-23bb-4d00-a019-31cfe5383863 |
| is_public | False |
| metadata | {} |
| mount_snapshot_support | False |
| name | sha-from-share1-snapshot-02e99 |
| progress | None |
| project_id | 32fa480757b740c199eebd755ccc3537 |
| replication_type | None |
| revert_to_snapshot_support | False |
| share_group_id | None |
| share_network_id | None |
| share_proto | NFS |
| share_server_id | None |
| share_type | 5e232f46-63d3-4757-b2b6-aebe7f19bbd6 |
| share_type_name | sup-snapshot |
| size | 1 |
| snapshot_id | 179605f5-2a59-426a-a3b1-8753ece02e99 |
| snapshot_support | True |
| source_share_group_snapshot_member_id | None |
| status | creating |
| task_state | None |
| user_id | a149175623a74fa88cae5805e17c36af |
| volume_type | sup-snapshot |
+---------------------------------------+--------------------------------------+

Changed in manila-ui:
status: New → Invalid
Changed in python-manilaclient:
importance: Undecided → High
assignee: nobody → Goutham Pacha Ravi (gouthamr)
importance: High → Medium
milestone: none → zed-2
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-manilaclient (master)
Changed in python-manilaclient:
status: New → In Progress
Changed in python-manilaclient:
milestone: zed-2 → zed-client-release
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to python-manilaclient (master)

Reviewed: https://review.opendev.org/c/openstack/python-manilaclient/+/849037
Committed: https://opendev.org/openstack/python-manilaclient/commit/06f7ea6255a4abafe7203ab6fc11609aabfbe9af
Submitter: "Zuul (22348)"
Branch: master

commit 06f7ea6255a4abafe7203ab6fc11609aabfbe9af
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jul 8 00:59:24 2022 +0530

    [OSC] Don't use default type with snapshot clones

    When creating a share with OSC, the client looks up the
    default share type when one is unspecified. However, one
    doesn't need to specify a share type when creating a share
    from a snapshot.

    Change-Id: I39984c2b953b16d2cdbc92ecaf5f3b701a33b283
    Closes-Bug: #1980985
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

Changed in python-manilaclient:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-manilaclient 4.1.0

This issue was fixed in the openstack/python-manilaclient 4.1.0 release.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.