Exemple #1
0
 def do_setup(self, context):
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
     self.lun_ostype = self.configuration.netapp_lun_ostype or self.DEFAULT_LUN_OS
     self.host_type = self.configuration.netapp_host_type or self.DEFAULT_HOST_TYPE
     if self.configuration.netapp_lun_space_reservation == "enabled":
         self.lun_space_reservation = "true"
     else:
         self.lun_space_reservation = "false"
Exemple #2
0
    def do_setup(self, context):
        """Any initialization the volume driver does while starting."""
        self.context = context
        na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)

        self._client = self._create_rest_client(self.configuration)
        self._check_mode_get_or_register_storage_system()
        if self.configuration.netapp_enable_multiattach:
            self._ensure_multi_attach_host_group_exists()
Exemple #3
0
    def do_setup(self, context):
        """Any initialization the volume driver does while starting."""
        self.context = context
        na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)

        self._client = self._create_rest_client(self.configuration)
        self._check_mode_get_or_register_storage_system()
        if self.configuration.netapp_enable_multiattach:
            self._ensure_multi_attach_host_group_exists()
Exemple #4
0
 def do_setup(self, context):
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
     self.lun_ostype = (self.configuration.netapp_lun_ostype
                        or self.DEFAULT_LUN_OS)
     self.host_type = (self.configuration.netapp_host_type
                       or self.DEFAULT_HOST_TYPE)
     if self.configuration.netapp_lun_space_reservation == 'enabled':
         self.lun_space_reservation = 'true'
     else:
         self.lun_space_reservation = 'false'
Exemple #5
0
 def do_setup(self, context):
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
     self.lun_ostype = (self.configuration.netapp_lun_ostype
                        or self.DEFAULT_LUN_OS)
     self.host_type = (self.configuration.netapp_host_type
                       or self.DEFAULT_HOST_TYPE)
     if self.configuration.netapp_lun_space_reservation == 'enabled':
         self.lun_space_reservation = 'true'
     else:
         self.lun_space_reservation = 'false'
Exemple #6
0
    def __new__(cls, *args, **kwargs):

        config = kwargs.get("configuration", None)
        if not config:
            raise exception.InvalidInput(reason=_("Required configuration not found"))

        config.append_config_values(options.netapp_proxy_opts)
        na_utils.check_flags(NetAppDriver.REQUIRED_FLAGS, config)

        app_version = na_utils.OpenStackInfo().info()
        LOG.info(_LI("OpenStack OS Version Info: %(info)s"), {"info": app_version})
        kwargs["app_version"] = app_version

        return NetAppDriver.create_driver(config.netapp_storage_family, config.netapp_storage_protocol, *args, **kwargs)
Exemple #7
0
    def do_setup(self, context):
        super(NetAppBlockStorageCmodeLibrary, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        # cDOT API client
        self.zapi_client = cmode_utils.get_client_for_backend(self.failed_over_backend_name or self.backend_name)
        self.vserver = self.zapi_client.vserver

        # Performance monitoring library
        self.perf_library = perf_cmode.PerformanceCmodeLibrary(self.zapi_client)

        # Storage service catalog
        self.ssc_library = capabilities.CapabilitiesLibrary(
            self.driver_protocol, self.vserver, self.zapi_client, self.configuration
        )
Exemple #8
0
    def do_setup(self, context):
        super(NetAppBlockStorageCmodeLibrary, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        self.vserver = self.configuration.netapp_vserver

        self.zapi_client = client_cmode.Client(
            transport_type=self.configuration.netapp_transport_type,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password,
            hostname=self.configuration.netapp_server_hostname,
            port=self.configuration.netapp_server_port,
            vserver=self.vserver)

        self.ssc_vols = None
        self.stale_vols = set()
    def do_setup(self, context):
        super(NetAppBlockStorageCmodeLibrary, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        self.vserver = self.configuration.netapp_vserver

        self.zapi_client = client_cmode.Client(
            transport_type=self.configuration.netapp_transport_type,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password,
            hostname=self.configuration.netapp_server_hostname,
            port=self.configuration.netapp_server_port,
            vserver=self.vserver)

        self.ssc_vols = {}
        self.stale_vols = set()
Exemple #10
0
    def __new__(cls, *args, **kwargs):

        config = kwargs.get('configuration', None)
        if not config:
            raise exception.InvalidInput(
                reason=_('Required configuration not found'))

        config.append_config_values(options.netapp_proxy_opts)
        na_utils.check_flags(NetAppDriver.REQUIRED_FLAGS, config)

        app_version = na_utils.OpenStackInfo().info()
        LOG.info('OpenStack OS Version Info: %(info)s', {'info': app_version})
        kwargs['app_version'] = app_version

        return NetAppDriver.create_driver(config.netapp_storage_family,
                                          config.netapp_storage_protocol,
                                          *args, **kwargs)
Exemple #11
0
    def do_setup(self, context):
        super(NetAppBlockStorageCmodeLibrary, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        # cDOT API client
        self.zapi_client = dot_utils.get_client_for_backend(
            self.failed_over_backend_name or self.backend_name)
        self.vserver = self.zapi_client.vserver

        # Performance monitoring library
        self.perf_library = perf_cmode.PerformanceCmodeLibrary(
            self.zapi_client)

        # Storage service catalog
        self.ssc_library = capabilities.CapabilitiesLibrary(
            self.driver_protocol, self.vserver, self.zapi_client,
            self.configuration)
Exemple #12
0
    def do_setup(self, context):
        """Do the customized set up on client for cluster mode."""
        super(NetAppCmodeNfsDriver, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        # cDOT API client
        self.zapi_client = cmode_utils.get_client_for_backend(
            self.failed_over_backend_name or self.backend_name)
        self.vserver = self.zapi_client.vserver

        # Performance monitoring library
        self.perf_library = perf_cmode.PerformanceCmodeLibrary(
            self.zapi_client)

        # Storage service catalog
        self.ssc_library = capabilities.CapabilitiesLibrary(
            'nfs', self.vserver, self.zapi_client, self.configuration)
Exemple #13
0
    def do_setup(self, context):
        """Do the customized set up on client for cluster mode."""
        super(NetAppCmodeNfsDriver, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        self.vserver = self.configuration.netapp_vserver

        self.zapi_client = client_cmode.Client(
            transport_type=self.configuration.netapp_transport_type,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password,
            hostname=self.configuration.netapp_server_hostname,
            port=self.configuration.netapp_server_port,
            vserver=self.vserver)

        self.ssc_enabled = True
        self.ssc_vols = None
        self.stale_vols = set()
Exemple #14
0
    def do_setup(self, context):
        super(NetAppBlockStorageCmodeLibrary, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        self.vserver = self.configuration.netapp_vserver

        self.zapi_client = client_cmode.Client(
            transport_type=self.configuration.netapp_transport_type,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password,
            hostname=self.configuration.netapp_server_hostname,
            port=self.configuration.netapp_server_port,
            vserver=self.vserver)

        self.perf_library = perf_cmode.PerformanceCmodeLibrary(
            self.zapi_client)
        self.ssc_library = capabilities.CapabilitiesLibrary(
            self.driver_protocol, self.vserver, self.zapi_client,
            self.configuration)
Exemple #15
0
    def do_setup(self, context):
        """Do the customized set up on client for cluster mode."""
        super(NetAppCmodeNfsDriver, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        self.vserver = self.configuration.netapp_vserver

        self.zapi_client = client_cmode.Client(
            transport_type=self.configuration.netapp_transport_type,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password,
            hostname=self.configuration.netapp_server_hostname,
            port=self.configuration.netapp_server_port,
            vserver=self.vserver)

        self.perf_library = perf_cmode.PerformanceCmodeLibrary(
            self.zapi_client)
        self.ssc_library = capabilities.CapabilitiesLibrary(
            'nfs', self.vserver, self.zapi_client, self.configuration)
Exemple #16
0
    def do_setup(self, context):
        super(NetAppBlockStorageCmodeLibrary, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        self.vserver = self.configuration.netapp_vserver

        self.zapi_client = client_cmode.Client(
            transport_type=self.configuration.netapp_transport_type,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password,
            hostname=self.configuration.netapp_server_hostname,
            port=self.configuration.netapp_server_port,
            vserver=self.vserver)

        self.perf_library = perf_cmode.PerformanceCmodeLibrary(
            self.zapi_client)
        self.ssc_library = capabilities.CapabilitiesLibrary(
            self.driver_protocol, self.vserver, self.zapi_client,
            self.configuration)
Exemple #17
0
    def do_setup(self, context):
        """Do the customized set up on client for cluster mode."""
        super(NetAppCmodeNfsDriver, self).do_setup(context)
        na_utils.check_flags(self.REQUIRED_CMODE_FLAGS, self.configuration)

        self.vserver = self.configuration.netapp_vserver

        self.zapi_client = client_cmode.Client(
            transport_type=self.configuration.netapp_transport_type,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password,
            hostname=self.configuration.netapp_server_hostname,
            port=self.configuration.netapp_server_port,
            vserver=self.vserver)

        self.perf_library = perf_cmode.PerformanceCmodeLibrary(
            self.zapi_client)
        self.ssc_library = capabilities.CapabilitiesLibrary(
            'nfs', self.vserver, self.zapi_client, self.configuration)
Exemple #18
0
    def do_setup(self, context):
        """Any initialization the volume driver does while starting."""
        na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)

        port = self.configuration.netapp_server_port
        scheme = self.configuration.netapp_transport_type.lower()
        if port is None:
            if scheme == 'http':
                port = 8080
            elif scheme == 'https':
                port = 8443

        self._client = client.RestClient(
            scheme=scheme,
            host=self.configuration.netapp_server_hostname,
            port=port,
            service_path=self.configuration.netapp_webservice_path,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password)
        self._check_mode_get_or_register_storage_system()
Exemple #19
0
    def __init__(self, *args, **kwargs):
        super(NetAppDriver, self).__init__()

        app_version = na_utils.OpenStackInfo().info()
        LOG.info(
            _LI('OpenStack OS Version Info: %(info)s') % {'info': app_version})

        self.configuration = kwargs.get('configuration', None)
        if not self.configuration:
            raise exception.InvalidInput(
                reason=_("Required configuration not found"))

        self.configuration.append_config_values(netapp_proxy_opts)
        na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)

        kwargs['app_version'] = app_version

        self.driver = NetAppDriverFactory.create_driver(
            self.configuration.netapp_storage_family,
            self.configuration.netapp_storage_protocol, *args, **kwargs)
Exemple #20
0
    def do_setup(self, context):
        """Any initialization the volume driver does while starting."""
        na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)

        port = self.configuration.netapp_server_port
        scheme = self.configuration.netapp_transport_type.lower()
        if port is None:
            if scheme == 'http':
                port = 8080
            elif scheme == 'https':
                port = 8443

        self._client = client.RestClient(
            scheme=scheme,
            host=self.configuration.netapp_server_hostname,
            port=port,
            service_path=self.configuration.netapp_webservice_path,
            username=self.configuration.netapp_login,
            password=self.configuration.netapp_password)
        self._check_mode_get_or_register_storage_system()
Exemple #21
0
    def test_check_flags(self):
        class TestClass(object):
            pass

        required_flags = ["flag1", "flag2"]
        configuration = TestClass()
        setattr(configuration, "flag1", "value1")
        setattr(configuration, "flag3", "value3")
        self.assertRaises(exception.InvalidInput, na_utils.check_flags, required_flags, configuration)

        setattr(configuration, "flag2", "value2")
        self.assertIsNone(na_utils.check_flags(required_flags, configuration))
Exemple #22
0
    def __init__(self, *args, **kwargs):
        super(NetAppDriver, self).__init__()

        app_version = na_utils.OpenStackInfo().info()
        LOG.info(_LI('OpenStack OS Version Info: %(info)s') % {
            'info': app_version})

        self.configuration = kwargs.get('configuration', None)
        if not self.configuration:
            raise exception.InvalidInput(
                reason=_("Required configuration not found"))

        self.configuration.append_config_values(netapp_proxy_opts)
        na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)

        kwargs['app_version'] = app_version

        self.driver = NetAppDriverFactory.create_driver(
            self.configuration.netapp_storage_family,
            self.configuration.netapp_storage_protocol,
            *args, **kwargs)
Exemple #23
0
    def test_check_flags(self):
        class TestClass(object):
            pass

        required_flags = ['flag1', 'flag2']
        configuration = TestClass()
        setattr(configuration, 'flag1', 'value1')
        setattr(configuration, 'flag3', 'value3')
        self.assertRaises(exception.InvalidInput, na_utils.check_flags,
                          required_flags, configuration)

        setattr(configuration, 'flag2', 'value2')
        self.assertIsNone(na_utils.check_flags(required_flags, configuration))
Exemple #24
0
    def test_check_flags(self):

        class TestClass(object):
            pass

        required_flags = ['flag1', 'flag2']
        configuration = TestClass()
        setattr(configuration, 'flag1', 'value1')
        setattr(configuration, 'flag3', 'value3')
        self.assertRaises(exception.InvalidInput, na_utils.check_flags,
                          required_flags, configuration)

        setattr(configuration, 'flag2', 'value2')
        self.assertIsNone(na_utils.check_flags(required_flags, configuration))
Exemple #25
0
 def do_setup(self, context):
     super(NetAppNfsDriver, self).do_setup(context)
     self._context = context
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
Exemple #26
0
 def do_setup(self, context):
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
Exemple #27
0
 def do_setup(self, context):
     super(NetAppNfsDriver, self).do_setup(context)
     self._context = context
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
     self.zapi_client = None
 def do_setup(self, context):
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
     self.lun_ostype = (self.configuration.netapp_lun_ostype
                        or self.DEFAULT_LUN_OS)
     self.host_type = (self.configuration.netapp_host_type
                       or self.DEFAULT_HOST_TYPE)
Exemple #29
0
 def do_setup(self, context):
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
     self.lun_ostype = (self.configuration.netapp_lun_ostype
                        or self.DEFAULT_LUN_OS)
     self.host_type = (self.configuration.netapp_host_type
                       or self.DEFAULT_HOST_TYPE)
Exemple #30
0
 def do_setup(self, context):
     super(NetAppNfsDriver, self).do_setup(context)
     self._context = context
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)
     self.zapi_client = None
     self.ssc_enabled = False
Exemple #31
0
 def do_setup(self, context):
     na_utils.check_flags(self.REQUIRED_FLAGS, self.configuration)