create snapshot failed due to absent of snapshot['share_id']

Bug #1697581 reported by Peter Wang
10
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Critical
Valeriy Ponomaryov

Bug Description

Recently, we met consistently failure in VNX/Unity manila CI.

When creating snapshot, drivers are expecting the snapshot['share_id'], but currently it's always None:

VNX driver code:

    def create_snapshot(self, context, snapshot, share_server=None):
        """Create snapshot from share."""
        share_name = snapshot['share_id']
        share_proto = snapshot['share']['share_proto']

DEBUG LOG:
==============================
2017-06-12 23:11:16.715 27653 INFO manila.share.manager [req-4a19d23b-8a8c-4563-afeb-2bd391fe3e3d - - - - -] Finished initialization of driver: 'EMCShareDriver@unityslavevm2@london'
2017-06-12 23:12:07.401 27653 DEBUG manila.share.drivers.dell_emc.plugins.vnx.utils [req-5309f678-f1c2-4912-a21a-5099e25e268f d664a8090aa7429288a433448b051ca1 ddea0cc380514c41b2a001b94f41997a - - -] Entering UnityStorageConnection.create_snapshot. inner /opt/stack/new/manila/manila/share/drivers/dell_emc/plugins/vnx/utils.py:49
> /opt/stack/new/manila/manila/share/drivers/dell_emc/plugins/unity/connection.py(272)create_snapshot()
-> share_name = snapshot['share_id']
(Pdb) l
267 reason=reason)
268
269 def create_snapshot(self, context, snapshot, share_server=None):
270 """Create snapshot from share."""
271 import pdb;pdb.set_trace()
272 -> share_name = snapshot['share_id']
273 share_proto = snapshot['share']['share_proto']
274 backend_share = self.client.get_share(share_name, share_proto)
275
276 snapshot_name = snapshot['id']
277 if self._is_share_from_snapshot(backend_share):
(Pdb) snapshot
{'status': u'creating', 'share_id': None, 'share_name': u'CI-a8bbba04-be25-4b74-9695-42d3f2eab500', 'deleted': u'False', 'share': <manila.db.sqlalchemy.models.ShareInstance object at 0x7f6371445b10>, 'updated_at': None, 'provider_location': None, 'snapshot_id': u'22897723-8c53-42e2-a9c0-a437c6ec1d79', 'deleted_at': None, 'id': u'755b21ce-4063-4df4-a6b4-784f388d55bc', 'name': u'share-snapshot-755b21ce-4063-4df4-a6b4-784f388d55bc', 'created_at': datetime.datetime(2017, 6, 13, 3, 12, 7), 'share_instance_id': u'a8bbba04-be25-4b74-9695-42d3f2eab500', 'progress': u'0%'}
(Pdb) snapshot['share_id']
(Pdb) snapshot.share_id
*** AttributeError: 'dict' object has no attribute 'share_id'
(Pdb) snapshot['share']
<manila.db.sqlalchemy.models.ShareInstance object at 0x7f6371445b10>
(Pdb) snapshot['share'].id
u'a8bbba04-be25-4b74-9695-42d3f2eab500'

(Pdb) snapshot['share'].share_id
u'a989bea0-2a1e-4ddb-a8d0-ace1414ce5d1'

DB:
mysql> select * from share_snapshot_instances where id='755b21ce-4063-4df4-a6b4-784f388d55bc';
+---------------------+------------+------------+---------+--------------------------------------+--------------------------------------+--------------------------------------+----------+----------+-------------------+---------+------------+------+-------------+----------+-------------------------+
| created_at | updated_at | deleted_at | deleted | id | snapshot_id | share_instance_id | status | progress | provider_location | user_id | project_id | size | share_proto | share_id | share_group_snapshot_id |
+---------------------+------------+------------+---------+--------------------------------------+--------------------------------------+--------------------------------------+----------+----------+-------------------+---------+------------+------+-------------+----------+-------------------------+
| 2017-06-13 03:12:07 | NULL | NULL | False | 755b21ce-4063-4df4-a6b4-784f388d55bc | 22897723-8c53-42e2-a9c0-a437c6ec1d79 | a8bbba04-be25-4b74-9695-42d3f2eab500 | creating | 0% | NULL | NULL | NULL | NULL | NULL | NULL | NULL |
+---------------------+------------+------------+---------+--------------------------------------+--------------------------------------+--------------------------------------+----------+----------+-------------------+---------+------------+------+-------------+----------+-------------------------+
1 row in set (0.00 sec)

==================
We can see the share_id is not populated by manila

This should be a regression in manila, or all drivers need to be updated.

Please advise.

Thanks
Peter

Revision history for this message
Xing Yang (xing-yang) wrote :

The "share_id" property was removed from ShareSnapshotInstance in the following patch. As a result, drivers referencing "share_id" ran into this problem because it is not populated any more.

https://review.openstack.org/#/c/433854/12/manila/db/sqlalchemy/models.py

The "share_id" property was a temporary fix for backward compatibility when "Instance" was introduced. "share_instance_id" should be the right one to use.

Changed in manila:
status: New → Confirmed
Xing Yang (xing-yang)
Changed in manila:
importance: Undecided → High
importance: High → Critical
Xing Yang (xing-yang)
Changed in manila:
assignee: nobody → EMC VNX OpenStack (emc-vnx-openstack)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.openstack.org/473864

Changed in manila:
assignee: EMC VNX OpenStack (emc-vnx-openstack) → Valeriy Ponomaryov (vponomaryov)
status: Confirmed → In Progress
Changed in manila:
milestone: none → pike-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.openstack.org/473864
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=160a9a113e93a2464976375a82f484684a236ac9
Submitter: Jenkins
Branch: master

commit 160a9a113e93a2464976375a82f484684a236ac9
Author: Valeriy Ponomaryov <email address hidden>
Date: Thu Jun 15 17:51:50 2017 +0300

    Fix ShareSnapshotInstance DB table

    removing redundant column "share_id" and making it proxy to
    "share_instance_id" as it was prior to merge of [1].
    It is redundant because there is only one place, in manila, where it is
    used, but used without real need.

    [1] I81ba26437554d02a79e4b536d781617f46ce2f07

    Change-Id: I4ee14cf89b8882941974741da311f4556e604116
    Closes-Bug: #1697581

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

This issue was fixed in the openstack/manila 5.0.0.0b3 development milestone.

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.