diff --git a/doc/source/configuration/shared-file-systems/drivers/lvm-driver.rst b/doc/source/configuration/shared-file-systems/drivers/lvm-driver.rst index 1652a6b4a9..e0b8ae8958 100644 --- a/doc/source/configuration/shared-file-systems/drivers/lvm-driver.rst +++ b/doc/source/configuration/shared-file-systems/drivers/lvm-driver.rst @@ -40,11 +40,12 @@ below: [LVM_sample_backend] driver_handles_share_servers = False share_driver = manila.share.drivers.lvm.LVMShareDriver - lvm_share_export_ip = 1.2.3.4 + lvm_share_export_ips = 1.2.3.4 -In the example above, ``lvm_share_export_ip`` is the address to be used by +In the example above, ``lvm_share_export_ips`` is the address to be used by clients for accessing shares. In the simplest case, it should be the same -as host's address. +as host's address. The option allows configuring more than one IP address as +a comma separated string. Supported shared file systems and operations ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ diff --git a/doc/source/configuration/tables/manila-lvm.inc b/doc/source/configuration/tables/manila-lvm.inc index 2c9857a5ad..51c2a385e0 100644 --- a/doc/source/configuration/tables/manila-lvm.inc +++ b/doc/source/configuration/tables/manila-lvm.inc @@ -18,8 +18,8 @@ - Description * - **[DEFAULT]** - - * - ``lvm_share_export_ip`` = ``None`` - - (String) IP to be added to export string. + * - ``lvm_share_export_ips`` = ``None`` + - (String) List of IPs to export shares belonging to the LVM storage driver. * - ``lvm_share_export_root`` = ``$state_path/mnt`` - (String) Base folder where exported shares are located. * - ``lvm_share_helpers`` = ``CIFS=manila.share.drivers.helpers.CIFSHelperUserAccess, NFS=manila.share.drivers.helpers.NFSHelper`` diff --git a/doc/source/install/common/dhss-false-mode-configuration.rst b/doc/source/install/common/dhss-false-mode-configuration.rst index 662ba57622..484bce0916 100644 --- a/doc/source/install/common/dhss-false-mode-configuration.rst +++ b/doc/source/install/common/dhss-false-mode-configuration.rst @@ -85,12 +85,12 @@ Configure components share_driver = manila.share.drivers.lvm.LVMShareDriver driver_handles_share_servers = False lvm_share_volume_group = manila-volumes - lvm_share_export_ip = MANAGEMENT_INTERFACE_IP_ADDRESS + lvm_share_export_ips = MANAGEMENT_INTERFACE_IP_ADDRESS Replace ``MANAGEMENT_INTERFACE_IP_ADDRESS`` with the IP address - of the management network interface on your storage node, - typically 10.0.0.41 for the first node in the example architecture - shown below: + of the management network interface on your storage node. The value of + this option can be a comma separated string of one or more IP addresses. + In the example architecture shown below, the address would be 10.0.0.41: .. figure:: figures/hwreqs.png :alt: Hardware requirements diff --git a/manila/share/drivers/lvm.py b/manila/share/drivers/lvm.py index fe32d1be3e..6f56a9ab19 100644 --- a/manila/share/drivers/lvm.py +++ b/manila/share/drivers/lvm.py @@ -41,12 +41,9 @@ share_opts = [ cfg.StrOpt('lvm_share_export_root', default='$state_path/mnt', help='Base folder where exported shares are located.'), - cfg.StrOpt('lvm_share_export_ip', - deprecated_for_removal=True, - deprecated_reason='Use lvm_share_export_ips instead.', - help='IP to be added to export string.'), cfg.ListOpt('lvm_share_export_ips', - help='List of IPs to export shares.'), + help='List of IPs to export shares belonging to the LVM ' + 'storage driver.'), cfg.IntOpt('lvm_share_mirrors', default=0, help='If set, create LVMs with multiple mirrors. Note that ' @@ -78,15 +75,8 @@ class LVMMixin(driver.ExecuteMixin): % self.configuration.lvm_share_volume_group) raise exception.InvalidParameterValue(err=msg) - if (self.configuration.lvm_share_export_ip and - self.configuration.lvm_share_export_ips): - msg = (_("Only one of lvm_share_export_ip or lvm_share_export_ips" - " may be specified.")) - raise exception.InvalidParameterValue(err=msg) - if not (self.configuration.lvm_share_export_ip or - self.configuration.lvm_share_export_ips): - msg = (_("Neither lvm_share_export_ip nor lvm_share_export_ips is" - " specified.")) + if not self.configuration.lvm_share_export_ips: + msg = _("The option lvm_share_export_ips must be specified.") raise exception.InvalidParameterValue(err=msg) def _allocate_container(self, share): @@ -176,12 +166,9 @@ class LVMShareDriver(LVMMixin, driver.ShareDriver): 'instance_id': self.backend_name, 'lock_name': 'manila_lvm', } - if self.configuration.lvm_share_export_ip: - self.share_server['public_addresses'] = [ - self.configuration.lvm_share_export_ip] - else: - self.share_server['public_addresses'] = ( - self.configuration.lvm_share_export_ips) + self.share_server['public_addresses'] = ( + self.configuration.lvm_share_export_ips + ) self.ipv6_implemented = True def _ssh_exec_as_root(self, server, command, check_exit_code=True): @@ -452,23 +439,12 @@ class LVMShareDriver(LVMMixin, driver.ShareDriver): if self.configured_ip_version is None: try: self.configured_ip_version = [] - if self.configuration.lvm_share_export_ip: - self.configured_ip_version.append(ipaddress.ip_address( - six.text_type( - self.configuration.lvm_share_export_ip)).version) - else: - for ip in self.configuration.lvm_share_export_ips: - self.configured_ip_version.append( - ipaddress.ip_address(six.text_type(ip)).version) + for ip in self.configuration.lvm_share_export_ips: + self.configured_ip_version.append( + ipaddress.ip_address(six.text_type(ip)).version) except Exception: - if self.configuration.lvm_share_export_ip: - message = (_("Invalid 'lvm_share_export_ip' option " - "supplied %s.") % - self.configuration.lvm_share_export_ip) - else: - message = (_("Invalid 'lvm_share_export_ips' option " - "supplied %s.") % - self.configuration.lvm_share_export_ips) + message = (_("Invalid 'lvm_share_export_ips' option supplied " + "%s.") % self.configuration.lvm_share_export_ips) raise exception.InvalidInput(reason=message) return self.configured_ip_version diff --git a/manila/tests/share/drivers/container/test_driver.py b/manila/tests/share/drivers/container/test_driver.py index f8a623e0a1..ebe5d45429 100644 --- a/manila/tests/share/drivers/container/test_driver.py +++ b/manila/tests/share/drivers/container/test_driver.py @@ -31,7 +31,7 @@ from manila.tests.share.drivers.container import fakes as cont_fakes CONF = cfg.CONF -CONF.import_opt('lvm_share_export_ip', 'manila.share.drivers.lvm') +CONF.import_opt('lvm_share_export_ips', 'manila.share.drivers.lvm') @ddt.ddt @@ -53,7 +53,7 @@ class ContainerShareDriverTestCase(test.TestCase): self.share = cont_fakes.fake_share() self.access = cont_fakes.fake_access() self.server = { - 'public_address': self.fake_conf.lvm_share_export_ip, + 'public_address': self.fake_conf.lvm_share_export_ips, 'instance_id': 'LVM', } diff --git a/manila/tests/share/drivers/test_lvm.py b/manila/tests/share/drivers/test_lvm.py index addb1fc30e..99573b94f8 100644 --- a/manila/tests/share/drivers/test_lvm.py +++ b/manila/tests/share/drivers/test_lvm.py @@ -150,16 +150,6 @@ class LVMShareDriverTestCase(test.TestCase): self.assertRaises(exception.InvalidParameterValue, self._driver.check_for_setup_error) - def test_check_for_setup_error_deprecated_export_ip(self): - def exec_runner(*ignore_args, **ignore_kwargs): - return '\n fake1\n fakevg\n fake2\n', '' - - fake_utils.fake_execute_set_repliers([('vgs --noheadings -o name', - exec_runner)]) - CONF.set_default('lvm_share_export_ip', CONF.lvm_share_export_ips[0]) - CONF.set_default('lvm_share_export_ips', None) - self.assertIsNone(self._driver.check_for_setup_error()) - def test_check_for_setup_error_no_export_ips(self): def exec_runner(*ignore_args, **ignore_kwargs): return '\n fake1\n fakevg\n fake2\n', '' @@ -170,16 +160,6 @@ class LVMShareDriverTestCase(test.TestCase): self.assertRaises(exception.InvalidParameterValue, self._driver.check_for_setup_error) - def test_check_for_setup_error_both_export_ip_and_ips(self): - def exec_runner(*ignore_args, **ignore_kwargs): - return '\n fake1\n fakevg\n fake2\n', '' - - fake_utils.fake_execute_set_repliers([('vgs --noheadings -o name', - exec_runner)]) - CONF.set_default('lvm_share_export_ip', CONF.lvm_share_export_ips[0]) - self.assertRaises(exception.InvalidParameterValue, - self._driver.check_for_setup_error) - def test_local_path_normal(self): share = fake_share(name='fake_sharename') CONF.set_default('lvm_share_volume_group', 'fake_vg') @@ -403,15 +383,15 @@ class LVMShareDriverTestCase(test.TestCase): self.server, self.share['name'], access_rules, add_rules=add_rules, delete_rules=delete_rules)) - @ddt.data(('1001::1001/129', None, False), ('1.1.1.256', None, False), - ('1001::1001', None, [6]), ('1.1.1.0', None, [4]), - (None, ['1001::1001', '1.1.1.0'], [6, 4]), - (None, ['1001::1001'], [6]), (None, ['1.1.1.0'], [4]), - (None, ['1001::1001/129', '1.1.1.0'], False)) + @ddt.data((['1001::1001/129'], False), + (['1.1.1.256'], False), + (['1001::1001'], [6]), + ('1.1.1.0', [4]), + (['1001::1001', '1.1.1.0'], [6, 4]), + (['1001::1001/129', '1.1.1.0'], False)) @ddt.unpack - def test_get_configured_ip_versions( - self, configured_ip, configured_ips, configured_ip_version): - CONF.set_default('lvm_share_export_ip', configured_ip) + def test_get_configured_ip_versions(self, configured_ips, + configured_ip_version): CONF.set_default('lvm_share_export_ips', configured_ips) if configured_ip_version: self.assertEqual(configured_ip_version, @@ -547,10 +527,10 @@ class LVMShareDriverTestCase(test.TestCase): 'count=1024', 'bs=1M', run_as_root=True) - @ddt.data(('1.1.1.1', 4), ('1001::1001', 6)) + @ddt.data((['1.1.1.1'], 4), (['1001::1001'], 6)) @ddt.unpack def test_update_share_stats(self, configured_ip, version): - CONF.set_default('lvm_share_export_ip', configured_ip) + CONF.set_default('lvm_share_export_ips', configured_ip) self.mock_object(self._driver, 'get_share_server_pools', mock.Mock(return_value='test-pool')) diff --git a/releasenotes/notes/drop-support-for-lvm-share-export-ip-e031ef4c5f95b534.yaml b/releasenotes/notes/drop-support-for-lvm-share-export-ip-e031ef4c5f95b534.yaml new file mode 100644 index 0000000000..53b7a17dee --- /dev/null +++ b/releasenotes/notes/drop-support-for-lvm-share-export-ip-e031ef4c5f95b534.yaml @@ -0,0 +1,7 @@ +--- +upgrade: + - | + The LVM driver configuration option ``lvm_share_export_ip`` is no longer + supported. This option has been replaced by ``lvm_share_export_ips`` + which accepts a comma-separated string of IP addresses of the host + exporting the LVM shares (NFS/CIFS share server). \ No newline at end of file