Reviewed: https://review.openstack.org/395067 Committed: https://git.openstack.org/cgit/openstack/nova/commit/?id=57f46c1c28a2e3ba1f12ec8f883cf99ccd9979db Submitter: Jenkins Branch: master
commit 57f46c1c28a2e3ba1f12ec8f883cf99ccd9979db Author: Matt Riedemann <mrie...@us.ibm.com> Date: Tue Nov 8 11:22:42 2016 -0500 libvirt: handle os-brick InvalidConnectorProtocol on init On init the LibvirtDriver imports it's volume drivers into a registry for later access during volume operations. Several of the libvirt volume drivers are using os-brick for the connector. os-brick can raise an exception when loading a connector class under certain conditions, e.g. s390x + ISER is not a supported mapping in os-brick. This in turn causes the LibvirtDriver to fail to load which causes nova-compute to crash. This change handles the os-brick specific InvalidConnectorProtocol exception when importing volume drivers, logs a debug message but doesn't fail to init the LibvirtDriver. As part of this change the driver_dict_from_config helper method is integrated with the _get_volume_drivers method as that was the only thing using it, and it's cleaner if those are just a single method. Depends-On: I7183a479bc12c4e5509f52bf7fdd0fa7ccaa7247 Change-Id: I61376469a409dc5475886e6c79486b815129392a Closes-Bug: #1639239 ** Changed in: nova Status: In Progress => Fix Released -- You received this bug notification because you are a member of Yahoo! Engineering Team, which is subscribed to OpenStack Compute (nova). https://bugs.launchpad.net/bugs/1639239 Title: ValueError for Invalid InitiatorConnector in s390 Status in OpenStack Compute (nova): Fix Released Status in os-brick: Fix Released Bug description: Description =========== Calling the InitiatorConnector factory results in a ValueError for unsupported protocols, which goes unhandled and may crash a calling service. Steps to reproduce ================== - clone devstack - make stack Expected result =============== The nova compute service should run. Actual result ============= A ValueError is thrown, which, in the case of the nova libvirt driver, is not handled appropriately. The compute service crashes. Environment =========== os|distro=kvmibm1 os|vendor=kvmibm os|release=1.1.3-beta4.3 git|cinder|master[f6ab36d] git|devstack|master[928b3cd] git|nova|master[56138aa] pip|os-brick|1.7.0 Logs & Configs ============== [...] 2016-11-03 17:56:57.204 46141 INFO nova.virt.driver [req-fb30a5af-e87c-4ee0-903c-a5aa7d3ad5e3 - -] Loading compute driver 'libvirt.LibvirtDriver' 2016-11-03 17:56:57.442 46141 DEBUG os_brick.initiator.connector [req-fb30a5af-e87c-4ee0-903c-a5aa7d3ad5e3 - -] Factory for ISCSI on s390x factory /usr/lib/python2.7/site-packages/os_brick/initiator/connector.py:261 2016-11-03 17:56:57.444 46141 DEBUG os_brick.initiator.connector [req-fb30a5af-e87c-4ee0-903c-a5aa7d3ad5e3 - -] Factory for ISCSI on s390x factory /usr/lib/python2.7/site-packages/os_brick/initiator/connector.py:261 2016-11-03 17:56:57.445 46141 DEBUG os_brick.initiator.connector [req-fb30a5af-e87c-4ee0-903c-a5aa7d3ad5e3 - -] Factory for ISER on s390x factory /usr/lib/python2.7/site-packages/os_brick/initiator/connector.py:261 2016-11-03 17:56:57.445 46141 CRITICAL nova [req-fb30a5af-e87c-4ee0-903c-a5aa7d3ad5e3 - -] ValueError: Invalid InitiatorConnector protocol specified ISER 2016-11-03 17:56:57.445 46141 ERROR nova Traceback (most recent call last): 2016-11-03 17:56:57.445 46141 ERROR nova File "/usr/bin/nova-compute", line 10, in <module> 2016-11-03 17:56:57.445 46141 ERROR nova sys.exit(main()) 2016-11-03 17:56:57.445 46141 ERROR nova File "/opt/stack/nova/nova/cmd/compute.py", line 56, in main 2016-11-03 17:56:57.445 46141 ERROR nova topic=CONF.compute_topic) 2016-11-03 17:56:57.445 46141 ERROR nova File "/opt/stack/nova/nova/service.py", line 216, in create 2016-11-03 17:56:57.445 46141 ERROR nova periodic_interval_max=periodic_interval_max) 2016-11-03 17:56:57.445 46141 ERROR nova File "/opt/stack/nova/nova/service.py", line 91, in __init__ 2016-11-03 17:56:57.445 46141 ERROR nova self.manager = manager_class(host=self.host, *args, **kwargs) 2016-11-03 17:56:57.445 46141 ERROR nova File "/opt/stack/nova/nova/compute/manager.py", line 537, in __init__ 2016-11-03 17:56:57.445 46141 ERROR nova self.driver = driver.load_compute_driver(self.virtapi, compute_driver) 2016-11-03 17:56:57.445 46141 ERROR nova File "/opt/stack/nova/nova/virt/driver.py", line 1625, in load_compute_driver 2016-11-03 17:56:57.445 46141 ERROR nova virtapi) 2016-11-03 17:56:57.445 46141 ERROR nova File "/usr/lib/python2.7/site-packages/oslo_utils/importutils.py", line 44, in import_object 2016-11-03 17:56:57.445 46141 ERROR nova return import_class(import_str)(*args, **kwargs) 2016-11-03 17:56:57.445 46141 ERROR nova File "/opt/stack/nova/nova/virt/libvirt/driver.py", line 356, in __init__ 2016-11-03 17:56:57.445 46141 ERROR nova self._get_volume_drivers(), self._host) 2016-11-03 17:56:57.445 46141 ERROR nova File "/opt/stack/nova/nova/virt/driver.py", line 44, in driver_dict_from_config 2016-11-03 17:56:57.445 46141 ERROR nova driver_registry[driver_type] = driver_class(*args, **kwargs) 2016-11-03 17:56:57.445 46141 ERROR nova File "/opt/stack/nova/nova/virt/libvirt/volume/iser.py", line 34, in __init__ 2016-11-03 17:56:57.445 46141 ERROR nova transport=self._get_transport()) 2016-11-03 17:56:57.445 46141 ERROR nova File "/usr/lib/python2.7/site-packages/os_brick/initiator/connector.py", line 285, in factory 2016-11-03 17:56:57.445 46141 ERROR nova raise ValueError(msg) 2016-11-03 17:56:57.445 46141 ERROR nova ValueError: Invalid InitiatorConnector protocol specified ISER 2016-11-03 17:56:57.445 46141 ERROR nova To manage notifications about this bug go to: https://bugs.launchpad.net/nova/+bug/1639239/+subscriptions -- Mailing list: https://launchpad.net/~yahoo-eng-team Post to : yahoo-eng-team@lists.launchpad.net Unsubscribe : https://launchpad.net/~yahoo-eng-team More help : https://help.launchpad.net/ListHelp