share can not be created if scheduled with disabled m-shr using generic driver

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

Bug Description

One backend - generic driver.

Bug case:
1) Service m-shr is down, service m-api is up.
2) m-api receives request to create share with share-network.
3) m-shr starts and outputs:

2014-08-29 04:37:47.405 ERROR oslo.messaging.rpc.dispatcher [req-2b7e770d-727b-40ba-a20d-088742788198 7fd80a12ed7e4f62ae59fc68f93d7963 8fec1ddd5dd54f339f50b9695335002d] Exception during message handling: 'GenericShareDriver' objec
t has no attribute 'service_instance_manager'
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher Traceback (most recent call last):
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 134, in _dispatch_and_reply
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher incoming.message))
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 177, in _dispatch
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher return self._do_dispatch(endpoint, method, ctxt, args)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/usr/local/lib/python2.7/dist-packages/oslo/messaging/rpc/dispatcher.py", line 123, in _do_dispatch
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher result = getattr(endpoint, method)(ctxt, **new_args)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 203, in create_share
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher {'status': 'error'})
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/openstack/common/excutils.py", line 82, in __exit__
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 197, in create_share
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher context, share_network_id, share_id)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 154, in _provide_share_server_for_share
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher return _provide_share_server_for_share()
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/openstack/common/lockutils.py", line 325, in inner
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher return f(*args, **kwargs)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 147, in _provide_share_server_for_share
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher share_server = self._setup_server(context, share_server)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 423, in _setup_server
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher self.network_api.deallocate_network(context, share_network)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/openstack/common/excutils.py", line 82, in __exit__
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher six.reraise(self.type_, self.value, self.tb)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/manager.py", line 411, in _setup_server
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher metadata=metadata)
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher File "/opt/stack/manila/manila/share/drivers/generic.py", line 565, in setup_server
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher server = self.service_instance_manager.set_up_service_instance(
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher AttributeError: 'GenericShareDriver' object has no attribute 'service_instance_manager'
2014-08-29 04:37:47.405 TRACE oslo.messaging.rpc.dispatcher
2014-08-29 04:37:47.413 INFO oslo.messaging._drivers.impl_rabbit [req-2b7e770d-727b-40ba-a20d-088742788198 7fd80a12ed7e4f62ae59fc68f93d7963 8fec1ddd5dd54f339f50b9695335002d] Connecting to AMQP server on 172.18.198.52:5672
2014-08-29 04:37:47.422 INFO oslo.messaging._drivers.impl_rabbit [req-2b7e770d-727b-40ba-a20d-088742788198 7fd80a12ed7e4f62ae59fc68f93d7963 8fec1ddd5dd54f339f50b9695335002d] Connected to AMQP server on 172.18.198.52:5672
2014-08-29 04:37:47.423 ERROR oslo.messaging._drivers.common [req-2b7e770d-727b-40ba-a20d-088742788198 7fd80a12ed7e4f62ae59fc68f93d7963 8fec1ddd5dd54f339f50b9695335002d] Returning exception 'GenericShareDriver' object has no attribute 'service_instance_manager' to caller

Looks like "setup_server" is called before "do_setup" method, that sets up attr "service_instance_manager".

Tags: driver generic
description: updated
description: updated
description: updated
description: updated
description: updated
tags: added: driver generic
Changed in manila:
importance: Undecided → High
Changed in manila:
assignee: nobody → Valeriy Ponomaryov (vponomaryov)
status: New → In Progress
summary: - share can not be created if scheduled with disabled m-shr
+ share can not be created if scheduled with disabled m-shr using generic
+ driver
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/117761

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

Reviewed: https://review.openstack.org/117761
Committed: https://git.openstack.org/cgit/stackforge/manila/commit/?id=73b874bd7469ccd0483cbbc364e943a7c0e2f9ff
Submitter: Jenkins
Branch: master

commit 73b874bd7469ccd0483cbbc364e943a7c0e2f9ff
Author: Valeriy Ponomaryov <email address hidden>
Date: Fri Aug 29 05:53:59 2014 -0400

    Fix scheduled share creation with generic driver

    Generic driver uses separate module service_instance for handling of Nova VMs.
    If service m-shr starts and there are existing scheduled shares for creation,
    then concurrent issue appears between method 'do_setup', that is called once
    on start of service and 'ensure_server', that uses stuff from do_setup.

    Main error is in following:
    - "Returning exception 'GenericShareDriver' object has no attribute
      'service_instance_manager' to caller"

    Changes:
    - moved definition of attr 'service_instance_manager' to __init__ method.
    - removed attrs '_helpers' and 'share_networks_servers' from
      ServiceInstanceManager as they are redundant.
    - updated unittests according to changes.
    - used direct import of 'constants' submodule for neutron api,
      to be able to access it on driver init step.
    - replaced generic driver with common driver interface for inheritance
      by fake driver for unittests.

    Change-Id: I0fe7f097dc03eade5e0d4dfdbda0eb49588f4dde
    Closes-Bug: #1362985
    Related-Bug: #1330391

Changed in manila:
status: In Progress → Fix Committed
Changed in manila:
status: Fix Committed → Fix Released
Changed in manila:
milestone: none → juno-3
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.