Add versioning output for the FC Zone Manager
This patch adds log output of the version information for the Fibre Channel Zone Manager and it's drivers during volume manager start up. Change-Id: I7de5159782315f528a25ffdf69a59caebcc46ee7 Closes-Bug: #1284362
This commit is contained in:
parent
289aa334b1
commit
65e1031c6a
@ -198,6 +198,8 @@ class VolumeManager(manager.SchedulerDependentManager):
|
||||
db=self.db,
|
||||
host=self.host)
|
||||
|
||||
self.zonemanager = None
|
||||
|
||||
def _add_to_threadpool(self, func, *args, **kwargs):
|
||||
self._tp.spawn_n(func, *args, **kwargs)
|
||||
|
||||
@ -207,6 +209,14 @@ class VolumeManager(manager.SchedulerDependentManager):
|
||||
"""
|
||||
|
||||
ctxt = context.get_admin_context()
|
||||
if self.configuration.safe_get('zoning_mode') == 'fabric':
|
||||
self.zonemanager = ZoneManager(configuration=self.configuration)
|
||||
LOG.info(_("Starting FC Zone Manager %(zm_version)s,"
|
||||
" Driver %(drv_name)s %(drv_version)s") %
|
||||
{'zm_version': self.zonemanager.get_version(),
|
||||
'drv_name': self.zonemanager.driver.__class__.__name__,
|
||||
'drv_version': self.zonemanager.driver.get_version()})
|
||||
|
||||
LOG.info(_("Starting volume driver %(driver_name)s (%(version)s)") %
|
||||
{'driver_name': self.driver.__class__.__name__,
|
||||
'version': self.driver.get_version()})
|
||||
@ -806,7 +816,7 @@ class VolumeManager(manager.SchedulerDependentManager):
|
||||
vol_type = conn_info.get('driver_volume_type', None)
|
||||
mode = self.configuration.zoning_mode
|
||||
LOG.debug(_("Zoning Mode: %s"), mode)
|
||||
if vol_type == 'fibre_channel' and mode == 'fabric':
|
||||
if vol_type == 'fibre_channel' and self.zonemanager:
|
||||
self._add_or_delete_fc_connection(conn_info, 1)
|
||||
return conn_info
|
||||
|
||||
@ -831,7 +841,7 @@ class VolumeManager(manager.SchedulerDependentManager):
|
||||
vol_type = conn_info.get('driver_volume_type', None)
|
||||
mode = self.configuration.zoning_mode
|
||||
LOG.debug(_("Zoning Mode: %s"), mode)
|
||||
if vol_type == 'fibre_channel' and mode == 'fabric':
|
||||
if vol_type == 'fibre_channel' and self.zonemanager:
|
||||
self._add_or_delete_fc_connection(conn_info, 0)
|
||||
except Exception as err:
|
||||
err_msg = (_('Unable to terminate volume connection: %(err)s')
|
||||
@ -1265,14 +1275,11 @@ class VolumeManager(manager.SchedulerDependentManager):
|
||||
# target WWN is passed to ZoneManager to add or update zone config.
|
||||
LOG.debug(_("Zoning op: %s"), zone_op)
|
||||
if _initiator_target_map is not None:
|
||||
kwargs = {'driver_volume_type': 'fibre_channel',
|
||||
'configuration': self.configuration}
|
||||
zonemanager = ZoneManager(**kwargs)
|
||||
try:
|
||||
if zone_op == 1:
|
||||
zonemanager.add_connection(_initiator_target_map)
|
||||
self.zonemanager.add_connection(_initiator_target_map)
|
||||
elif zone_op == 0:
|
||||
zonemanager.delete_connection(_initiator_target_map)
|
||||
self.zonemanager.delete_connection(_initiator_target_map)
|
||||
except exception.ZoneManagerException as e:
|
||||
with excutils.save_and_reraise_exception():
|
||||
LOG.error(str(e))
|
||||
|
@ -25,12 +25,20 @@ from cinder.openstack.common import log as logging
|
||||
from cinder import utils
|
||||
from cinder.zonemanager.drivers.brocade import brcd_fabric_opts as fabric_opts
|
||||
import cinder.zonemanager.drivers.brocade.fc_zone_constants as ZoneConstant
|
||||
from cinder.zonemanager.drivers.fc_common import FCCommon
|
||||
from cinder.zonemanager.fc_san_lookup_service import FCSanLookupService
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class BrcdFCSanLookupService(FCCommon):
|
||||
class BrcdFCSanLookupService(FCSanLookupService):
|
||||
"""The SAN lookup service that talks to Brocade switches.
|
||||
|
||||
Version History:
|
||||
1.0.0 - Initial version
|
||||
|
||||
"""
|
||||
|
||||
VERSION = "1.0.0"
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
"""Initializing the client."""
|
||||
|
@ -63,6 +63,8 @@ class BrcdFCZoneDriver(FCZoneDriver):
|
||||
1.0 - Initial Brocade FC zone driver
|
||||
"""
|
||||
|
||||
VERSION = "1.0"
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(BrcdFCZoneDriver, self).__init__(**kwargs)
|
||||
self.configuration = kwargs.get('configuration', None)
|
||||
|
@ -31,12 +31,12 @@ interfaces.
|
||||
|
||||
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.zonemanager.drivers.fc_common import FCCommon
|
||||
from cinder.zonemanager import fc_common
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FCZoneDriver(FCCommon):
|
||||
class FCZoneDriver(fc_common.FCCommon):
|
||||
"""Interface to manage Connection control during attach/detach."""
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
|
@ -20,5 +20,10 @@
|
||||
class FCCommon(object):
|
||||
"""Common interface for FC operations."""
|
||||
|
||||
VERSION = "1.0"
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
pass
|
||||
|
||||
def get_version(self):
|
||||
return self.VERSION
|
@ -20,6 +20,7 @@ Base Lookup Service for name server lookup to find the initiator to target port
|
||||
mapping for available SAN contexts.
|
||||
Vendor specific lookup classes are expected to implement the interfaces
|
||||
defined in this class.
|
||||
|
||||
"""
|
||||
|
||||
|
||||
@ -27,22 +28,26 @@ from cinder import exception
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.volume import configuration as config
|
||||
from cinder.zonemanager import fc_common
|
||||
from cinder.zonemanager import fc_zone_manager
|
||||
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
|
||||
class FCSanLookupService(object):
|
||||
class FCSanLookupService(fc_common.FCCommon):
|
||||
"""Base Lookup Service.
|
||||
|
||||
Base Lookup Service for name server lookup to find the initiator to
|
||||
target port mapping for available SAN contexts.
|
||||
|
||||
"""
|
||||
|
||||
lookup_service = None
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
super(FCSanLookupService, self).__init__(**kwargs)
|
||||
|
||||
self.configuration = kwargs.get('configuration', None)
|
||||
|
||||
opts = fc_zone_manager.zone_manager_opts
|
||||
|
@ -38,6 +38,7 @@ from cinder import exception
|
||||
from cinder.openstack.common import importutils
|
||||
from cinder.openstack.common import log as logging
|
||||
from cinder.volume import configuration as config
|
||||
from cinder.zonemanager import fc_common
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
@ -64,14 +65,16 @@ CONF = cfg.CONF
|
||||
CONF.register_opts(zone_manager_opts, 'fc-zone-manager')
|
||||
|
||||
|
||||
class ZoneManager:
|
||||
class ZoneManager(fc_common.FCCommon):
|
||||
"""Manages Connection control during attach/detach."""
|
||||
|
||||
VERSION = "1.0"
|
||||
driver = None
|
||||
fabric_names = []
|
||||
|
||||
def __init__(self, **kwargs):
|
||||
"""Load the driver from the one specified in args, or from flags."""
|
||||
super(ZoneManager, self).__init__(**kwargs)
|
||||
|
||||
self.configuration = kwargs.get('configuration', None)
|
||||
if self.configuration:
|
||||
|
Loading…
Reference in New Issue
Block a user