Remove support for "lvm_share_export_ip"
The LVM driver accepts a "lvm_share_export_ips" option instead of "lvm_share_export_ip" since the Pike release [1]. Let's drop support for this option and cleanup compatibility code. [1] Ib3594aa5d7751c829820fce830d87f6ceea6b049 Change-Id: Ifdeb470438c204cc6cc370517833cb2cab5b7822
This commit is contained in:
parent
8d03a2a46e
commit
8e1343c9cd
@ -40,11 +40,12 @@ below:
|
|||||||
[LVM_sample_backend]
|
[LVM_sample_backend]
|
||||||
driver_handles_share_servers = False
|
driver_handles_share_servers = False
|
||||||
share_driver = manila.share.drivers.lvm.LVMShareDriver
|
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
|
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
|
Supported shared file systems and operations
|
||||||
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
|
||||||
|
@ -18,8 +18,8 @@
|
|||||||
- Description
|
- Description
|
||||||
* - **[DEFAULT]**
|
* - **[DEFAULT]**
|
||||||
-
|
-
|
||||||
* - ``lvm_share_export_ip`` = ``None``
|
* - ``lvm_share_export_ips`` = ``None``
|
||||||
- (String) IP to be added to export string.
|
- (String) List of IPs to export shares belonging to the LVM storage driver.
|
||||||
* - ``lvm_share_export_root`` = ``$state_path/mnt``
|
* - ``lvm_share_export_root`` = ``$state_path/mnt``
|
||||||
- (String) Base folder where exported shares are located.
|
- (String) Base folder where exported shares are located.
|
||||||
* - ``lvm_share_helpers`` = ``CIFS=manila.share.drivers.helpers.CIFSHelperUserAccess, NFS=manila.share.drivers.helpers.NFSHelper``
|
* - ``lvm_share_helpers`` = ``CIFS=manila.share.drivers.helpers.CIFSHelperUserAccess, NFS=manila.share.drivers.helpers.NFSHelper``
|
||||||
|
@ -85,12 +85,12 @@ Configure components
|
|||||||
share_driver = manila.share.drivers.lvm.LVMShareDriver
|
share_driver = manila.share.drivers.lvm.LVMShareDriver
|
||||||
driver_handles_share_servers = False
|
driver_handles_share_servers = False
|
||||||
lvm_share_volume_group = manila-volumes
|
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
|
Replace ``MANAGEMENT_INTERFACE_IP_ADDRESS`` with the IP address
|
||||||
of the management network interface on your storage node,
|
of the management network interface on your storage node. The value of
|
||||||
typically 10.0.0.41 for the first node in the example architecture
|
this option can be a comma separated string of one or more IP addresses.
|
||||||
shown below:
|
In the example architecture shown below, the address would be 10.0.0.41:
|
||||||
|
|
||||||
.. figure:: figures/hwreqs.png
|
.. figure:: figures/hwreqs.png
|
||||||
:alt: Hardware requirements
|
:alt: Hardware requirements
|
||||||
|
@ -41,12 +41,9 @@ share_opts = [
|
|||||||
cfg.StrOpt('lvm_share_export_root',
|
cfg.StrOpt('lvm_share_export_root',
|
||||||
default='$state_path/mnt',
|
default='$state_path/mnt',
|
||||||
help='Base folder where exported shares are located.'),
|
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',
|
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',
|
cfg.IntOpt('lvm_share_mirrors',
|
||||||
default=0,
|
default=0,
|
||||||
help='If set, create LVMs with multiple mirrors. Note that '
|
help='If set, create LVMs with multiple mirrors. Note that '
|
||||||
@ -78,15 +75,8 @@ class LVMMixin(driver.ExecuteMixin):
|
|||||||
% self.configuration.lvm_share_volume_group)
|
% self.configuration.lvm_share_volume_group)
|
||||||
raise exception.InvalidParameterValue(err=msg)
|
raise exception.InvalidParameterValue(err=msg)
|
||||||
|
|
||||||
if (self.configuration.lvm_share_export_ip and
|
if not self.configuration.lvm_share_export_ips:
|
||||||
self.configuration.lvm_share_export_ips):
|
msg = _("The option lvm_share_export_ips must be specified.")
|
||||||
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."))
|
|
||||||
raise exception.InvalidParameterValue(err=msg)
|
raise exception.InvalidParameterValue(err=msg)
|
||||||
|
|
||||||
def _allocate_container(self, share):
|
def _allocate_container(self, share):
|
||||||
@ -176,12 +166,9 @@ class LVMShareDriver(LVMMixin, driver.ShareDriver):
|
|||||||
'instance_id': self.backend_name,
|
'instance_id': self.backend_name,
|
||||||
'lock_name': 'manila_lvm',
|
'lock_name': 'manila_lvm',
|
||||||
}
|
}
|
||||||
if self.configuration.lvm_share_export_ip:
|
self.share_server['public_addresses'] = (
|
||||||
self.share_server['public_addresses'] = [
|
self.configuration.lvm_share_export_ips
|
||||||
self.configuration.lvm_share_export_ip]
|
)
|
||||||
else:
|
|
||||||
self.share_server['public_addresses'] = (
|
|
||||||
self.configuration.lvm_share_export_ips)
|
|
||||||
self.ipv6_implemented = True
|
self.ipv6_implemented = True
|
||||||
|
|
||||||
def _ssh_exec_as_root(self, server, command, check_exit_code=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:
|
if self.configured_ip_version is None:
|
||||||
try:
|
try:
|
||||||
self.configured_ip_version = []
|
self.configured_ip_version = []
|
||||||
if self.configuration.lvm_share_export_ip:
|
for ip in self.configuration.lvm_share_export_ips:
|
||||||
self.configured_ip_version.append(ipaddress.ip_address(
|
self.configured_ip_version.append(
|
||||||
six.text_type(
|
ipaddress.ip_address(six.text_type(ip)).version)
|
||||||
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)
|
|
||||||
except Exception:
|
except Exception:
|
||||||
if self.configuration.lvm_share_export_ip:
|
message = (_("Invalid 'lvm_share_export_ips' option supplied "
|
||||||
message = (_("Invalid 'lvm_share_export_ip' option "
|
"%s.") % self.configuration.lvm_share_export_ips)
|
||||||
"supplied %s.") %
|
|
||||||
self.configuration.lvm_share_export_ip)
|
|
||||||
else:
|
|
||||||
message = (_("Invalid 'lvm_share_export_ips' option "
|
|
||||||
"supplied %s.") %
|
|
||||||
self.configuration.lvm_share_export_ips)
|
|
||||||
raise exception.InvalidInput(reason=message)
|
raise exception.InvalidInput(reason=message)
|
||||||
return self.configured_ip_version
|
return self.configured_ip_version
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ from manila.tests.share.drivers.container import fakes as cont_fakes
|
|||||||
|
|
||||||
|
|
||||||
CONF = cfg.CONF
|
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
|
@ddt.ddt
|
||||||
@ -53,7 +53,7 @@ class ContainerShareDriverTestCase(test.TestCase):
|
|||||||
self.share = cont_fakes.fake_share()
|
self.share = cont_fakes.fake_share()
|
||||||
self.access = cont_fakes.fake_access()
|
self.access = cont_fakes.fake_access()
|
||||||
self.server = {
|
self.server = {
|
||||||
'public_address': self.fake_conf.lvm_share_export_ip,
|
'public_address': self.fake_conf.lvm_share_export_ips,
|
||||||
'instance_id': 'LVM',
|
'instance_id': 'LVM',
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -150,16 +150,6 @@ class LVMShareDriverTestCase(test.TestCase):
|
|||||||
self.assertRaises(exception.InvalidParameterValue,
|
self.assertRaises(exception.InvalidParameterValue,
|
||||||
self._driver.check_for_setup_error)
|
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 test_check_for_setup_error_no_export_ips(self):
|
||||||
def exec_runner(*ignore_args, **ignore_kwargs):
|
def exec_runner(*ignore_args, **ignore_kwargs):
|
||||||
return '\n fake1\n fakevg\n fake2\n', ''
|
return '\n fake1\n fakevg\n fake2\n', ''
|
||||||
@ -170,16 +160,6 @@ class LVMShareDriverTestCase(test.TestCase):
|
|||||||
self.assertRaises(exception.InvalidParameterValue,
|
self.assertRaises(exception.InvalidParameterValue,
|
||||||
self._driver.check_for_setup_error)
|
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):
|
def test_local_path_normal(self):
|
||||||
share = fake_share(name='fake_sharename')
|
share = fake_share(name='fake_sharename')
|
||||||
CONF.set_default('lvm_share_volume_group', 'fake_vg')
|
CONF.set_default('lvm_share_volume_group', 'fake_vg')
|
||||||
@ -403,15 +383,15 @@ class LVMShareDriverTestCase(test.TestCase):
|
|||||||
self.server, self.share['name'],
|
self.server, self.share['name'],
|
||||||
access_rules, add_rules=add_rules, delete_rules=delete_rules))
|
access_rules, add_rules=add_rules, delete_rules=delete_rules))
|
||||||
|
|
||||||
@ddt.data(('1001::1001/129', None, False), ('1.1.1.256', None, False),
|
@ddt.data((['1001::1001/129'], False),
|
||||||
('1001::1001', None, [6]), ('1.1.1.0', None, [4]),
|
(['1.1.1.256'], False),
|
||||||
(None, ['1001::1001', '1.1.1.0'], [6, 4]),
|
(['1001::1001'], [6]),
|
||||||
(None, ['1001::1001'], [6]), (None, ['1.1.1.0'], [4]),
|
('1.1.1.0', [4]),
|
||||||
(None, ['1001::1001/129', '1.1.1.0'], False))
|
(['1001::1001', '1.1.1.0'], [6, 4]),
|
||||||
|
(['1001::1001/129', '1.1.1.0'], False))
|
||||||
@ddt.unpack
|
@ddt.unpack
|
||||||
def test_get_configured_ip_versions(
|
def test_get_configured_ip_versions(self, configured_ips,
|
||||||
self, configured_ip, configured_ips, configured_ip_version):
|
configured_ip_version):
|
||||||
CONF.set_default('lvm_share_export_ip', configured_ip)
|
|
||||||
CONF.set_default('lvm_share_export_ips', configured_ips)
|
CONF.set_default('lvm_share_export_ips', configured_ips)
|
||||||
if configured_ip_version:
|
if configured_ip_version:
|
||||||
self.assertEqual(configured_ip_version,
|
self.assertEqual(configured_ip_version,
|
||||||
@ -547,10 +527,10 @@ class LVMShareDriverTestCase(test.TestCase):
|
|||||||
'count=1024', 'bs=1M',
|
'count=1024', 'bs=1M',
|
||||||
run_as_root=True)
|
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
|
@ddt.unpack
|
||||||
def test_update_share_stats(self, configured_ip, version):
|
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',
|
self.mock_object(self._driver, 'get_share_server_pools',
|
||||||
mock.Mock(return_value='test-pool'))
|
mock.Mock(return_value='test-pool'))
|
||||||
|
|
||||||
|
@ -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).
|
Loading…
Reference in New Issue
Block a user