summaryrefslogtreecommitdiff
path: root/nova
diff options
context:
space:
mode:
authorLee Yarwood <lyarwood@redhat.com>2021-08-23 14:44:11 +0100
committerLee Yarwood <lyarwood@redhat.com>2021-09-01 12:50:23 +0100
commit122a32ed8295ce1168505ed1b6d0f08422c506c4 (patch)
tree8f71b68445eba7dfec25463862d9c45123d9875e /nova
parent9bd62eae6eb98136be7014eb6ca7e54cb41fc7ca (diff)
downloadnova-122a32ed8295ce1168505ed1b6d0f08422c506c4.tar.gz
workarounds: Remove rbd_volume_local_attach
This was previously deprecated for removal during the Wallaby release. Change-Id: I158324bfdf4238fb55ae92c30d104835fbb73dff
Diffstat (limited to 'nova')
-rw-r--r--nova/conf/workarounds.py30
-rw-r--r--nova/tests/unit/virt/libvirt/volume/test_net.py46
-rw-r--r--nova/virt/libvirt/volume/net.py40
3 files changed, 3 insertions, 113 deletions
diff --git a/nova/conf/workarounds.py b/nova/conf/workarounds.py
index 0ea01be484..af1abc7ce4 100644
--- a/nova/conf/workarounds.py
+++ b/nova/conf/workarounds.py
@@ -271,36 +271,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,
help="""
diff --git a/nova/tests/unit/virt/libvirt/volume/test_net.py b/nova/tests/unit/virt/libvirt/volume/test_net.py
index b92c1f0cb9..a694351629 100644
--- a/nova/tests/unit/virt/libvirt/volume/test_net.py
+++ b/nova/tests/unit/virt/libvirt/volume/test_net.py
@@ -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)
diff --git a/nova/virt/libvirt/volume/net.py b/nova/virt/libvirt/volume/net.py
index ef065c8f5a..b59682eaa9 100644
--- a/nova/virt/libvirt/volume/net.py
+++ b/nova/virt/libvirt/volume/net.py
@@ -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.