workarounds: Remove rbd_volume_local_attach

This was previously deprecated for removal during the Wallaby release.

Change-Id: I158324bfdf4238fb55ae92c30d104835fbb73dff
This commit is contained in:
Lee Yarwood 2021-08-23 14:44:11 +01:00
parent 9bd62eae6e
commit 122a32ed82
4 changed files with 9 additions and 113 deletions

View File

@ -270,36 +270,6 @@ Related options:
* ``compute_driver`` (libvirt)
* ``[libvirt]/images_type`` (rbd)
"""),
cfg.BoolOpt(
'rbd_volume_local_attach',
default=False,
deprecated_for_removal=True,
deprecated_since='23.0.0',
deprecated_reason="""
The underlying performance regression within libgcrypt that prompted this
workaround has been resolved as of 1.8.5
""",
help="""
Attach RBD Cinder volumes to the compute as host block devices.
When enabled this option instructs os-brick to connect RBD volumes locally on
the compute host as block devices instead of natively through QEMU.
This workaround does not currently support extending attached volumes.
This can be used with the disable_native_luksv1 workaround configuration
option to avoid the recently discovered performance issues found within the
libgcrypt library.
This workaround is temporary and will be removed during the W release once
all impacted distributions have been able to update their versions of the
libgcrypt library.
Related options:
* ``compute_driver`` (libvirt)
* ``disable_qemu_native_luksv1`` (workarounds)
"""),
cfg.BoolOpt('reserve_disk_resource_for_image_cache',
default=False,

View File

@ -214,49 +214,3 @@ class LibvirtNetVolumeDriverTestCase(
requested_size)
self.assertEqual(requested_size, new_size)
def test_libvirt_rbd_driver_block_connect(self):
self.flags(rbd_volume_local_attach=True, group='workarounds')
connection_info = self.rbd_connection(self.vol)
libvirt_driver = net.LibvirtNetVolumeDriver(self.fake_host)
libvirt_driver.connector.connect_volume = mock.MagicMock(
return_value = {'path': mock.sentinel.rbd_dev})
libvirt_driver.connect_volume(connection_info, mock.sentinel.instance)
# Assert that the connector is called correctly and device_path updated
libvirt_driver.connector.connect_volume.assert_called_once_with(
connection_info['data'])
def test_libvirt_rbd_driver_block_disconnect(self):
self.flags(rbd_volume_local_attach=True, group='workarounds')
connection_info = self.rbd_connection(self.vol)
libvirt_driver = net.LibvirtNetVolumeDriver(self.fake_host)
libvirt_driver.connector.disconnect_volume = mock.MagicMock()
libvirt_driver.disconnect_volume(connection_info,
mock.sentinel.instance)
# Assert that the connector is called correctly
libvirt_driver.connector.disconnect_volume.assert_called_once_with(
connection_info['data'], None)
def test_libvirt_rbd_driver_block_config(self):
self.flags(rbd_volume_local_attach=True, group='workarounds')
connection_info = self.rbd_connection(self.vol)
connection_info['data']['device_path'] = '/dev/rbd0'
libvirt_driver = net.LibvirtNetVolumeDriver(self.fake_host)
conf = libvirt_driver.get_config(connection_info, self.disk_info)
# Assert that the returned config is for a RBD block device
self.assertEqual('block', conf.source_type)
self.assertEqual('/dev/rbd0', conf.source_path)
self.assertEqual('native', conf.driver_io)
def test_libvirt_rbd_driver_block_extend(self):
self.flags(rbd_volume_local_attach=True, group='workarounds')
connection_info = self.rbd_connection(self.vol)
libvirt_driver = net.LibvirtNetVolumeDriver(self.fake_host)
# Assert NotImplementedError is raised for extend_volume
self.assertRaises(NotImplementedError, libvirt_driver.extend_volume,
connection_info, mock.sentinel.instance,
mock.sentinel.requested_size)

View File

@ -10,13 +10,9 @@
# License for the specific language governing permissions and limitations
# under the License.
from os_brick import exception as os_brick_exception
from os_brick import initiator
from os_brick.initiator import connector
from oslo_log import log as logging
import nova.conf
from nova import utils
from nova.virt.libvirt.volume import volume as libvirt_volume
@ -30,9 +26,6 @@ class LibvirtNetVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
super(LibvirtNetVolumeDriver,
self).__init__(host, is_block_dev=False)
self.connector = None
if CONF.workarounds.rbd_volume_local_attach:
self.connector = connector.InitiatorConnector.factory(
initiator.RBD, utils.get_root_helper(), do_local_attach=True)
def _set_auth_config_rbd(self, conf, netdisk_properties):
# The rbd volume driver in cinder sets auth_enabled if the rbd_user is
@ -75,30 +68,6 @@ class LibvirtNetVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
# secret_type is always hard-coded to 'ceph' in cinder
conf.auth_secret_type = netdisk_properties['secret_type']
def _use_rbd_volume_local_attach(self, connection_info):
return (connection_info['driver_volume_type'] == 'rbd' and
CONF.workarounds.rbd_volume_local_attach)
def connect_volume(self, connection_info, instance):
if self._use_rbd_volume_local_attach(connection_info):
LOG.debug("Calling os-brick to attach RBD Volume as block device",
instance=instance)
device_info = self.connector.connect_volume(
connection_info['data'])
LOG.debug("Attached RBD volume %s", device_info, instance=instance)
connection_info['data']['device_path'] = device_info['path']
def disconnect_volume(self, connection_info, instance):
if self._use_rbd_volume_local_attach(connection_info):
LOG.debug("calling os-brick to detach RBD Volume",
instance=instance)
try:
self.connector.disconnect_volume(connection_info['data'], None)
except os_brick_exception.VolumeDeviceNotFound as exc:
LOG.warning('Ignoring VolumeDeviceNotFound: %s', exc)
return
LOG.debug("Disconnected RBD Volume", instance=instance)
def _get_block_config(self, conf, connection_info):
conf.source_type = "block"
conf.source_path = connection_info['data']['device_path']
@ -118,15 +87,12 @@ class LibvirtNetVolumeDriver(libvirt_volume.LibvirtBaseVolumeDriver):
def get_config(self, connection_info, disk_info):
"""Returns xml for libvirt."""
conf = super(LibvirtNetVolumeDriver,
self).get_config(connection_info, disk_info)
if self._use_rbd_volume_local_attach(connection_info):
return self._get_block_config(conf, connection_info)
conf = super(
LibvirtNetVolumeDriver, self).get_config(
connection_info, disk_info)
return self._get_net_config(conf, connection_info)
def extend_volume(self, connection_info, instance, requested_size):
if self._use_rbd_volume_local_attach(connection_info):
raise NotImplementedError
# There is nothing to do for network volumes. Cinder already
# extended the volume and there is no local block device which
# needs to be refreshed.

View File

@ -0,0 +1,6 @@
---
upgrade:
- |
The ``[workarounds]rbd_volume_local_attach`` workaround configurable has
been removed after previously being deprecated in the Wallaby (23.0.0)
release.