compute: Add [compute-feature-enabled]ide_bus flag

This change adds a specific flag to allow environments to indicate that
they do not support an IDE bus being used to attach devices to an
instance.

This is required as Nova's libvirt driver is looking to default to the
newer QEMU machine types such as ``q35`` in the future [1]. These newer
machine types have dropped support for the IDE bus in favour of the more
modern SATA, SCSI and VirtIO buses. As such in the longer term it cannot
be assumed that the IDE bus will always be available and in the short
term we need a way to indicate that an environment doesn't support IDE
when it's using the ``q35`` machine type.

For now the flag defaults to True but will need to move to False if Nova
ever defaults to the ``q35`` machine type.

[1] https://specs.openstack.org/openstack/nova-specs/specs/wallaby/approved/libvirt-stash-instance-machine-type.html

Change-Id: I40824fc3c88f16050407e52a790dd162f1f67e3a
This commit is contained in:
Lee Yarwood 2021-02-15 13:34:35 +00:00
parent 218c2f258f
commit 56a446d53f
3 changed files with 26 additions and 2 deletions

View File

@ -0,0 +1,10 @@
---
other:
- |
A new ``[compute-feature-enabled]ide_bus`` config option has been
introduced to indicate if the environment supports attaching disks to an
instance using an ``IDE`` bus.
This currently defaults to ``True`` but should be set to ``False`` when
using the libvirt OpenStack Nova virt driver *and* the ``q35`` machine type
as support for this bus is no longer provided.

View File

@ -158,8 +158,14 @@ class BaseServerStableDeviceRescueTest(base.BaseV2ComputeTest):
self.servers_client, server_id, 'ACTIVE')
class ServerStableDeviceRescueTest(BaseServerStableDeviceRescueTest):
"""Test rescuing server specifying type of device for the rescue disk"""
class ServerStableDeviceRescueTestIDE(BaseServerStableDeviceRescueTest):
"""Test rescuing server using an IDE device for the rescue disk"""
@classmethod
def skip_checks(cls):
super().skip_checks()
if not CONF.compute_feature_enabled.ide_bus:
raise cls.skipException("IDE bus not available.")
@decorators.idempotent_id('947004c3-e8ef-47d9-9f00-97b74f9eaf96')
def test_stable_device_rescue_cdrom_ide(self):
@ -168,6 +174,10 @@ class ServerStableDeviceRescueTest(BaseServerStableDeviceRescueTest):
hw_rescue_device='cdrom', hw_rescue_bus='ide')
self._test_stable_device_rescue(server_id, rescue_image_id)
class ServerStableDeviceRescueTest(BaseServerStableDeviceRescueTest):
"""Test rescuing server specifying type of device for the rescue disk"""
@decorators.idempotent_id('16865750-1417-4854-bcf7-496e6753c01e')
def test_stable_device_rescue_disk_virtio(self):
"""Test rescuing server with disk and virtio as the rescue disk"""

View File

@ -636,6 +636,10 @@ ComputeFeaturesGroup = [
"APIs that only worked with that driver "
"have been removed and there's nothing to "
"test after Ussuri."),
cfg.BoolOpt('ide_bus',
default=True,
help='Does the test environment support attaching devices '
'using an IDE bus to the instance?'),
]