Create Consistency Group with non-admin user failed

Bug #1495758 reported by Tina Tang
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Cinder
Fix Released
High
Xing Yang

Bug Description

When create Consistency Group with a non-admin user, below exception was thrown in Scheduler, and the creation will failed.

2015-09-14 06:26:12.906 ERROR oslo_messaging.rpc.dispatcher [req-f8be7576-86d5-4c09-9455-ebc99aa1499c demo] Exception during message handling: 'extra_specs'
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher Traceback (most recent call last):
2015-09-14 06:26:12.906 100959 ERROR 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-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher executor_callback))
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 186, in _dispatch
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher executor_callback)
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_messaging/rpc/dispatcher.py", line 129, in _do_dispatch
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher result = func(ctxt, **new_args)
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/osprofiler/profiler.py", line 105, in wrapper
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher return f(*args, **kwargs)
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/scheduler/manager.py", line 116, in create_consistencygroup
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher group.save()
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 195, in __exit__
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/scheduler/manager.py", line 103, in create_consistencygroup
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher filter_properties_list)
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/scheduler/filter_scheduler.py", line 71, in schedule_create_consistencygroup
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher filter_properties_list)
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/scheduler/filter_scheduler.py", line 421, in _schedule_group
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher filter_properties_list)
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher File "/opt/stack/cinder/cinder/scheduler/filter_scheduler.py", line 352, in _get_weighted_candidates_group
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher resource_type['extra_specs'].update(
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher KeyError: 'extra_specs'
2015-09-14 06:26:12.906 100959 ERROR oslo_messaging.rpc.dispatcher

This seems to be a regression of https://bugs.launchpad.net/cinder/+bug/1351971

How to reproduce: (Below step is for devstack enviornment)
1. Create a public volume type with extra spec
 stack@ubuntu-server5:/opt/stack/cinder$ cinder extra-specs-list
+--------------------------------------+-------------+------------------------------------------+
| ID | Name | extra_specs |
+--------------------------------------+-------------+------------------------------------------+
| 19977785-233e-49d9-bbe7-59be1f4f216a | lvmdriver-1 | {u'volume_backend_name': u'lvmdriver-1'} |
| a1d37da1-31bf-4e41-9242-ffe50502bfa3 | thin | {u'storagetype:provisioning': u'thin'} |
+--------------------------------------+-------------+------------------------------------------+

2. Switch to a non-admin user, say demo
 source ~/devstack/openrc demo demo

3. Create a consistency group
  cinder consisgroup-create --name cg-test a1d37da1-31bf-4e41-9242-ffe50502bfa3

4. The Consistency group is in error status and above exception was found in cinder scheduler log.
stack@ubuntu-server5:/opt/stack/cinder$ cinder consisgroup-list
+--------------------------------------+--------+---------+
| ID | Status | Name |
+--------------------------------------+--------+---------+
| dfdfdc09-0ea7-41e8-b203-f08df6c696db | error | cg-test |
+--------------------------------------+--------+---------+

=================================
CInder Version I was used:
stack@ubuntu-server5:/opt/stack/cinder$ git log -1
commit 8312a3ed5eafdc0f5532a354228723da39c14948
Merge: f0ef55f a69d5ff
Author: Jenkins <email address hidden>
Date: Mon Sep 7 20:59:52 2015 +0000

    Merge "Fix description for "Barbarism of editting a file""

Tina Tang (tina-tang)
tags: added: cg
tags: removed: cg
Xing Yang (xing-yang)
Changed in cinder:
assignee: nobody → Xing Yang (xing-yang)
milestone: none → liberty-rc1
importance: Undecided → High
status: New → In Progress
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/223388

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to cinder (master)

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

commit eec3512f66e9771ede5443ec374a595281517108
Author: Xing Yang <email address hidden>
Date: Tue Aug 18 14:13:36 2015 -0400

    Create CG needs extra specs

    Get volume types no longer returns extra specs for non-admin users.
    This breaks CG creation which needs extra specs. This patch fixes it
    by elevating the context when getting volume types for CG creation.

    Change-Id: I610149e8bf9a067f78a9ad52eb02b2da41dc64f6
    Closes-Bug: #1495758

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