share group snapshot failing on the LVM driver

Bug #1888905 reported by Goutham Pacha Ravi on 2020-07-24
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Low
Goutham Pacha Ravi

Bug Description

Description
===========
The LVM driver fails to create a group snapshot. It does not have a driver-specific implementation for creating group snapshots (does not implement driver method "create_share_group_snapshot"), so a default/driver agnostic approach is utilized as coded into the base driver. The default approach [1] invokes "create_snapshot" across share group members. The LVM driver fails to create individual snapshots because it relies on a share snapshot attribute that's not passed it:

    manila-share[29458]: DEBUG manila.share.driver [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Attempting to create a share group snapshot f1a0f792-391c-46c4-bfa0-003f4c194c46. {{(pid=30113) create_share_group_snapshot /opt/stack/new/manila/manila/share/driver.py:1586}}
    manila-share[29458]: ERROR manila.share.manager [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Share group snapshot f1a0f792-391c-46c4-bfa0-003f4c194c46: create failed
    sudo[20667]: pam_unix(sudo:session): session closed for user root
    manila-share[29458]: ERROR oslo_messaging.rpc.server [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Exception during message handling: KeyError: 'share_name'
    manila-share[29458]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
    manila-share[29458]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 273, in dispatch
    manila-share[29458]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 193, in _do_dispatch
    manila-share[29458]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/utils.py", line 568, in wrapper
    manila-share[29458]: ERROR oslo_messaging.rpc.server return func(self, *args, **kwargs)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/manager.py", line 4310, in create_share_group_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server share_group_snapshot_id)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
    manila-share[29458]: ERROR oslo_messaging.rpc.server self.force_reraise()
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
    manila-share[29458]: ERROR oslo_messaging.rpc.server six.reraise(self.type_, self.value, self.tb)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/six.py", line 703, in reraise
    manila-share[29458]: ERROR oslo_messaging.rpc.server raise value
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/manager.py", line 4251, in create_share_group_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server context, snap_ref, share_server=share_server))
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/driver.py", line 1612, in create_share_group_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server context, share_snapshot, share_server=share_server)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/drivers/lvm.py", line 421, in create_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server self._create_snapshot(context, snapshot)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/drivers/lvm.py", line 119, in _create_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server snapshot['share_name'])
    manila-share[29458]: ERROR oslo_messaging.rpc.server KeyError: 'share_name'
    manila-share[29458]: ERROR oslo_messaging.rpc.server

Steps to reproduce
==================

A chronological list of steps which will help reproduce the issue you hit:
* Setup manila with the LVM backend: https://docs.openstack.org/manila/latest/_downloads/42245fd942d8a3ac38aa3aebbc9c2ad1/lvm_local.conf
* Create a share type

     manila type-create default False

* Create a share group type

    manila share-group-type-create default default

* Create a share group

    manila share-group-create --name test-share-group --share-types default --share-group-type default

* Create a share within the group

   manila create nfs 1 --share-group test-share-group --name test-group-share-1

* Create a share group snapshot

   manila share-group-snapshot-create test-share-group --name test-group-snapshot

* Check the snapshot status, it would be in error:

   manila share-group-snapshot-list
    +--------------------------------------+---------------------+--------+-------------+
    | id | name | status | description |
    +--------------------------------------+---------------------+--------+-------------+
    | 7d96531a-c201-4526-a4d6-703effe4824d | test-group-snapshot | error | None |
    +--------------------------------------+---------------------+--------+-------------+

Check the manila log, and you'll see an error like this:

    manila-share[29458]: DEBUG manila.share.driver [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Attempting to create a share group snapshot 7d96531a-c201-4526-a4d6-703effe4824d. {{(pid=30113) create_share_group_snapshot /opt/stack/new/manila/manila/share/driver.py:1586}}
    manila-share[29458]: ERROR manila.share.manager [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Share group snapshot 7d96531a-c201-4526-a4d6-703effe4824d: create failed
    sudo[20667]: pam_unix(sudo:session): session closed for user root
    manila-share[29458]: ERROR oslo_messaging.rpc.server [None req-3ba98793-5b2d-4d02-b099-a77b7793bd6c None None] Exception during message handling: KeyError: 'share_name'
    manila-share[29458]: ERROR oslo_messaging.rpc.server Traceback (most recent call last):
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
    manila-share[29458]: ERROR oslo_messaging.rpc.server res = self.dispatcher.dispatch(message)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 273, in dispatch
    manila-share[29458]: ERROR oslo_messaging.rpc.server return self._do_dispatch(endpoint, method, ctxt, args)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_messaging/rpc/dispatcher.py", line 193, in _do_dispatch
    manila-share[29458]: ERROR oslo_messaging.rpc.server result = func(ctxt, **new_args)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/utils.py", line 568, in wrapper
    manila-share[29458]: ERROR oslo_messaging.rpc.server return func(self, *args, **kwargs)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/manager.py", line 4310, in create_share_group_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server share_group_snapshot_id)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
    manila-share[29458]: ERROR oslo_messaging.rpc.server self.force_reraise()
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
    manila-share[29458]: ERROR oslo_messaging.rpc.server six.reraise(self.type_, self.value, self.tb)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/usr/local/lib/python3.6/dist-packages/six.py", line 703, in reraise
    manila-share[29458]: ERROR oslo_messaging.rpc.server raise value
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/manager.py", line 4251, in create_share_group_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server context, snap_ref, share_server=share_server))
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/driver.py", line 1612, in create_share_group_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server context, share_snapshot, share_server=share_server)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/drivers/lvm.py", line 421, in create_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server self._create_snapshot(context, snapshot)
    manila-share[29458]: ERROR oslo_messaging.rpc.server File "/opt/stack/new/manila/manila/share/drivers/lvm.py", line 119, in _create_snapshot
    manila-share[29458]: ERROR oslo_messaging.rpc.server snapshot['share_name'])
    manila-share[29458]: ERROR oslo_messaging.rpc.server KeyError: 'share_name'
    manila-share[29458]: ERROR oslo_messaging.rpc.server

Environment
===========
1. Exact version of OpenStack Manila you are running: main/trunk branch

2. Which storage backend did you use? LVM

3. Which networking type did you use? N/A

[1] https://opendev.org/openstack/manila/src/commit/8cccb73f46df763f907171e63d960fb1e6a81fd0/manila/share/driver.py#L1535-L1636

Fix proposed to branch: master
Review: https://review.opendev.org/743009

Changed in manila:
assignee: nobody → Goutham Pacha Ravi (gouthamr)
status: New → In Progress
Changed in manila:
importance: Undecided → Low
milestone: none → victoria-2

Reviewed: https://review.opendev.org/743009
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=a398743264023660c1c6dc441a9847ba9a3cabfa
Submitter: Zuul
Branch: master

commit a398743264023660c1c6dc441a9847ba9a3cabfa
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jul 24 15:56:57 2020 -0700

    Fix fallback share group snapshot implementation

    When a share driver does not provide the capability
    to create share group snapshots, the share manager
    iterates over the shares in the group and invokes the
    driver method to snapshot the shares. However, the
    create and delete routines in this fallback path
    did not include some attributes necessary for the
    operation in many drivers.

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

Changed in manila:
status: In Progress → Fix Released

Reviewed: https://review.opendev.org/743675
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=e49075dfee4c586ea024b14005f65b8d52bd3cc4
Submitter: Zuul
Branch: stable/ussuri

commit e49075dfee4c586ea024b14005f65b8d52bd3cc4
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jul 24 15:56:57 2020 -0700

    Fix fallback share group snapshot implementation

    When a share driver does not provide the capability
    to create share group snapshots, the share manager
    iterates over the shares in the group and invokes the
    driver method to snapshot the shares. However, the
    create and delete routines in this fallback path
    did not include some attributes necessary for the
    operation in many drivers.

    Change-Id: Id5a9467247df1d8f0ec6dee3fae842ba673c34ed
    Closes-Bug: #1888905
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit a398743264023660c1c6dc441a9847ba9a3cabfa)

tags: added: in-stable-ussuri

Reviewed: https://review.opendev.org/743856
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=4ac14e017ba079795071592b7493c7f8b3e9ac8f
Submitter: Zuul
Branch: stable/train

commit 4ac14e017ba079795071592b7493c7f8b3e9ac8f
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jul 24 15:56:57 2020 -0700

    Fix fallback share group snapshot implementation

    When a share driver does not provide the capability
    to create share group snapshots, the share manager
    iterates over the shares in the group and invokes the
    driver method to snapshot the shares. However, the
    create and delete routines in this fallback path
    did not include some attributes necessary for the
    operation in many drivers.

    Change-Id: Id5a9467247df1d8f0ec6dee3fae842ba673c34ed
    Closes-Bug: #1888905
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit a398743264023660c1c6dc441a9847ba9a3cabfa)
    (cherry picked from commit e49075dfee4c586ea024b14005f65b8d52bd3cc4)

tags: added: in-stable-train

Reviewed: https://review.opendev.org/744081
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=edab20c26fbe2d7908772409f4a412c055910b04
Submitter: Zuul
Branch: stable/stein

commit edab20c26fbe2d7908772409f4a412c055910b04
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jul 24 15:56:57 2020 -0700

    Fix fallback share group snapshot implementation

    When a share driver does not provide the capability
    to create share group snapshots, the share manager
    iterates over the shares in the group and invokes the
    driver method to snapshot the shares. However, the
    create and delete routines in this fallback path
    did not include some attributes necessary for the
    operation in many drivers.

    Change-Id: Id5a9467247df1d8f0ec6dee3fae842ba673c34ed
    Closes-Bug: #1888905
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit a398743264023660c1c6dc441a9847ba9a3cabfa)
    (cherry picked from commit e49075dfee4c586ea024b14005f65b8d52bd3cc4)
    (cherry picked from commit 4ac14e017ba079795071592b7493c7f8b3e9ac8f)

tags: added: in-stable-stein

Reviewed: https://review.opendev.org/744231
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=4dff4e37c237fb196700a98b08bd3843000b01f4
Submitter: Zuul
Branch: stable/rocky

commit 4dff4e37c237fb196700a98b08bd3843000b01f4
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jul 24 15:56:57 2020 -0700

    Fix fallback share group snapshot implementation

    When a share driver does not provide the capability
    to create share group snapshots, the share manager
    iterates over the shares in the group and invokes the
    driver method to snapshot the shares. However, the
    create and delete routines in this fallback path
    did not include some attributes necessary for the
    operation in many drivers.

    Change-Id: Id5a9467247df1d8f0ec6dee3fae842ba673c34ed
    Closes-Bug: #1888905
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit a398743264023660c1c6dc441a9847ba9a3cabfa)
    (cherry picked from commit e49075dfee4c586ea024b14005f65b8d52bd3cc4)
    (cherry picked from commit 4ac14e017ba079795071592b7493c7f8b3e9ac8f)
    (cherry picked from commit edab20c26fbe2d7908772409f4a412c055910b04)

tags: added: in-stable-rocky

Reviewed: https://review.opendev.org/744390
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=28f0e841911a6dbc0d8d414680e9cdab61f4a187
Submitter: Zuul
Branch: stable/queens

commit 28f0e841911a6dbc0d8d414680e9cdab61f4a187
Author: Goutham Pacha Ravi <email address hidden>
Date: Fri Jul 24 15:56:57 2020 -0700

    Fix fallback share group snapshot implementation

    When a share driver does not provide the capability
    to create share group snapshots, the share manager
    iterates over the shares in the group and invokes the
    driver method to snapshot the shares. However, the
    create and delete routines in this fallback path
    did not include some attributes necessary for the
    operation in many drivers.

    Change-Id: Id5a9467247df1d8f0ec6dee3fae842ba673c34ed
    Closes-Bug: #1888905
    Signed-off-by: Goutham Pacha Ravi <email address hidden>
    (cherry picked from commit a398743264023660c1c6dc441a9847ba9a3cabfa)
    (cherry picked from commit e49075dfee4c586ea024b14005f65b8d52bd3cc4)
    (cherry picked from commit 4ac14e017ba079795071592b7493c7f8b3e9ac8f)
    (cherry picked from commit edab20c26fbe2d7908772409f4a412c055910b04)
    (cherry picked from commit 4dff4e37c237fb196700a98b08bd3843000b01f4)

tags: added: in-stable-queens
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers