Can't create a share from a snapshot with the snapshot name

Bug #1798229 reported by Goutham Pacha Ravi
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-manilaclient
Fix Released
Undecided
Luisa

Bug Description

Steps to reproduce:
------------------
0) Setup manila with a backend that supports snapshots and creating shares from snapshots (Ex: LVM, Dummy drivers)
1) Create a share type with extra-specs "snapshot_support=True" and "create_share_from_snapshot_support=True"
2) Create a share with the share type created in step 1
3) Create a snapshot of this share, name it "testsnap"
4) Attempt to create a share from this snapshot:

manila create nfs 1 --snapshot testsnap

Expected Result:
-----------------
Share gets created

Actual Result:
--------------
This error is shown:
ERROR: ShareSnapshotNotFound: Snapshot testsnap could not be found.

RCA:
---
When using the "--debug" switch to study the request, we see this:

$ manila --debug create nfs 1 --snapshot testsnap

<snip>
DEBUG (httpclient:192)
REQ: curl -i -X POST http://10.10.10.13:8786/v2/5332f831ce1c4aebb295ad4bd4a9cd2f/shares -H "X-Openstack-Manila-Api-Version: 2.46" -H "X-Auth-Token: gAAAAABbxonsLHr_xZONqCsPieSzaX2YbrdNMZFxRgISe2QZb8-BLchAuBUXroWWE7vWviqWmyCZylnL6w26J2zFWzjncJ6c-3oLHO-P77SkDXI4OqGPkJW2RBcDwePfP8HT1F7gCwvA-MRYGvU8bYLjDzHWLlhb4svetHz4uBBNU0nNRuoPcso" -H "Content-Type: application/json" -H "Accept: application/json" -H "User-Agent: python-manilaclient" -d '{"share": {"name": null, "share_type": null, "snapshot_id": "testsnap", "availability_zone": null, "is_public": false, "description": null, "metadata": {}, "share_proto": "nfs", "share_network_id": null, "size": 1}}'

DEBUG (connectionpool:205) Starting new HTTP connection (1): 10.10.10.13:8786
DEBUG (connectionpool:393) http://10.10.10.13:8786 "POST /v2/5332f831ce1c4aebb295ad4bd4a9cd2f/shares HTTP/1.1" 404 106
RESP: [404] {'Content-Length': '106', 'x-compute-request-id': 'req-10720cdf-a50a-43aa-9470-1c05dd4f26f6', 'Vary': 'X-OpenStack-Manila-API-Version', 'Connection': 'close', 'Server': 'Apache/2.4.29 (Ubuntu)', 'X-OpenStack-Manila-API-Version': '2.46', 'Date': 'Wed, 17 Oct 2018 01:01:32 GMT', 'Content-Type': 'application/json'}
RESP BODY: {"itemNotFound": {"message": "ShareSnapshotNotFound: Snapshot testsnap could not be found.", "code": 404}}

DEBUG (httpclient:201) RESP: [404] {'Content-Length': '106', 'x-compute-request-id': 'req-10720cdf-a50a-43aa-9470-1c05dd4f26f6', 'Vary': 'X-OpenStack-Manila-API-Version', 'Connection': 'close', 'Server': 'Apache/2.4.29 (Ubuntu)', 'X-OpenStack-Manila-API-Version': '2.46', 'Date': 'Wed, 17 Oct 2018 01:01:32 GMT', 'Content-Type': 'application/json'}
RESP BODY: {"itemNotFound": {"message": "ShareSnapshotNotFound: Snapshot testsnap could not be found.", "code": 404}}

As observed, the client is not converting the name to the snapshot's ID before sending the share creation request

tags: added: low-hanging-fruit
Changed in python-manilaclient:
assignee: nobody → Victoria Martinez de la Cruz (vkmc)
Changed in python-manilaclient:
assignee: Victoria Martinez de la Cruz (vkmc) → Luisa (rfluisa)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to python-manilaclient (master)
Changed in python-manilaclient:
status: New → In Progress
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/+/801866
Committed: https://opendev.org/openstack/python-manilaclient/commit/616f3acf607506b8f3e7fc4a55696c36abdc4e4e
Submitter: "Zuul (22348)"
Branch: master

commit 616f3acf607506b8f3e7fc4a55696c36abdc4e4e
Author: Luisa Ferraz do Amaral <email address hidden>
Date: Thu Jul 22 11:53:30 2021 -0300

    Fix issue while creating share from snapshot

    Fixed the issue that didn't allow users to create share from
    snapshot when the snapshot name was specified instead of the id.

    Now, the manila client will search for snapshots regardless if the
    name or id of the snapshot was specified.

    Closes-Bug: #1798229
    Change-Id: I2b29b6d2ba232aa390e7c3708ee589c82e3e7e72

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 3.0.0

This issue was fixed in the openstack/python-manilaclient 3.0.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.