Pure create CG from CG snapshot fails with Purity REST API 1.4

Bug #1494934 reported by Patrick East
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
Undecided
Patrick East

Bug Description

When attempting to create a consistency group from a source cg snapshot we get an error like:

2015-09-11 18:47:23.410 ERROR cinder.volume.manager [req-0d03d212-29fc-4686-8a8c-31487a1423d8 8741461961254a989ccd77e10aa3038e 60cef5a407804930a7c599c41fad01da] Create consistency group from source snapshot-477c27f3-238e-43f2-aaa5-c48d7801cfb2 failed.
2015-09-11 18:47:23.500 ERROR oslo_messaging.rpc.dispatcher [req-0d03d212-29fc-4686-8a8c-31487a1423d8 8741461961254a989ccd77e10aa3038e 60cef5a407804930a7c599c41fad01da] Exception during message handling: (PureHTTPError(),)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 142, in _dispatch_and_reply
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher executor_callback))
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher executor_callback)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/manager.py", line 2465, in create_consistencygroup_from_src
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher context, vol['id'], {'status': 'error'})
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 195, in __exit__
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/manager.py", line 2437, in create_consistencygroup_from_src
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher sorted_snapshots, source_cg, sorted_source_vols))
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/drivers/pure.py", line 75, in wrapper
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher result = f(*args, **kwargs)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/drivers/pure.py", line 394, in create_consistencygroup_from_src
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher snapshots)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/drivers/pure.py", line 352, in _create_cg_from_cgsnap
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher self.create_volume_from_snapshot(volume, snapshot)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/drivers/pure.py", line 75, in wrapper
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher result = f(*args, **kwargs)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/drivers/pure.py", line 135, in create_volume_from_snapshot
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher snap_name = self._get_pgroup_snap_name_from_snapshot(snapshot)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/volume/drivers/pure.py", line 704, in _get_pgroup_snap_name_from_snapshot
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher pg_snaps = self._array.list_volumes(snap=True, pgroup=True)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/purestorage/purestorage.py", line 543, in list_volumes
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher return self._request("GET", "volume", kwargs)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/purestorage/purestorage.py", line 131, in _request
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher raise PureHTTPError(self._target, self._rest_version, response)
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher PureHTTPError: PureHTTPError status code 400 returned by REST version 1.4 at cinder-fa1.dev.purestorage.com: BAD REQUEST
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher {"msg": ["Argument pgroup is not a valid parameter name."]}
2015-09-11 18:47:23.500 TRACE oslo_messaging.rpc.dispatcher

This actually looks like creating volumes from *any* cgsnapshot would fail. Unfortunately this only is a problem in v1.4 of the Purity REST API where that parameter was removed.

Changed in cinder:
assignee: nobody → Patrick East (patrick-east)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to cinder (master)

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

Changed in cinder:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

Reviewed: https://review.openstack.org/222788
Committed: https://git.openstack.org/cgit/openstack/cinder/commit/?id=d2170a9e13047ea9a05ed78c4e6da61a5dfc46e2
Submitter: Jenkins
Branch: master

commit d2170a9e13047ea9a05ed78c4e6da61a5dfc46e2
Author: Patrick East <email address hidden>
Date: Fri Sep 11 14:12:03 2015 -0700

    Fix Pure get pgroup volume snapshot name

    When creating a volume from a consistency group snapshot we have to go
    look up the volume level snapshot from the group. Previously we could
    just directly get to the cgsnapshot model from the snapshot. After we
    switched to using the snapshot objects however we cannot do that (at
    least not until we have cgsnapshot objects too).

    As an interim solution we did a query to the REST API on the array to
    just list all of the snapshots. Unfortunately that doesn’t work on all
    versions of the Purity REST API. To have a more usable solution we need
    to do a db lookup to get the pgsnapshot.

    It’s not ideal, and will be removed ASAP, but for now we need to at
    least not regress in functionality.

    Change-Id: I73a4ad5883bf33ce282b5a49aa8acba66ffcb84f
    Closes-Bug: #1494934

Changed in cinder:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in cinder:
milestone: none → liberty-rc1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in cinder:
milestone: liberty-rc1 → 7.0.0
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.