Statistics API change in Quobyte

Bug #1496415 reported by Silvan Kaiser
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
High
Silvan Kaiser

Bug Description

Statistics API has changed slightly from it's pre-release state resulting in errors when reading backend capabilities:

2015-09-16 12:08:08.316 4382 DEBUG manila.share.drivers.quobyte.jsonrpc [req-8928dd45-fd90-4fe9-b06a-ca99feb109de ] Retrieved data from Quobyte backend: {u'jsonrpc': u'2.0', u'result': {u'task_counts': [], u'volume_count': 1, u'total_logical_capacity': 0, u'total_physical_capacity': 0, u'decommissioned_device': 0, u'total_physical_usage': 0, u'registered_device_count': 1, u'unavailable_device_count': 0, u'unassociated_device_count': 0, u'total_logical_usage': 0}, u'id': u'2'} call /opt/stack/manila/manila/share/drivers/quobyte/jsonrpc.py:137
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/dist-packages/eventlet/hubs/poll.py", line 115, in wait
    listener.cb(fileno)
  File "/usr/local/lib/python2.7/dist-packages/eventlet/greenthread.py", line 214, in main
    result = function(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/oslo_service/service.py", line 645, in run_service
    service.start()
  File "/opt/stack/manila/manila/service.py", line 120, in start
    self.manager.init_host()
  File "/opt/stack/manila/manila/share/manager.py", line 110, in wrapped
    return f(self, *args, **kwargs)
  File "/opt/stack/manila/manila/share/manager.py", line 269, in init_host
    self.publish_service_capabilities(ctxt)
  File "/opt/stack/manila/manila/share/manager.py", line 110, in wrapped
    return f(self, *args, **kwargs)
  File "/opt/stack/manila/manila/share/manager.py", line 1126, in publish_service_capabilities
    self._report_driver_status(context)
  File "/opt/stack/manila/manila/share/manager.py", line 1092, in _report_driver_status
    share_stats = self.driver.get_share_stats(refresh=True)
  File "/opt/stack/manila/manila/share/driver.py", line 614, in get_share_stats
    self._update_share_stats()
  File "/opt/stack/manila/manila/share/drivers/quobyte/quobyte.py", line 99, in _update_share_stats
    total_gb, free_gb = self._get_capacities()
  File "/opt/stack/manila/manila/share/drivers/quobyte/quobyte.py", line 114, in _get_capacities
    total = float(result['statistics']['total_logical_capacity'])
KeyError: 'statistics'

The system information (capacity, used space) is not available as member of the 'statistics' field in the Quobyte backend but as direct members of the message. This means calls trying to read the key 'statistics' fail as this field is not available. Need to read the capacity and used fields directly.

Revision history for this message
Silvan Kaiser (2-silvan) wrote :

Simple fix, will upload shortly

Changed in manila:
assignee: nobody → Silvan Kaiser (2-silvan)
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/225916

Changed in manila:
status: New → In Progress
Changed in manila:
importance: Undecided → High
milestone: none → liberty-rc1
Silvan Kaiser (2-silvan)
description: updated
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

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

commit a7fe6c758cb306a0b1b5d9f9dc242d9bd52da14c
Author: Silvan Kaiser <email address hidden>
Date: Wed Sep 16 16:34:01 2015 +0200

    Fixes a Quobyte backend call issue with a wrong field name

    No longer access backend data through statistics field.
    Allows reading backend capacity info for Quobyte v1.2+.

    Closes-Bug: 1496415

    Change-Id: Ia05136c85602ca10ae0fc3d2e95f667efacab4b3

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