Beispiel #1
0
def create_lookup_service():
    config = Configuration(manager.volume_manager_opts)
    LOG.debug("zoning mode %s" % config.safe_get('zoning_mode'))
    if config.safe_get('zoning_mode') == 'fabric':
        LOG.debug("FC Lookup Service enabled.")
        lookup = fc_san_lookup_service.FCSanLookupService(configuration=config)
        LOG.info(_LI("Using FC lookup service %s") % lookup.lookup_service)
        return lookup
    else:
        LOG.debug("FC Lookup Service not enabled in cinder.conf.")
        return None
Beispiel #2
0
def create_lookup_service():
    config = Configuration(manager.volume_manager_opts)
    LOG.debug("Zoning mode: %s", config.safe_get('zoning_mode'))
    if config.safe_get('zoning_mode') == 'fabric':
        LOG.debug("FC Lookup Service enabled.")
        lookup = fc_san_lookup_service.FCSanLookupService(configuration=config)
        LOG.info(_LI("Using FC lookup service %s"), lookup.lookup_service)
        return lookup
    else:
        LOG.debug("FC Lookup Service not enabled in cinder.conf.")
        return None
Beispiel #3
0
def create_zone_manager():
    """If zoning is enabled, build the Zone Manager."""
    config = Configuration(manager.volume_manager_opts)
    LOG.debug("zoning mode %s" % config.safe_get('zoning_mode'))
    if config.safe_get('zoning_mode') == 'fabric':
        LOG.debug("FC Zone Manager enabled.")
        zm = fc_zone_manager.ZoneManager(configuration=config)
        LOG.info(_("Using FC Zone Manager %(zm_version)s,"
                   " Driver %(drv_name)s %(drv_version)s.") %
                 {'zm_version': zm.get_version(),
                  'drv_name': zm.driver.__class__.__name__,
                  'drv_version': zm.driver.get_version()})
        return zm
    else:
        LOG.debug("FC Zone Manager not enabled in cinder.conf.")
        return None
def load_fabric_configurations(fabric_names):
    fabric_configs = {}
    for fabric_name in fabric_names:
        config = Configuration(cisco_zone_opts, fabric_name)
        fabric_configs[fabric_name] = config

    return fabric_configs
Beispiel #5
0
    def _do_partner_setup(self):
        partner_backend = self.configuration.netapp_partner_backend_name
        if partner_backend:
            config = Configuration(na_opts.netapp_7mode_opts, partner_backend)
            config.append_config_values(na_opts.netapp_connection_opts)
            config.append_config_values(na_opts.netapp_basicauth_opts)
            config.append_config_values(na_opts.netapp_transport_opts)

            self.partner_zapi_client = client_7mode.Client(
                None,
                transport_type=config.netapp_transport_type,
                username=config.netapp_login,
                password=config.netapp_password,
                hostname=config.netapp_server_hostname,
                port=config.netapp_server_port,
                vfiler=None)
Beispiel #6
0
    def __init__(self, volume_driver=None, service_name=None, *args, **kwargs):
        """Load the driver from the one specified in args, or from flags."""
        # update_service_capabilities needs service_name to be volume
        super(VolumeManager, self).__init__(service_name='volume',
                                            *args,
                                            **kwargs)
        self.configuration = Configuration(volume_manager_opts,
                                           config_group=service_name)
        self._tp = GreenPool()

        if not volume_driver:
            # Get from configuration, which will get the default
            # if its not using the multi backend
            volume_driver = self.configuration.volume_driver
        if volume_driver in MAPPING:
            LOG.warn(
                _("Driver path %s is deprecated, update your "
                  "configuration to the new path."), volume_driver)
            volume_driver = MAPPING[volume_driver]
        if volume_driver == 'cinder.volume.drivers.lvm.ThinLVMVolumeDriver':
            # Deprecated in Havana
            # Not handled in MAPPING because it requires setting a conf option
            LOG.warn(
                _("ThinLVMVolumeDriver is deprecated, please configure "
                  "LVMISCSIDriver and lvm_type=thin.  Continuing with "
                  "those settings."))
            volume_driver = 'cinder.volume.drivers.lvm.LVMISCSIDriver'
            self.configuration.lvm_type = 'thin'
        self.driver = importutils.import_object(
            volume_driver, configuration=self.configuration, db=self.db)
Beispiel #7
0
def load_fabric_configurations(fabric_names):
    fabric_configs = {}
    for fabric_name in fabric_names:
        config = Configuration(brcd_zone_opts, fabric_name)
        LOG.debug("Loaded FC fabric config %s" % fabric_name)
        fabric_configs[fabric_name] = config

    return fabric_configs
Beispiel #8
0
def create_zone_manager():
    """If zoning is enabled, build the Zone Manager."""
    config = Configuration(manager.volume_manager_opts)
    LOG.debug("Zoning mode: %s", config.safe_get('zoning_mode'))
    if config.safe_get('zoning_mode') == 'fabric':
        LOG.debug("FC Zone Manager enabled.")
        zm = fc_zone_manager.ZoneManager(configuration=config)
        LOG.info(
            _LI("Using FC Zone Manager %(zm_version)s,"
                " Driver %(drv_name)s %(drv_version)s."), {
                    'zm_version': zm.get_version(),
                    'drv_name': zm.driver.__class__.__name__,
                    'drv_version': zm.driver.get_version()
                })
        return zm
    else:
        LOG.debug("FC Zone Manager not enabled in cinder.conf.")
        return None
Beispiel #9
0
 def __init__(self, service_name=None, *args, **kwargs):
     """Load the specified in args, or flags."""
     # update_service_capabilities needs service_name to be volume
     super(CinderBackupProxy, self).__init__(service_name='backup',
                                       *args, **kwargs)
     self.configuration = Configuration(volume_backup_opts,
                                        config_group=service_name)
     self._tp = GreenPool()
     self.volume_api = volume.API()
     self._last_info_volume_state_heal = 0
     self._change_since_time = None
     self.volumes_mapping_cache = {'backups': {}}
     self.init_flag = False
     self.backup_cache = []
     self.tenant_id = self._get_tenant_id()
     self.adminCinderClient = self._get_cascaded_cinder_client()
Beispiel #10
0
 def __init__(self, volume_driver=None, service_name=None, *args, **kwargs):
     """Load the driver from the one specified in args, or from flags."""
     # update_service_capabilities needs service_name to be volume
     super(VolumeManager, self).__init__(service_name='volume',
                                         *args,
                                         **kwargs)
     self.configuration = Configuration(volume_manager_opts,
                                        config_group=service_name)
     if not volume_driver:
         # Get from configuration, which will get the default
         # if its not using the multi backend
         volume_driver = self.configuration.volume_driver
     if volume_driver in MAPPING:
         LOG.warn(
             _("Driver path %s is deprecated, update your "
               "configuration to the new path."), volume_driver)
         volume_driver = MAPPING[volume_driver]
     self.driver = importutils.import_object(
         volume_driver, configuration=self.configuration, db=self.db)
Beispiel #11
0
    def _do_partner_setup(self):
        partner_backend = self.configuration.netapp_partner_backend_name
        if partner_backend:
            config = Configuration(na_opts.netapp_7mode_opts, partner_backend)
            config.append_config_values(na_opts.netapp_connection_opts)
            config.append_config_values(na_opts.netapp_basicauth_opts)
            config.append_config_values(na_opts.netapp_transport_opts)

            self.partner_zapi_client = client_7mode.Client(
                None,
                transport_type=config.netapp_transport_type,
                username=config.netapp_login,
                password=config.netapp_password,
                hostname=config.netapp_server_hostname,
                port=config.netapp_server_port,
                vfiler=None)