Rename iSCSI target config options to more general
Since NVMET target driver will be implemented it would be good to use the same config options both for NVMEoF and iSCSI targets. That's why this path renames iscsi_ip_address, iscsi_port, iscsi_helper iscsi_target_prefix, iscsi_protocol to target_ip_address, target_port, target_helper, target_prefix, and target_protocol according to current deprecation policy. Change-Id: I5231f8fe3399deb9c57e6efb121d0d008dc9c7f4 Related-Blueprint: nvme-target-cli
This commit is contained in:
parent
4a92c2ec8e
commit
4b092e8d9d
@ -37,7 +37,7 @@ def set_defaults(conf):
|
||||
conf.set_default('volume_driver',
|
||||
'cinder.tests.fake_driver.FakeLoggingVolumeDriver',
|
||||
group=configuration.SHARED_CONF_GROUP)
|
||||
conf.set_default('iscsi_helper', 'fake')
|
||||
conf.set_default('target_helper', 'fake')
|
||||
conf.set_default('rpc_backend', 'cinder.openstack.common.rpc.impl_fake')
|
||||
conf.set_default('connection', 'sqlite://', group='database')
|
||||
conf.set_default('sqlite_synchronous', False, group='database')
|
||||
|
@ -29,8 +29,8 @@ class TargetDriverFixture(test.TestCase):
|
||||
self.configuration = conf.Configuration(None)
|
||||
self.configuration.append_config_values = mock.Mock(return_value=0)
|
||||
self.configuration.safe_get = mock.Mock(side_effect=self.fake_safe_get)
|
||||
self.configuration.iscsi_ip_address = '10.9.8.7'
|
||||
self.configuration.iscsi_port = 3260
|
||||
self.configuration.target_ip_address = '10.9.8.7'
|
||||
self.configuration.target_port = 3260
|
||||
|
||||
self.fake_volumes_dir = tempfile.mkdtemp()
|
||||
fileutils.ensure_tree(self.fake_volumes_dir)
|
||||
@ -71,8 +71,8 @@ class TargetDriverFixture(test.TestCase):
|
||||
'id': self.fake_volume_id,
|
||||
'volume_type_id': None,
|
||||
'provider_location': ('%(ip)s:%(port)d%(iqn)svolume-%(vol)s 2' %
|
||||
{'ip': self.configuration.iscsi_ip_address,
|
||||
'port': self.configuration.iscsi_port,
|
||||
{'ip': self.configuration.target_ip_address,
|
||||
'port': self.configuration.target_port,
|
||||
'iqn': self.iscsi_target_prefix,
|
||||
'vol': self.fake_volume_id}),
|
||||
'provider_auth': 'CHAP stack-1-a60e2611875f40199931f2'
|
||||
@ -107,7 +107,7 @@ class TargetDriverFixture(test.TestCase):
|
||||
def fake_safe_get(self, value):
|
||||
if value == 'volumes_dir':
|
||||
return self.fake_volumes_dir
|
||||
elif value == 'iscsi_protocol':
|
||||
return self.configuration.iscsi_protocol
|
||||
elif value == 'iscsi_target_prefix':
|
||||
elif value == 'target_protocol':
|
||||
return self.configuration.target_protocol
|
||||
elif value == 'target_prefix':
|
||||
return self.iscsi_target_prefix
|
||||
|
@ -38,7 +38,7 @@ class TestBaseISCSITargetDriver(tf.TargetDriverFixture):
|
||||
'CHAP otzL 234Z'}))
|
||||
|
||||
def test_abc_methods_not_present_fails(self):
|
||||
configuration = conf.Configuration(cfg.StrOpt('iscsi_target_prefix',
|
||||
configuration = conf.Configuration(cfg.StrOpt('target_prefix',
|
||||
default='foo',
|
||||
help='you wish'))
|
||||
self.assertRaises(TypeError,
|
||||
|
@ -70,7 +70,7 @@ class TestCxtAdmDriver(tf.TargetDriverFixture):
|
||||
1,
|
||||
0,
|
||||
self.fake_volumes_dir,
|
||||
portals_ips=[self.configuration.iscsi_ip_address]))
|
||||
portals_ips=[self.configuration.target_ip_address]))
|
||||
self.assertTrue(mock_get.called)
|
||||
self.assertTrue(mock_execute.called)
|
||||
self.assertTrue(mock_get_targ.called)
|
||||
@ -136,7 +136,7 @@ class TestCxtAdmDriver(tf.TargetDriverFixture):
|
||||
1,
|
||||
0,
|
||||
self.fake_volumes_dir,
|
||||
portals_ips=[self.configuration.iscsi_ip_address]))
|
||||
portals_ips=[self.configuration.target_ip_address]))
|
||||
self.assertTrue(mock_get.called)
|
||||
self.assertTrue(mock_get_targ.called)
|
||||
self.assertTrue(mock_execute.called)
|
||||
@ -181,5 +181,5 @@ class TestCxtAdmDriver(tf.TargetDriverFixture):
|
||||
1, 0, self.fake_volumes_dir, fake_creds,
|
||||
check_exit_code=False,
|
||||
old_name=None,
|
||||
portals_ips=[self.configuration.iscsi_ip_address],
|
||||
portals_port=self.configuration.iscsi_port)
|
||||
portals_ips=[self.configuration.target_ip_address],
|
||||
portals_port=self.configuration.target_port)
|
||||
|
@ -196,7 +196,7 @@ class TestIetAdmDriver(tf.TargetDriverFixture):
|
||||
self.target.create_iscsi_target.assert_called_once_with(
|
||||
'iqn.2010-10.org.openstack:testvol',
|
||||
1, 0, self.fake_volumes_dir, None,
|
||||
portals_ips=[self.configuration.iscsi_ip_address],
|
||||
portals_port=int(self.configuration.iscsi_port),
|
||||
portals_ips=[self.configuration.target_ip_address],
|
||||
portals_port=int(self.configuration.target_port),
|
||||
check_exit_code=False,
|
||||
old_name=None)
|
||||
|
@ -23,7 +23,7 @@ class TestIserTgtDriver(tf.TargetDriverFixture):
|
||||
|
||||
def setUp(self):
|
||||
super(TestIserTgtDriver, self).setUp()
|
||||
self.configuration.iscsi_protocol = 'iser'
|
||||
self.configuration.target_protocol = 'iser'
|
||||
self.target = tgt.TgtAdm(root_helper=utils.get_root_helper(),
|
||||
configuration=self.configuration)
|
||||
|
||||
@ -47,7 +47,7 @@ class TestIserLioAdmDriver(tf.TargetDriverFixture):
|
||||
"""Unit tests for the iSER LIO flow"""
|
||||
def setUp(self):
|
||||
super(TestIserLioAdmDriver, self).setUp()
|
||||
self.configuration.iscsi_protocol = 'iser'
|
||||
self.configuration.target_protocol = 'iser'
|
||||
with mock.patch.object(lio.LioAdm, '_verify_rtstool'):
|
||||
self.target = lio.LioAdm(root_helper=utils.get_root_helper(),
|
||||
configuration=self.configuration)
|
||||
|
@ -332,8 +332,8 @@ class TestLioAdmDriver(tf.TargetDriverFixture):
|
||||
self.fake_volumes_dir)
|
||||
|
||||
loc = (u'%(ip)s:%(port)d,3 %(prefix)s%(name)s 2' %
|
||||
{'ip': self.configuration.iscsi_ip_address,
|
||||
'port': self.configuration.iscsi_port,
|
||||
{'ip': self.configuration.target_ip_address,
|
||||
'port': self.configuration.target_port,
|
||||
'prefix': self.iscsi_target_prefix,
|
||||
'name': self.testvol_2['name']})
|
||||
|
||||
@ -350,5 +350,5 @@ class TestLioAdmDriver(tf.TargetDriverFixture):
|
||||
2,
|
||||
self.fake_volumes_dir,
|
||||
(mock.sentinel.user, mock.sentinel.pwd),
|
||||
portals_ips=[self.configuration.iscsi_ip_address],
|
||||
portals_port=self.configuration.iscsi_port)
|
||||
portals_ips=[self.configuration.target_ip_address],
|
||||
portals_port=self.configuration.target_port)
|
||||
|
@ -385,8 +385,8 @@ class TestTgtAdmDriver(tf.TargetDriverFixture):
|
||||
0, 1, self.fake_volumes_dir, ('foo', 'bar'),
|
||||
check_exit_code=False,
|
||||
old_name=None,
|
||||
portals_ips=[self.configuration.iscsi_ip_address],
|
||||
portals_port=self.configuration.iscsi_port)
|
||||
portals_ips=[self.configuration.target_ip_address],
|
||||
portals_port=self.configuration.target_port)
|
||||
|
||||
@test.testtools.skipIf(sys.platform == "darwin", "SKIP on OSX")
|
||||
def test_create_iscsi_target_retry(self):
|
||||
|
@ -224,8 +224,8 @@ class DellSCSanISCSIDriverTestCase(test.TestCase):
|
||||
self.configuration.dell_sc_server_folder = 'opnstktst'
|
||||
self.configuration.dell_sc_volume_folder = 'opnstktst'
|
||||
self.configuration.dell_sc_api_port = 3033
|
||||
self.configuration.iscsi_ip_address = '192.168.1.1'
|
||||
self.configuration.iscsi_port = 3260
|
||||
self.configuration.target_ip_address = '192.168.1.1'
|
||||
self.configuration.target_port = 3260
|
||||
self._context = context.get_admin_context()
|
||||
|
||||
self.driver = storagecenter_iscsi.SCISCSIDriver(
|
||||
|
@ -1679,8 +1679,8 @@ class DellSCSanAPITestCase(test.TestCase):
|
||||
# up.
|
||||
self.configuration.dell_sc_verify_cert = True
|
||||
self.configuration.dell_sc_api_port = 3033
|
||||
self.configuration.iscsi_ip_address = '192.168.1.1'
|
||||
self.configuration.iscsi_port = 3260
|
||||
self.configuration.target_ip_address = '192.168.1.1'
|
||||
self.configuration.target_port = 3260
|
||||
self._context = context.get_admin_context()
|
||||
self.apiversion = '2.0'
|
||||
|
||||
@ -8421,8 +8421,8 @@ class DellSCSanAPIConnectionTestCase(test.TestCase):
|
||||
# up.
|
||||
self.configuration.dell_sc_verify_cert = True
|
||||
self.configuration.dell_sc_api_port = 3033
|
||||
self.configuration.iscsi_ip_address = '192.168.1.1'
|
||||
self.configuration.iscsi_port = 3260
|
||||
self.configuration.target_ip_address = '192.168.1.1'
|
||||
self.configuration.target_port = 3260
|
||||
self._context = context.get_admin_context()
|
||||
self.apiversion = '2.0'
|
||||
|
||||
|
@ -650,8 +650,8 @@ class HPE3PARBaseDriver(test.TestCase):
|
||||
configuration.hpe3par_api_url = 'https://1.1.1.1/api/v1'
|
||||
configuration.hpe3par_cpg = [HPE3PAR_CPG, HPE3PAR_CPG2]
|
||||
configuration.hpe3par_cpg_snap = HPE3PAR_CPG_SNAP
|
||||
configuration.iscsi_ip_address = '1.1.1.2'
|
||||
configuration.iscsi_port = '1234'
|
||||
configuration.target_ip_address = '1.1.1.2'
|
||||
configuration.target_port = '1234'
|
||||
configuration.san_ip = HPE3PAR_SAN_IP
|
||||
configuration.san_login = HPE3PAR_USER_NAME
|
||||
configuration.san_password = HPE3PAR_USER_PASS
|
||||
@ -8022,7 +8022,7 @@ class TestHPE3PARISCSIDriver(HPE3PARBaseDriver):
|
||||
def test_invalid_iscsi_ip(self):
|
||||
config = self.setup_configuration()
|
||||
config.hpe3par_iscsi_ips = ['10.10.220.250', '10.10.220.251']
|
||||
config.iscsi_ip_address = '10.10.10.10'
|
||||
config.target_ip_address = '10.10.10.10'
|
||||
mock_conf = {
|
||||
'getPorts.return_value': {
|
||||
'members': [
|
||||
|
@ -118,7 +118,7 @@ class FlashSystemISCSIDriverTestCase(test.TestCase):
|
||||
'san_password': 'password',
|
||||
'flashsystem_connection_protocol': 'iSCSI',
|
||||
'flashsystem_multihostmap_enabled': True,
|
||||
'iscsi_ip_address': '192.168.1.10',
|
||||
'target_ip_address': '192.168.1.10',
|
||||
'flashsystem_iscsi_portid': 1}
|
||||
|
||||
self.connector = {
|
||||
|
@ -44,7 +44,7 @@ class SolidFireVolumeTestCase(test.TestCase):
|
||||
self.configuration.sf_emulate_512 = True
|
||||
self.configuration.sf_account_prefix = 'cinder'
|
||||
self.configuration.reserved_percentage = 25
|
||||
self.configuration.iscsi_helper = None
|
||||
self.configuration.target_helper = None
|
||||
self.configuration.sf_template_account_name = 'openstack-vtemplate'
|
||||
self.configuration.sf_allow_template_caching = False
|
||||
self.configuration.sf_svip = None
|
||||
|
@ -465,9 +465,9 @@ class SynoCommonTestCase(test.TestCase):
|
||||
def setup_configuration(self):
|
||||
config = mock.Mock(spec=conf.Configuration)
|
||||
config.use_chap_auth = False
|
||||
config.iscsi_protocol = 'iscsi'
|
||||
config.iscsi_ip_address = IP
|
||||
config.iscsi_port = 3260
|
||||
config.target_protocol = 'iscsi'
|
||||
config.target_ip_address = IP
|
||||
config.target_port = 3260
|
||||
config.synology_admin_port = 5000
|
||||
config.synology_username = 'admin'
|
||||
config.synology_password = 'admin'
|
||||
@ -475,7 +475,7 @@ class SynoCommonTestCase(test.TestCase):
|
||||
config.synology_one_time_pass = '123456'
|
||||
config.synology_pool_name = POOL_NAME
|
||||
config.volume_dd_blocksize = 1
|
||||
config.iscsi_target_prefix = 'iqn.2000-01.com.synology:'
|
||||
config.target_prefix = 'iqn.2000-01.com.synology:'
|
||||
config.chap_username = 'abcd'
|
||||
config.chap_password = 'qwerty'
|
||||
config.reserved_percentage = 0
|
||||
@ -489,7 +489,7 @@ class SynoCommonTestCase(test.TestCase):
|
||||
@mock.patch.object(common, 'APIRequest')
|
||||
def test___init__(self, _request, _get_node_uuid):
|
||||
self.conf.safe_get = (mock.Mock(side_effect=[
|
||||
self.conf.iscsi_ip_address,
|
||||
self.conf.target_ip_address,
|
||||
'',
|
||||
'']))
|
||||
|
||||
@ -818,7 +818,7 @@ class SynoCommonTestCase(test.TestCase):
|
||||
'success': True
|
||||
}
|
||||
trg_name = self.common.TARGET_NAME_PREFIX + VOLUME['id']
|
||||
iqn = self.conf.iscsi_target_prefix + trg_name
|
||||
iqn = self.conf.target_prefix + trg_name
|
||||
self.conf.use_chap_auth = True
|
||||
self.common.exec_webapi = mock.Mock(return_value=out)
|
||||
self.conf.safe_get = (
|
||||
@ -826,7 +826,7 @@ class SynoCommonTestCase(test.TestCase):
|
||||
self.conf.use_chap_auth,
|
||||
'abcd',
|
||||
'qwerty',
|
||||
self.conf.iscsi_target_prefix]))
|
||||
self.conf.target_prefix]))
|
||||
result = self.common._target_create(VOLUME['id'])
|
||||
(self.common.exec_webapi.
|
||||
assert_called_with('SYNO.Core.ISCSI.Target',
|
||||
@ -848,12 +848,12 @@ class SynoCommonTestCase(test.TestCase):
|
||||
'success': True
|
||||
}
|
||||
trg_name = self.common.TARGET_NAME_PREFIX + VOLUME['id']
|
||||
iqn = self.conf.iscsi_target_prefix + trg_name
|
||||
iqn = self.conf.target_prefix + trg_name
|
||||
self.common.exec_webapi = mock.Mock(return_value=out)
|
||||
self.conf.safe_get = (
|
||||
mock.Mock(side_effect=[
|
||||
self.conf.use_chap_auth,
|
||||
self.conf.iscsi_target_prefix]))
|
||||
self.conf.target_prefix]))
|
||||
result = self.common._target_create(VOLUME['id'])
|
||||
(self.common.exec_webapi.
|
||||
assert_called_with('SYNO.Core.ISCSI.Target',
|
||||
@ -880,9 +880,9 @@ class SynoCommonTestCase(test.TestCase):
|
||||
self.conf.safe_get = (
|
||||
mock.Mock(side_effect=[
|
||||
self.conf.use_chap_auth,
|
||||
self.conf.iscsi_target_prefix,
|
||||
self.conf.target_prefix,
|
||||
self.conf.use_chap_auth,
|
||||
self.conf.iscsi_target_prefix]))
|
||||
self.conf.target_prefix]))
|
||||
|
||||
self.assertRaises(exception.VolumeDriverException,
|
||||
self.common._target_create,
|
||||
@ -1287,11 +1287,11 @@ class SynoCommonTestCase(test.TestCase):
|
||||
|
||||
def test_get_ip(self):
|
||||
result = self.common.get_ip()
|
||||
self.assertEqual(self.conf.iscsi_ip_address, result)
|
||||
self.assertEqual(self.conf.target_ip_address, result)
|
||||
|
||||
def test_get_provider_location(self):
|
||||
self.common.get_ip = (
|
||||
mock.Mock(return_value=self.conf.iscsi_ip_address))
|
||||
mock.Mock(return_value=self.conf.target_ip_address))
|
||||
self.conf.safe_get = (
|
||||
mock.Mock(return_value=['10.0.0.2', '10.0.0.3']))
|
||||
expected = ('10.0.0.1:3260;10.0.0.2:3260;10.0.0.3:3260' +
|
||||
|
@ -94,8 +94,8 @@ class SynoISCSIDriverTestCase(test.TestCase):
|
||||
def setup_configuration(self):
|
||||
config = mock.Mock(spec=conf.Configuration)
|
||||
config.use_chap_auth = False
|
||||
config.iscsi_protocol = 'iscsi'
|
||||
config.iscsi_ip_address = IP
|
||||
config.target_protocol = 'iscsi'
|
||||
config.target_ip_address = IP
|
||||
config.synology_admin_port = 5000
|
||||
config.synology_username = 'admin'
|
||||
config.synology_password = 'admin'
|
||||
@ -328,7 +328,7 @@ class SynoISCSIDriverTestCase(test.TestCase):
|
||||
iscsi_properties = {
|
||||
'target_discovered': False,
|
||||
'target_iqn': IQN,
|
||||
'target_portal': '%s:3260' % self.conf.iscsi_ip_address,
|
||||
'target_portal': '%s:3260' % self.conf.target_ip_address,
|
||||
'volume_id': VOLUME['id'],
|
||||
'access_mode': 'rw',
|
||||
'discard': False
|
||||
@ -341,7 +341,7 @@ class SynoISCSIDriverTestCase(test.TestCase):
|
||||
result = self.driver.initialize_connection(VOLUME, CONNECTOR)
|
||||
|
||||
self.driver.common.get_iscsi_properties.assert_called_with(VOLUME)
|
||||
self.conf.safe_get.assert_called_with('iscsi_protocol')
|
||||
self.conf.safe_get.assert_called_with('target_protocol')
|
||||
self.assertEqual('iscsi', result['driver_volume_type'])
|
||||
self.assertDictEqual(iscsi_properties, result['data'])
|
||||
|
||||
|
@ -289,7 +289,7 @@ class DrbdManageFakeDriver(object):
|
||||
class DrbdManageIscsiTestCase(test.TestCase):
|
||||
|
||||
def _fake_safe_get(self, key):
|
||||
if key == 'iscsi_helper':
|
||||
if key == 'target_helper':
|
||||
return 'fake'
|
||||
|
||||
if key.endswith('_policy'):
|
||||
|
@ -85,7 +85,7 @@ class LVMVolumeDriverTestCase(test_driver.BaseDriverTestCase):
|
||||
self.configuration.volume_clear = 'zero'
|
||||
self.configuration.volume_clear_size = 0
|
||||
self.configuration.lvm_type = 'thin'
|
||||
self.configuration.iscsi_helper = 'tgtadm'
|
||||
self.configuration.target_helper = 'tgtadm'
|
||||
lvm_driver = lvm.LVMVolumeDriver(configuration=self.configuration,
|
||||
vg_obj=vg_obj, db=db)
|
||||
|
||||
@ -877,9 +877,9 @@ class LVMISCSITestCase(test_driver.BaseDriverTestCase):
|
||||
def setUp(self):
|
||||
super(LVMISCSITestCase, self).setUp()
|
||||
self.configuration = mock.Mock(conf.Configuration)
|
||||
self.configuration.iscsi_target_prefix = 'iqn.2010-10.org.openstack:'
|
||||
self.configuration.iscsi_ip_address = '0.0.0.0'
|
||||
self.configuration.iscsi_port = 3260
|
||||
self.configuration.target_prefix = 'iqn.2010-10.org.openstack:'
|
||||
self.configuration.target_ip_address = '0.0.0.0'
|
||||
self.configuration.target_port = 3260
|
||||
|
||||
def _attach_volume(self):
|
||||
"""Attach volumes to an instance."""
|
||||
@ -906,7 +906,7 @@ class LVMISCSITestCase(test_driver.BaseDriverTestCase):
|
||||
cinder.volume.targets.tgt.TgtAdm(
|
||||
configuration=self.configuration)
|
||||
|
||||
ret = ("%s dummy" % CONF.iscsi_ip_address, '')
|
||||
ret = ("%s dummy" % CONF.target_ip_address, '')
|
||||
with mock.patch('cinder.utils.execute',
|
||||
return_value=ret):
|
||||
volume = {"name": "dummy",
|
||||
|
@ -488,7 +488,7 @@ class TestProphetStorDPLDriver(test.TestCase):
|
||||
self.configuration.san_login = 'admin'
|
||||
self.configuration.san_password = 'password'
|
||||
self.configuration.dpl_pool = POOLUUID
|
||||
self.configuration.iscsi_port = 3260
|
||||
self.configuration.target_port = 3260
|
||||
self.configuration.san_is_local = False
|
||||
self.configuration.san_thin_provision = True
|
||||
self.configuration.driver_ssl_cert_verify = False
|
||||
|
@ -611,7 +611,7 @@ def create_configuration(
|
||||
configuration.san_iscsi_ip = san_iscsi_ip
|
||||
configuration.qnap_poolname = poolname
|
||||
configuration.safe_get.return_value = 'QNAP'
|
||||
configuration.iscsi_ip_address = '1.2.3.4'
|
||||
configuration.target_ip_address = '1.2.3.4'
|
||||
configuration.qnap_storage_protocol = 'iscsi'
|
||||
configuration.reserved_percentage = 0
|
||||
configuration.use_chap_auth = False
|
||||
|
@ -73,8 +73,8 @@ class TestWindowsDriver(test.TestCase):
|
||||
if portals_available else [])
|
||||
|
||||
self._driver.configuration = mock.Mock()
|
||||
self._driver.configuration.iscsi_port = iscsi_port
|
||||
self._driver.configuration.iscsi_ip_address = requested_ips[0]
|
||||
self._driver.configuration.target_port = iscsi_port
|
||||
self._driver.configuration.target_ip_address = requested_ips[0]
|
||||
self._driver.configuration.iscsi_secondary_ip_addresses = (
|
||||
requested_ips[1:])
|
||||
|
||||
@ -251,7 +251,7 @@ class TestWindowsDriver(test.TestCase):
|
||||
def test_get_target_name(self):
|
||||
volume = fake_volume.fake_volume_obj(mock.sentinel.fake_context)
|
||||
expected_target_name = "%s%s" % (
|
||||
self._driver.configuration.iscsi_target_prefix,
|
||||
self._driver.configuration.target_prefix,
|
||||
volume.name)
|
||||
|
||||
target_name = self._driver._get_target_name(volume)
|
||||
|
@ -48,16 +48,19 @@ volume_opts = [
|
||||
default=0,
|
||||
min=0, max=100,
|
||||
help='The percentage of backend capacity is reserved'),
|
||||
cfg.StrOpt('iscsi_target_prefix',
|
||||
cfg.StrOpt('target_prefix',
|
||||
deprecated_name='iscsi_target_prefix',
|
||||
default='iqn.2010-10.org.openstack:',
|
||||
help='Prefix for iSCSI volumes'),
|
||||
cfg.StrOpt('iscsi_ip_address',
|
||||
cfg.StrOpt('target_ip_address',
|
||||
deprecated_name='iscsi_ip_address',
|
||||
default='$my_ip',
|
||||
help='The IP address that the iSCSI daemon is listening on'),
|
||||
cfg.ListOpt('iscsi_secondary_ip_addresses',
|
||||
default=[],
|
||||
help='The list of secondary IP addresses of the iSCSI daemon'),
|
||||
cfg.PortOpt('iscsi_port',
|
||||
cfg.PortOpt('target_port',
|
||||
deprecated_name='iscsi_port',
|
||||
default=3260,
|
||||
help='The port that the iSCSI daemon is listening on'),
|
||||
cfg.IntOpt('num_volume_device_scan_tries',
|
||||
@ -88,7 +91,8 @@ volume_opts = [
|
||||
help='The flag to pass to ionice to alter the i/o priority '
|
||||
'of the process used to zero a volume after deletion, '
|
||||
'for example "-c3" for idle only priority.'),
|
||||
cfg.StrOpt('iscsi_helper',
|
||||
cfg.StrOpt('target_helper',
|
||||
deprecated_name='iscsi_helper',
|
||||
default='tgtadm',
|
||||
choices=['tgtadm', 'lioadm', 'scstadmin', 'iscsictl',
|
||||
'ietadm', 'fake'],
|
||||
@ -131,7 +135,7 @@ volume_opts = [
|
||||
choices=['on', 'off'],
|
||||
help='Sets the behavior of the iSCSI target to either '
|
||||
'perform write-back(on) or write-through(off). '
|
||||
'This parameter is valid if iscsi_helper is set '
|
||||
'This parameter is valid if target_helper is set '
|
||||
'to tgtadm.'),
|
||||
cfg.StrOpt('iscsi_target_flags',
|
||||
default='',
|
||||
@ -139,7 +143,8 @@ volume_opts = [
|
||||
'Only used for tgtadm to specify backing device flags '
|
||||
'using bsoflags option. The specified string is passed '
|
||||
'as is to the underlying tool.'),
|
||||
cfg.StrOpt('iscsi_protocol',
|
||||
cfg.StrOpt('target_protocol',
|
||||
deprecated_name='iscsi_protocol',
|
||||
default='iscsi',
|
||||
choices=['iscsi', 'iser'],
|
||||
help='Determines the iSCSI protocol for new iSCSI volumes, '
|
||||
@ -2512,7 +2517,7 @@ class ISCSIDriver(VolumeDriver):
|
||||
return None
|
||||
|
||||
for target in out.splitlines():
|
||||
if (self.configuration.iscsi_ip_address in target
|
||||
if (self.configuration.target_ip_address in target
|
||||
and volume_name in target):
|
||||
return target
|
||||
return None
|
||||
@ -2581,7 +2586,7 @@ class ISCSIDriver(VolumeDriver):
|
||||
except (IndexError, ValueError):
|
||||
if (self.configuration.volume_driver ==
|
||||
'cinder.volume.drivers.lvm.ThinLVMVolumeDriver' and
|
||||
self.configuration.iscsi_helper == 'tgtadm'):
|
||||
self.configuration.target_helper == 'tgtadm'):
|
||||
lun = 1
|
||||
else:
|
||||
lun = 0
|
||||
@ -2687,7 +2692,7 @@ class ISCSIDriver(VolumeDriver):
|
||||
iscsi_properties = self._get_iscsi_properties(volume)
|
||||
return {
|
||||
'driver_volume_type':
|
||||
self.configuration.safe_get('iscsi_protocol'),
|
||||
self.configuration.safe_get('target_protocol'),
|
||||
'data': iscsi_properties
|
||||
}
|
||||
|
||||
@ -2748,11 +2753,11 @@ class ISERDriver(ISCSIDriver):
|
||||
# for backward compatibility
|
||||
self.configuration.num_volume_device_scan_tries = \
|
||||
self.configuration.num_iser_scan_tries
|
||||
self.configuration.iscsi_target_prefix = \
|
||||
self.configuration.target_prefix = \
|
||||
self.configuration.iser_target_prefix
|
||||
self.configuration.iscsi_ip_address = \
|
||||
self.configuration.target_ip_address = \
|
||||
self.configuration.iser_ip_address
|
||||
self.configuration.iscsi_port = self.configuration.iser_port
|
||||
self.configuration.target_port = self.configuration.iser_port
|
||||
|
||||
def initialize_connection(self, volume, connector):
|
||||
"""Initializes the connection and returns connection info.
|
||||
|
@ -790,7 +790,7 @@ class DrbdManageIscsiDriver(DrbdManageBaseDriver):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(DrbdManageIscsiDriver, self).__init__(*args, **kwargs)
|
||||
target_driver = self.target_mapping[
|
||||
self.configuration.safe_get('iscsi_helper')]
|
||||
self.configuration.safe_get('target_helper')]
|
||||
|
||||
LOG.debug('Attempting to initialize DRBD driver with the '
|
||||
'following target_driver: %s',
|
||||
|
@ -1985,7 +1985,7 @@ class FJDXCommon(object):
|
||||
|
||||
iscsi_properties_list = []
|
||||
iscsiip_list = self._get_drvcfg('EternusISCSIIP', multiple=True)
|
||||
iscsi_port = self.configuration.iscsi_port
|
||||
iscsi_port = self.configuration.target_port
|
||||
|
||||
LOG.debug('_get_eternus_iscsi_properties, iplist: %s.', iscsiip_list)
|
||||
|
||||
|
@ -3510,7 +3510,7 @@ class HPE3PARCommon(object):
|
||||
self._client_conf['hpe3par_iscsi_chap_enabled'] = (
|
||||
conf.get('hpe3par_iscsi_chap_enabled'))
|
||||
self._client_conf['iscsi_ip_address'] = (
|
||||
conf.get('iscsi_ip_address'))
|
||||
conf.get('target_ip_address'))
|
||||
self._client_conf['iscsi_port'] = conf.get('iscsi_port')
|
||||
else:
|
||||
self._client_conf['hpe3par_cpg'] = (
|
||||
@ -3532,8 +3532,8 @@ class HPE3PARCommon(object):
|
||||
self._client_conf['hpe3par_iscsi_chap_enabled'] = (
|
||||
self.config.hpe3par_iscsi_chap_enabled)
|
||||
self._client_conf['iscsi_ip_address'] = (
|
||||
self.config.iscsi_ip_address)
|
||||
self._client_conf['iscsi_port'] = self.config.iscsi_port
|
||||
self.config.target_ip_address)
|
||||
self._client_conf['iscsi_port'] = self.config.target_port
|
||||
|
||||
def _get_cpg_from_cpg_map(self, cpg_map, target_cpg):
|
||||
ret_target_cpg = None
|
||||
|
@ -191,7 +191,7 @@ class HPE3PARISCSIDriver(hpebasedriver.HPE3PARDriverBase):
|
||||
if len(temp_iscsi_ip) > 0:
|
||||
LOG.warning("Found invalid iSCSI IP address(s) in "
|
||||
"configuration option(s) hpe3par_iscsi_ips or "
|
||||
"iscsi_ip_address '%s.'",
|
||||
"target_ip_address '%s.'",
|
||||
(", ".join(temp_iscsi_ip)))
|
||||
|
||||
if not len(iscsi_ip_list) > 0:
|
||||
|
@ -106,7 +106,7 @@ class FlashSystemISCSIDriver(fscommon.FlashSystemDriver):
|
||||
|
||||
# Check if iscsi_ip is set when protocol is iSCSI
|
||||
if params['protocol'] == 'iSCSI' and params['iscsi_ip'] == 'None':
|
||||
msg = _("iscsi_ip_address must be set in config file when "
|
||||
msg = _("target_ip_address must be set in config file when "
|
||||
"using protocol 'iSCSI'.")
|
||||
raise exception.InvalidInput(reason=msg)
|
||||
|
||||
@ -222,7 +222,7 @@ class FlashSystemISCSIDriver(fscommon.FlashSystemDriver):
|
||||
ipaddr = preferred_node_entry['ipv4'][0]
|
||||
else:
|
||||
ipaddr = preferred_node_entry['ipv6'][0]
|
||||
iscsi_port = self.configuration.iscsi_port
|
||||
iscsi_port = self.configuration.target_port
|
||||
properties['target_portal'] = '%s:%s' % (ipaddr, iscsi_port)
|
||||
properties['target_iqn'] = preferred_node_entry['iscsi_name']
|
||||
|
||||
@ -342,7 +342,7 @@ class FlashSystemISCSIDriver(fscommon.FlashSystemDriver):
|
||||
speed = port_data['speed']
|
||||
except KeyError:
|
||||
self._handle_keyerror('lsportip', header)
|
||||
if port_ipv4 == self.configuration.iscsi_ip_address and (
|
||||
if port_ipv4 == self.configuration.target_ip_address and (
|
||||
port_data['id'] == (
|
||||
six.text_type(
|
||||
self.configuration.flashsystem_iscsi_portid))):
|
||||
@ -398,8 +398,8 @@ class FlashSystemISCSIDriver(fscommon.FlashSystemDriver):
|
||||
protocol = 'iSCSI'
|
||||
return {
|
||||
'protocol': protocol,
|
||||
'iscsi_ip': self.configuration.iscsi_ip_address,
|
||||
'iscsi_port': self.configuration.iscsi_port,
|
||||
'iscsi_ip': self.configuration.target_ip_address,
|
||||
'iscsi_port': self.configuration.target_port,
|
||||
'iscsi_ported': self.configuration.flashsystem_iscsi_portid,
|
||||
}
|
||||
|
||||
|
@ -108,7 +108,7 @@ class LVMVolumeDriver(driver.VolumeDriver):
|
||||
# the driver (control path), this way
|
||||
# different target drivers can be added (iscsi, FC etc)
|
||||
target_driver = \
|
||||
self.target_mapping[self.configuration.safe_get('iscsi_helper')]
|
||||
self.target_mapping[self.configuration.safe_get('target_helper')]
|
||||
|
||||
LOG.debug('Attempting to initialize LVM driver with the '
|
||||
'following target_driver: %s',
|
||||
|
@ -42,7 +42,7 @@ class DPLISCSIDriver(dplcommon.DPLCOMMONDriver,
|
||||
properties['volume_id'] = volume['id']
|
||||
|
||||
dpl_server = self.configuration.san_ip
|
||||
dpl_iscsi_port = self.configuration.iscsi_port
|
||||
dpl_iscsi_port = self.configuration.target_port
|
||||
ret, output = self.dpl.assign_vdev(self._conver_uuid2hex(
|
||||
volume['id']), connector['initiator'].lower(), volume['id'],
|
||||
'%s:%d' % (dpl_server, dpl_iscsi_port), 0)
|
||||
|
@ -755,7 +755,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
|
||||
LOG.debug('slotid_list: %s', slotid_list)
|
||||
target_portals = []
|
||||
target_portals.append(
|
||||
self.configuration.iscsi_ip_address + ':' + iscsi_port)
|
||||
self.configuration.target_ip_address + ':' + iscsi_port)
|
||||
# target_iqns.append(target_iqn)
|
||||
for index, eth in enumerate(eth_list):
|
||||
# TS NAS do not have slot_id
|
||||
@ -769,7 +769,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
|
||||
target_iqns.append(
|
||||
target_iqn[:-2] + '.' + slotid_list[index])
|
||||
|
||||
if eth == self.configuration.iscsi_ip_address:
|
||||
if eth == self.configuration.target_ip_address:
|
||||
continue
|
||||
target_portals.append(eth + ':' + iscsi_port)
|
||||
|
||||
@ -892,7 +892,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
|
||||
|
||||
properties = {}
|
||||
properties['target_discovered'] = False
|
||||
properties['target_portal'] = (self.configuration.iscsi_ip_address +
|
||||
properties['target_portal'] = (self.configuration.target_ip_address +
|
||||
':' + iscsi_port)
|
||||
properties['target_iqn'] = target_iqn
|
||||
LOG.debug('properties[target_iqn]: %s', properties['target_iqn'])
|
||||
@ -911,7 +911,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
|
||||
LOG.debug('properties: %s', properties)
|
||||
|
||||
provider_location = '%(host)s:%(port)s,1 %(name)s %(tgt_lun)s' % {
|
||||
'host': self.configuration.iscsi_ip_address,
|
||||
'host': self.configuration.target_ip_address,
|
||||
'port': iscsi_port,
|
||||
'name': target_iqn,
|
||||
'tgt_lun': target_lun_id,
|
||||
@ -956,7 +956,7 @@ class QnapISCSIDriver(san.SanISCSIDriver):
|
||||
|
||||
properties = {}
|
||||
properties['target_discovered'] = False
|
||||
properties['target_portal'] = (self.configuration.iscsi_ip_address +
|
||||
properties['target_portal'] = (self.configuration.target_ip_address +
|
||||
':' + self.iscsi_port)
|
||||
properties['target_iqn'] = iqn
|
||||
properties['target_lun'] = target_lun_id
|
||||
|
@ -182,5 +182,5 @@ class SanISCSIDriver(SanDriver, driver.ISCSIDriver):
|
||||
super(SanISCSIDriver, self).__init__(*args, **kwargs)
|
||||
|
||||
def _build_iscsi_target_name(self, volume):
|
||||
return "%s%s" % (self.configuration.iscsi_target_prefix,
|
||||
return "%s%s" % (self.configuration.target_prefix,
|
||||
volume['name'])
|
||||
|
@ -409,9 +409,9 @@ class SynoCommon(object):
|
||||
self.vendor_name = 'Synology'
|
||||
self.driver_type = driver_type
|
||||
self.volume_backend_name = self._get_backend_name()
|
||||
self.iscsi_port = self.config.safe_get('iscsi_port')
|
||||
self.iscsi_port = self.config.safe_get('target_port')
|
||||
|
||||
api = APIRequest(self.config.iscsi_ip_address,
|
||||
api = APIRequest(self.config.target_ip_address,
|
||||
self.config.synology_admin_port,
|
||||
self.config.synology_username,
|
||||
self.config.synology_password,
|
||||
@ -665,7 +665,7 @@ class SynoCommon(object):
|
||||
volutils.generate_password())
|
||||
provider_auth = ' '.join(('CHAP', chap_username, chap_password))
|
||||
|
||||
trg_prefix = self.config.safe_get('iscsi_target_prefix')
|
||||
trg_prefix = self.config.safe_get('target_prefix')
|
||||
trg_name = (self.TARGET_NAME_PREFIX + '%s') % identifier
|
||||
iqn = trg_prefix + trg_name
|
||||
|
||||
@ -961,7 +961,7 @@ class SynoCommon(object):
|
||||
return True
|
||||
|
||||
def get_ip(self):
|
||||
return self.config.iscsi_ip_address
|
||||
return self.config.target_ip_address
|
||||
|
||||
def get_provider_location(self, iqn, trg_id):
|
||||
portals = ['%(ip)s:%(port)d' % {'ip': self.get_ip(),
|
||||
@ -1020,7 +1020,7 @@ class SynoCommon(object):
|
||||
data = {}
|
||||
data['volume_backend_name'] = self.volume_backend_name
|
||||
data['vendor_name'] = self.vendor_name
|
||||
data['storage_protocol'] = self.config.iscsi_protocol
|
||||
data['storage_protocol'] = self.config.target_protocol
|
||||
data['consistencygroup_support'] = False
|
||||
data['QoS_support'] = False
|
||||
data['thin_provisioning_support'] = True
|
||||
@ -1034,7 +1034,7 @@ class SynoCommon(object):
|
||||
data['max_over_subscription_ratio'] = (self.config.
|
||||
max_over_subscription_ratio)
|
||||
|
||||
data['iscsi_ip_address'] = self.config.iscsi_ip_address
|
||||
data['iscsi_ip_address'] = self.config.target_ip_address
|
||||
data['pool_name'] = self.config.synology_pool_name
|
||||
data['backend_info'] = ('%s:%s:%s' %
|
||||
(self.vendor_name,
|
||||
|
@ -157,7 +157,7 @@ class SynoISCSIDriver(driver.ISCSIDriver):
|
||||
with excutils.save_and_reraise_exception():
|
||||
LOG.exception('Failed to initialize_connection.')
|
||||
|
||||
volume_type = self.configuration.safe_get('iscsi_protocol') or 'iscsi'
|
||||
volume_type = self.configuration.safe_get('target_protocol') or 'iscsi'
|
||||
|
||||
return {
|
||||
'driver_volume_type': volume_type,
|
||||
|
@ -84,8 +84,8 @@ class WindowsDriver(driver.ISCSIDriver):
|
||||
fail_if_none_found=True))
|
||||
LOG.debug("Available iSCSI portals: %s", available_portals)
|
||||
|
||||
iscsi_port = self.configuration.iscsi_port
|
||||
iscsi_ips = ([self.configuration.iscsi_ip_address] +
|
||||
iscsi_port = self.configuration.target_port
|
||||
iscsi_ips = ([self.configuration.target_ip_address] +
|
||||
self.configuration.iscsi_secondary_ip_addresses)
|
||||
requested_portals = {':'.join([iscsi_ip, str(iscsi_port)])
|
||||
for iscsi_ip in iscsi_ips}
|
||||
@ -210,7 +210,7 @@ class WindowsDriver(driver.ISCSIDriver):
|
||||
pass
|
||||
|
||||
def _get_target_name(self, volume):
|
||||
return "%s%s" % (self.configuration.iscsi_target_prefix,
|
||||
return "%s%s" % (self.configuration.target_prefix,
|
||||
volume.name)
|
||||
|
||||
def create_export(self, context, volume, connector):
|
||||
|
@ -36,9 +36,9 @@ class ISCSITarget(driver.Target):
|
||||
def __init__(self, *args, **kwargs):
|
||||
super(ISCSITarget, self).__init__(*args, **kwargs)
|
||||
self.iscsi_target_prefix = \
|
||||
self.configuration.safe_get('iscsi_target_prefix')
|
||||
self.configuration.safe_get('target_prefix')
|
||||
self.iscsi_protocol = \
|
||||
self.configuration.safe_get('iscsi_protocol')
|
||||
self.configuration.safe_get('target_protocol')
|
||||
self.protocol = 'iSCSI'
|
||||
self.volumes_dir = self.configuration.safe_get('volumes_dir')
|
||||
|
||||
@ -111,7 +111,7 @@ class ISCSITarget(driver.Target):
|
||||
# others like LIO use 0.
|
||||
if (self.configuration.volume_driver ==
|
||||
'cinder.volume.drivers.lvm.ThinLVMVolumeDriver' and
|
||||
self.configuration.iscsi_helper == 'tgtadm'):
|
||||
self.configuration.target_helper == 'tgtadm'):
|
||||
lun = 1
|
||||
else:
|
||||
lun = 0
|
||||
@ -170,23 +170,23 @@ class ISCSITarget(driver.Target):
|
||||
return None
|
||||
|
||||
for target in out.splitlines():
|
||||
if (self.configuration.safe_get('iscsi_ip_address') in target
|
||||
if (self.configuration.safe_get('target_ip_address') in target
|
||||
and volume_id in target):
|
||||
return target
|
||||
return None
|
||||
|
||||
def _get_portals_config(self):
|
||||
# Prepare portals configuration
|
||||
portals_ips = ([self.configuration.iscsi_ip_address]
|
||||
portals_ips = ([self.configuration.target_ip_address]
|
||||
+ self.configuration.iscsi_secondary_ip_addresses or [])
|
||||
|
||||
return {'portals_ips': portals_ips,
|
||||
'portals_port': self.configuration.iscsi_port}
|
||||
'portals_port': self.configuration.target_port}
|
||||
|
||||
def create_export(self, context, volume, volume_path):
|
||||
"""Creates an export for a logical volume."""
|
||||
# 'iscsi_name': 'iqn.2010-10.org.openstack:volume-00000001'
|
||||
iscsi_name = "%s%s" % (self.configuration.iscsi_target_prefix,
|
||||
iscsi_name = "%s%s" % (self.configuration.target_prefix,
|
||||
volume['name'])
|
||||
iscsi_target, lun = self._get_target_and_lun(context, volume)
|
||||
|
||||
@ -210,7 +210,7 @@ class ISCSITarget(driver.Target):
|
||||
**portals_config)
|
||||
data = {}
|
||||
data['location'] = self._iscsi_location(
|
||||
self.configuration.iscsi_ip_address, tid, iscsi_name, lun,
|
||||
self.configuration.target_ip_address, tid, iscsi_name, lun,
|
||||
self.configuration.iscsi_secondary_ip_addresses)
|
||||
LOG.debug('Set provider_location to: %s', data['location'])
|
||||
data['auth'] = self._iscsi_authentication(
|
||||
@ -246,7 +246,7 @@ class ISCSITarget(driver.Target):
|
||||
|
||||
def ensure_export(self, context, volume, volume_path):
|
||||
"""Recreates an export for a logical volume."""
|
||||
iscsi_name = "%s%s" % (self.configuration.iscsi_target_prefix,
|
||||
iscsi_name = "%s%s" % (self.configuration.target_prefix,
|
||||
volume['name'])
|
||||
|
||||
chap_auth = self._get_target_chap_auth(context, volume)
|
||||
@ -301,7 +301,7 @@ class ISCSITarget(driver.Target):
|
||||
|
||||
def _iscsi_location(self, ip, target, iqn, lun=None, ip_secondary=None):
|
||||
ip_secondary = ip_secondary or []
|
||||
port = self.configuration.iscsi_port
|
||||
port = self.configuration.target_port
|
||||
portals = map(lambda x: "%s:%s" % (x, port), [ip] + ip_secondary)
|
||||
return ("%(portals)s,%(target)s %(iqn)s %(lun)s"
|
||||
% ({'portals': ";".join(portals),
|
||||
|
@ -28,7 +28,7 @@ class LioAdm(iscsi.ISCSITarget):
|
||||
|
||||
# FIXME(jdg): modify executor to use the cinder-rtstool
|
||||
self.iscsi_target_prefix =\
|
||||
self.configuration.safe_get('iscsi_target_prefix')
|
||||
self.configuration.safe_get('target_prefix')
|
||||
|
||||
self._verify_rtstool()
|
||||
|
||||
|
@ -28,7 +28,7 @@ class SCSTAdm(iscsi.ISCSITarget):
|
||||
super(SCSTAdm, self).__init__(*args, **kwargs)
|
||||
self.volumes_dir = self.configuration.safe_get('volumes_dir')
|
||||
self.iscsi_target_prefix = self.configuration.safe_get(
|
||||
'iscsi_target_prefix')
|
||||
'target_prefix')
|
||||
self.target_name = self.configuration.safe_get('scst_target_iqn_name')
|
||||
self.target_driver = self.configuration.safe_get('scst_target_driver')
|
||||
self.chap_username = self.configuration.safe_get('chap_username')
|
||||
@ -231,12 +231,12 @@ class SCSTAdm(iscsi.ISCSITarget):
|
||||
return tid
|
||||
|
||||
def _iscsi_location(self, ip, target, iqn, lun=None):
|
||||
return "%s:%s,%s %s %s" % (ip, self.configuration.iscsi_port,
|
||||
return "%s:%s,%s %s %s" % (ip, self.configuration.target_port,
|
||||
target, iqn, lun)
|
||||
|
||||
def _get_iscsi_name(self, volume):
|
||||
if self.target_name is None:
|
||||
return "%s%s" % (self.configuration.iscsi_target_prefix,
|
||||
return "%s%s" % (self.configuration.target_prefix,
|
||||
volume['name'])
|
||||
else:
|
||||
return self.target_name
|
||||
@ -296,7 +296,7 @@ class SCSTAdm(iscsi.ISCSITarget):
|
||||
|
||||
data = {}
|
||||
data['location'] = self._iscsi_location(
|
||||
self.configuration.iscsi_ip_address, tid, iscsi_name, lun)
|
||||
self.configuration.target_ip_address, tid, iscsi_name, lun)
|
||||
LOG.debug('Set provider_location to: %s', data['location'])
|
||||
data['auth'] = self._iscsi_authentication(
|
||||
'CHAP', *chap_auth)
|
||||
|
@ -0,0 +1,8 @@
|
||||
---
|
||||
deprecations:
|
||||
- |
|
||||
``iscsi_ip_address``, ``iscsi_port``, ``target_helper``,
|
||||
``iscsi_target_prefix`` and ``iscsi_protocol`` config options are
|
||||
deprecated in flavor of ``target_ip_address``, ``target_port``,
|
||||
``target_helper``, ``target_prefix`` and ``target_protocol`` accordingly.
|
||||
Old config options will be removed in S release.
|
Loading…
Reference in New Issue
Block a user