Config options: centralize iscsi libvirt options (10)

The config options of the "nova.conf" section "libvirt" got
moved to the new central location "nova/conf/libvirt.py".
Subsequent patches will then move another options in libvirt section.
This is the 10th patch in a long-chain patchs.

Change-Id: Iffd21940c8396460392e96e79d4ba98142fa39cc
Co-Authored-by: Markus Zoeller <mzoeller@de.ibm.com>
Implements: blueprint centralize-config-options-newton
This commit is contained in:
Hieu LE 2016-04-22 17:27:59 +07:00
parent 463f854af1
commit 00eccf56d0
8 changed files with 33 additions and 46 deletions

View File

@ -312,6 +312,28 @@ libvirt_volume_glusterfs_opts = [
'compute node'),
]
libvirt_volume_iscsi_opts = [
cfg.IntOpt('num_iscsi_scan_tries',
default=5,
help='Number of times to rescan iSCSI target to find volume'),
cfg.BoolOpt('iscsi_use_multipath',
default=False,
help='Use multipath connection of the iSCSI or FC volume'),
cfg.StrOpt('iscsi_iface',
deprecated_name='iscsi_transport',
help='The iSCSI transport iface to use to connect to target in '
'case offload support is desired. Default format is of '
'the form <transport_name>.<hwaddress> where '
'<transport_name> is one of (be2iscsi, bnx2i, cxgb3i, '
'cxgb4i, qla4xxx, ocs) and <hwaddress> is the MAC address '
'of the interface and can be generated via the '
'iscsiadm -m iface command. Do not confuse the '
'iscsi_iface parameter to be provided here with the '
'actual transport name.'),
# iser is also supported, but use LibvirtISERVolumeDriver
# instead
]
ALL_OPTS = list(itertools.chain(
libvirt_general_opts,
libvirt_imagebackend_opts,
@ -322,6 +344,7 @@ ALL_OPTS = list(itertools.chain(
libvirt_volume_opts,
libvirt_volume_aoe_opts,
libvirt_volume_glusterfs_opts,
libvirt_volume_iscsi_opts,
))

View File

@ -119,8 +119,6 @@ uefi_logged = False
LOG = logging.getLogger(__name__)
CONF = nova.conf.CONF
CONF.import_opt('iscsi_use_multipath', 'nova.virt.libvirt.volume.iscsi',
group='libvirt')
DEFAULT_FIREWALL_DRIVER = "%s.%s" % (
libvirt_firewall.__name__,

View File

@ -16,18 +16,15 @@
"""Libvirt volume driver for DISCO."""
from os_brick.initiator import connector
from oslo_config import cfg
from oslo_log import log as logging
import nova.conf
from nova import utils
from nova.virt.libvirt.volume import volume as libvirt_volume
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.import_opt('num_iscsi_scan_tries', 'nova.virt.libvirt.volume.iscsi',
group='libvirt')
CONF = nova.conf.CONF
class LibvirtDISCOVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):

View File

@ -11,15 +11,13 @@
# under the License.
from os_brick.initiator import connector
from oslo_config import cfg
from oslo_log import log as logging
import nova.conf
from nova import utils
from nova.virt.libvirt.volume import volume as libvirt_volume
CONF = cfg.CONF
CONF.import_opt('num_iscsi_scan_tries', 'nova.virt.libvirt.volume.iscsi',
group='libvirt')
CONF = nova.conf.CONF
LOG = logging.getLogger(__name__)

View File

@ -14,15 +14,13 @@
# under the License.
from os_brick.initiator import connector
from oslo_config import cfg
import nova.conf
from nova import utils
from nova.virt.libvirt.volume import volume as libvirt_volume
CONF = cfg.CONF
CONF.import_opt('num_iscsi_scan_tries', 'nova.virt.libvirt.volume.iscsi',
group='libvirt')
CONF = nova.conf.CONF
class LibvirtHGSTVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):

View File

@ -13,39 +13,16 @@
from os_brick import exception as os_brick_exception
from os_brick.initiator import connector
from oslo_config import cfg
from oslo_log import log as logging
import nova.conf
from nova.i18n import _LW
from nova import utils
from nova.virt.libvirt.volume import volume as libvirt_volume
LOG = logging.getLogger(__name__)
volume_opts = [
cfg.IntOpt('num_iscsi_scan_tries',
default=5,
help='Number of times to rescan iSCSI target to find volume'),
cfg.BoolOpt('iscsi_use_multipath',
default=False,
help='Use multipath connection of the iSCSI or FC volume'),
cfg.StrOpt('iscsi_iface',
deprecated_name='iscsi_transport',
help='The iSCSI transport iface to use to connect to target in '
'case offload support is desired. Default format is of '
'the form <transport_name>.<hwaddress> where '
'<transport_name> is one of (be2iscsi, bnx2i, cxgb3i, '
'cxgb4i, qla4xxx, ocs) and <hwaddress> is the MAC address '
'of the interface and can be generated via the '
'iscsiadm -m iface command. Do not confuse the '
'iscsi_iface parameter to be provided here with the '
'actual transport name.'),
# iser is also supported, but use LibvirtISERVolumeDriver
# instead
]
CONF = cfg.CONF
CONF.register_opts(volume_opts, 'libvirt')
CONF = nova.conf.CONF
class LibvirtISCSIVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):

View File

@ -16,17 +16,15 @@
"""Libvirt volume driver for ScaleIO."""
from os_brick.initiator import connector
from oslo_config import cfg
from oslo_log import log as logging
import nova.conf
from nova import utils
from nova.virt.libvirt.volume import volume as libvirt_volume
LOG = logging.getLogger(__name__)
CONF = cfg.CONF
CONF.import_opt('num_iscsi_scan_tries', 'nova.virt.libvirt.volume.iscsi',
group='libvirt')
CONF = nova.conf.CONF
class LibvirtScaleIOVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):

View File

@ -12,7 +12,6 @@
import itertools
import nova.virt.libvirt.volume.iscsi
import nova.virt.libvirt.volume.iser
import nova.virt.libvirt.volume.net
import nova.virt.libvirt.volume.nfs
@ -31,7 +30,6 @@ def list_opts():
return [
('libvirt',
itertools.chain(
nova.virt.libvirt.volume.iscsi.volume_opts,
nova.virt.libvirt.volume.iser.volume_opts,
nova.virt.libvirt.volume.net.volume_opts,
nova.virt.libvirt.volume.nfs.volume_opts,