Cinder API v2 support

Bug #1226944 reported by Sam Morrison
46
This bug affects 9 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Fix Released
Medium
Julie Pichon
Juno
Fix Released
Undecided
Julie Pichon

Bug Description

When clicking on the volumes tab in both the Admin and the project panels I get the following stack trace

Traceback:
File "/usr/local/lib/python2.7/dist-packages/django/core/handlers/base.py" in get_response
  115. response = callback(request, *callback_args, **callback_kwargs)
File "/opt/horizon/horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/opt/horizon/horizon/decorators.py" in dec
  86. return view_func(request, *args, **kwargs)
File "/opt/horizon/horizon/decorators.py" in dec
  54. return view_func(request, *args, **kwargs)
File "/opt/horizon/horizon/decorators.py" in dec
  38. return view_func(request, *args, **kwargs)
File "/opt/horizon/horizon/decorators.py" in dec
  86. return view_func(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in view
  68. return self.dispatch(request, *args, **kwargs)
File "/usr/local/lib/python2.7/dist-packages/django/views/generic/base.py" in dispatch
  86. return handler(request, *args, **kwargs)
File "/opt/horizon/horizon/tables/views.py" in get
  155. handled = self.construct_tables()
File "/opt/horizon/horizon/tables/views.py" in construct_tables
  146. handled = self.handle_table(table)
File "/opt/horizon/horizon/tables/views.py" in handle_table
  118. data = self._get_data_dict()
File "/opt/horizon/horizon/tables/views.py" in _get_data_dict
  44. data.extend(func())
File "/opt/horizon/openstack_dashboard/dashboards/admin/volumes/views.py" in get_volumes_data
  48. self._set_id_if_nameless(volumes, instances)
File "/opt/horizon/openstack_dashboard/dashboards/project/volumes/views.py" in _set_id_if_nameless
  72. if not volume.display_name:
File "/usr/local/lib/python2.7/dist-packages/cinderclient/base.py" in __getattr__
  268. raise AttributeError(k)

Exception Type: AttributeError at /admin/volumes/
Exception Value: display_name

Revision history for this message
Sam Morrison (sorrison) wrote :

Should note that the cinder endpoint is stable/grizzly, horizon is master

Kieran Spear (kspear)
Changed in horizon:
status: New → Confirmed
importance: Undecided → Medium
milestone: none → havana-rc1
Revision history for this message
Kieran Spear (kspear) wrote :

I think this is due to having a Cinder v2 endpoint in the service catalog for 'volume'. Horizon only supports v1 right now. A few fields have been renamed. E.g., "display_name" -> "name"

Kieran Spear (kspear)
Changed in horizon:
milestone: havana-rc1 → none
summary: - Volumes tab doesn't work
+ Cinder API v2 support
Kieran Spear (kspear)
Changed in horizon:
importance: Medium → Wishlist
Revision history for this message
Kymil-arcadia (kymil-arcadia) wrote :

So how do we get this working?

I tried changing my endpoint to v1 (perhaps incorrectly) and I still get this error in horizon.

+-------------+--------------------------------------------+
| Property Value
+-------------+--------------------------------------------+
| adminurl http://192.168.0.141:8776/v1/%(tenant_id)s
| id 844fd642b392462898debcccf1a4a47d
| internalurl http://192.168.0.141:8776/v1/%(tenant_id)s
| publicurl http://192.168.0.141:8776/v1/%(tenant_id)s
| region regionOne
| service_id fce02d5627e84e7f84c4a7c0bcc3b5b6
+-------------+--------------------------------------------+

Revision history for this message
Kymil-arcadia (kymil-arcadia) wrote :

Okay, I take it back, changing my endpoint to v1 did solve the problem. Not sure why it didn't work right away, but making the change and a bit of patience and this is resolved now.

Revision history for this message
Yehia Beyh (yehia-beyh) wrote :

so what's the deal in horizon supporting cinder V2?

Revision history for this message
Julie Pichon (jpichon) wrote :

Changing the priority to medium if not high, I don't know what the deprecation schedule is but we will want to add support for the v2 API soon, I think.

Changed in horizon:
importance: Wishlist → Medium
Julie Pichon (jpichon)
Changed in horizon:
assignee: nobody → Julie Pichon (jpichon)
Julie Pichon (jpichon)
Changed in horizon:
milestone: none → icehouse-3
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to horizon (master)

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

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

Reviewed: https://review.openstack.org/70149
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=77dcd64341cba373b7f297e6759ee4a9af9cb06d
Submitter: Jenkins
Branch: master

commit 77dcd64341cba373b7f297e6759ee4a9af9cb06d
Author: Julie Pichon <email address hidden>
Date: Wed Jan 29 15:07:15 2014 +0000

    Basic support for Cinder v2

    Change-Id: I6540720866c9005cf9537fe5b3a241f769529b3a
    Implements blueprint: cinder-v2-horizon
    Closes-Bug: #1226944

Changed in horizon:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in horizon:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in horizon:
milestone: icehouse-3 → 2014.1
Revision history for this message
Heiko Krämer (foexle) wrote :

Ther's a problem still exists.
If you're using cinder v2 you will get an error for instance view:

https://github.com/openstack/horizon/blob/stable/juno/openstack_dashboard/api/nova.py#L720
https://github.com/openstack/horizon/blob/stable/icehouse/openstack_dashboard/api/nova.py#L668

=> should be
volume.name = volume_data.name

Revision history for this message
Julie Pichon (jpichon) wrote :

Heiko, could you file a new bug about this with steps on how to reproduce? Thank you.

Revision history for this message
Heiko Krämer (foexle) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to horizon (master)

Related fix proposed to branch: master
Review: https://review.openstack.org/131475

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to horizon (master)

Reviewed: https://review.openstack.org/131475
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=9e5a4babf82258641a082d03673cb5ca329c65d1
Submitter: Jenkins
Branch: master

commit 9e5a4babf82258641a082d03673cb5ca329c65d1
Author: Heiko Krämer <email address hidden>
Date: Tue Oct 28 16:05:31 2014 +0100

    Fix Instance Details error when using Cinder V2

    If you're using cinder V2 API you will get an error for instance details view.
    The function 'instance_volumes_list' is called by the detail view of an instance
    and try to get from 'display_name'. Since Cinder v2 it's changed to 'name'.

    Change-Id: I20de0b8e6c263fc306e1475ddd40b4156e828bf1
    Closes-Bug: #1386727
    Related-Bug: #1226944
    Co-Authored-By: Julie Pichon <email address hidden>

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix proposed to horizon (stable/juno)

Related fix proposed to branch: stable/juno
Review: https://review.openstack.org/135517

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Related fix merged to horizon (stable/juno)

Reviewed: https://review.openstack.org/135517
Committed: https://git.openstack.org/cgit/openstack/horizon/commit/?id=a2edb3d7100d903ae4846dbd0e197ad972dc458c
Submitter: Jenkins
Branch: stable/juno

commit a2edb3d7100d903ae4846dbd0e197ad972dc458c
Author: Heiko Krämer <email address hidden>
Date: Tue Oct 28 16:05:31 2014 +0100

    Fix Instance Details error when using Cinder V2

    If you're using cinder V2 API you will get an error for instance details view.
    The function 'instance_volumes_list' is called by the detail view of an instance
    and try to get from 'display_name'. Since Cinder v2 it's changed to 'name'.

    Change-Id: I20de0b8e6c263fc306e1475ddd40b4156e828bf1
    Closes-Bug: #1386727
    Related-Bug: #1226944
    Co-Authored-By: Julie Pichon <email address hidden>
    (cherry picked from commit 9e5a4babf82258641a082d03673cb5ca329c65d1)

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

Duplicates of this bug

Other bug subscribers

Related blueprints

Remote bug watches

Bug watches keep track of this bug in other bug trackers.