class LioAdm(TargetAdmin):
"""iSCSI target administration for LIO using python-rtslib."""
- def __init__(self, root_helper, lio_initiator_iqns='',
+ def __init__(self, root_helper,
iscsi_target_prefix='iqn.2010-10.org.openstack:',
execute=putils.execute):
super(LioAdm, self).__init__('cinder-rtstool', root_helper, execute)
self.iscsi_target_prefix = iscsi_target_prefix
- self.lio_initiator_iqns = lio_initiator_iqns
self._verify_rtstool()
def _verify_rtstool(self):
if chap_auth is not None:
(chap_auth_userid, chap_auth_password) = chap_auth.split(' ')[1:]
- extra_args = []
- if self.lio_initiator_iqns:
- extra_args.append(self.lio_initiator_iqns)
-
try:
command_args = ['create',
path,
name,
chap_auth_userid,
chap_auth_password]
- if extra_args:
- command_args.extend(extra_args)
self._run('cinder-rtstool', *command_args, run_as_root=True)
except putils.ProcessExecutionError as e:
LOG.error(_LE("Failed to create iscsi target for volume "
conf.set_default('volume_driver',
'cinder.tests.fake_driver.FakeISCSIDriver')
conf.set_default('iscsi_helper', 'fake')
- conf.set_default('fake_rabbit', True)
conf.set_default('rpc_backend', 'cinder.openstack.common.rpc.impl_fake')
conf.set_default('iscsi_num_targets', 8)
conf.set_default('connection', 'sqlite://', group='database')
help='IET configuration file'),
cfg.StrOpt('lio_initiator_iqns',
default='',
- help=('Comma-separated list of initiator IQNs '
- 'allowed to connect to the '
- 'iSCSI target. (From Nova compute nodes.)')),
+ help='This option is deprecated and unused. '
+ 'It will be removed in the next release.'),
cfg.StrOpt('iscsi_iotype',
default='fileio',
help=('Sets the behavior of the iSCSI target '
elif CONF.iscsi_helper == 'fake':
return iscsi.FakeIscsiHelper()
elif CONF.iscsi_helper == 'lioadm':
- return iscsi.LioAdm(root_helper,
- CONF.lio_initiator_iqns,
- CONF.iscsi_target_prefix, db=db)
+ return iscsi.LioAdm(root_helper, CONF.iscsi_target_prefix, db=db)
else:
return iscsi.IetAdm(root_helper, CONF.iet_conf, CONF.iscsi_iotype,
db=db)
from oslo.concurrency import processutils as putils
from cinder import exception
-from cinder.i18n import _, _LI, _LE
+from cinder.i18n import _, _LE, _LI, _LW
from cinder.openstack.common import log as logging
from cinder.volume.targets.tgt import TgtAdm
self.configuration.safe_get('iscsi_target_prefix')
self.lio_initiator_iqns =\
self.configuration.safe_get('lio_initiator_iqns')
+
+ if self.lio_initiator_iqns is not None:
+ LOG.warning(_LW("The lio_initiator_iqns option has been "
+ "deprecated and no longer has any effect."))
+
self._verify_rtstool()
def remove_export(self, context, volume):
if chap_auth is not None:
(chap_auth_userid, chap_auth_password) = chap_auth.split(' ')[1:]
- extra_args = []
- if self.lio_initiator_iqns:
- extra_args.append(self.lio_initiator_iqns)
-
try:
command_args = ['cinder-rtstool',
'create',
name,
chap_auth_userid,
chap_auth_password]
- if extra_args:
- command_args.extend(extra_args)
self._execute(*command_args, run_as_root=True)
except putils.ProcessExecutionError as e:
LOG.error(_LE("Failed to create iscsi target for volume "
# IET configuration file (string value)
#iet_conf=/etc/iet/ietd.conf
-# Comma-separated list of initiator IQNs allowed to connect to
-# the iSCSI target. (From Nova compute nodes.) (string value)
+# This option is deprecated and unused. It will be removed in
+# the next release. (string value)
#lio_initiator_iqns=
# Sets the behavior of the iSCSI target to either perform