Merge "conf: Remove deprecated 'remap_vbd_dev' option"

This commit is contained in:
Zuul 2017-12-27 15:14:22 +00:00 committed by Gerrit Code Review
commit 1472dcf880
3 changed files with 11 additions and 53 deletions

View File

@ -374,30 +374,6 @@ The iSCSI Target Port.
This option represents the port of the iSCSI Target. If the
target port is not present in the connection information from the
volume provider then the value from this option is taken.
"""),
# NOTE(sirp): This is a work-around for a bug in Ubuntu Maverick,
# when we pull support for it, we should remove this
cfg.BoolOpt('remap_vbd_dev',
default=False,
deprecated_for_removal=True,
deprecated_since='15.0.0',
deprecated_reason="""
This option provided a workaround for issues in Ubuntu Maverick, which
was released in April 2010 and was dropped from support in April 2012.
There's no reason to continue supporting this option.
""",
help="""
Used to enable the remapping of VBD dev.
(Works around an issue in Ubuntu Maverick)
"""),
cfg.StrOpt('remap_vbd_dev_prefix',
default='sd',
help="""
Specify prefix to remap VBD dev to (ex. /dev/xvdb -> /dev/sdb).
Related options:
* If `remap_vbd_dev` is set to False this option has no impact.
"""),
cfg.BoolOpt('independent_compute',
default=False,

View File

@ -2126,27 +2126,6 @@ def _wait_for_vhd_coalesce(session, instance, sr_ref, vdi_ref,
raise exception.NovaException(msg)
def _remap_vbd_dev(dev):
"""Return the appropriate location for a plugged-in VBD device
Ubuntu Maverick moved xvd? -> sd?. This is considered a bug and will be
fixed in future versions:
https://bugs.launchpad.net/ubuntu/+source/linux/+bug/684875
For now, we work around it by just doing a string replace.
"""
# NOTE(sirp): This hack can go away when we pull support for Maverick
should_remap = CONF.xenserver.remap_vbd_dev
if not should_remap:
return dev
old_prefix = 'xvd'
new_prefix = CONF.xenserver.remap_vbd_dev_prefix
remapped_dev = dev.replace(old_prefix, new_prefix)
return remapped_dev
def _wait_for_device(session, dev, dom0, max_seconds):
"""Wait for device node to appear."""
dev_path = utils.make_dev_path(dev)
@ -2205,14 +2184,9 @@ def vdi_attached(session, vdi_ref, read_only=False, dom0=False):
session.VBD.plug(vbd_ref, this_vm_ref)
try:
LOG.debug('Plugging VBD %s done.', vbd_ref)
orig_dev = session.call_xenapi("VBD.get_device", vbd_ref)
LOG.debug('VBD %(vbd_ref)s plugged as %(orig_dev)s',
{'vbd_ref': vbd_ref, 'orig_dev': orig_dev})
dev = _remap_vbd_dev(orig_dev)
if dev != orig_dev:
LOG.debug('VBD %(vbd_ref)s plugged into wrong dev, '
'remapping to %(dev)s',
{'vbd_ref': vbd_ref, 'dev': dev})
dev = session.call_xenapi("VBD.get_device", vbd_ref)
LOG.debug('VBD %(vbd_ref)s plugged as %(dev)s',
{'vbd_ref': vbd_ref, 'dev': dev})
_wait_for_device(session, dev, dom0,
CONF.xenserver.block_device_creation_timeout)
yield dev

View File

@ -0,0 +1,8 @@
---
upgrade:
- |
The following deprecated configuration options have been removed from the
``xenserver`` section of ``nova.conf``:
- ``remap_vbd_dev``
- ``remap_vbd_dev_prefix``