From 56a446d53f3a7596da612eb573e068ff76f15cdc Mon Sep 17 00:00:00 2001 From: Lee Yarwood Date: Mon, 15 Feb 2021 13:34:35 +0000 Subject: [PATCH] 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 --- ...d-compute-feature-ide-bus-b63802502c378083.yaml | 10 ++++++++++ tempest/api/compute/servers/test_server_rescue.py | 14 ++++++++++++-- tempest/config.py | 4 ++++ 3 files changed, 26 insertions(+), 2 deletions(-) create mode 100644 releasenotes/notes/add-compute-feature-ide-bus-b63802502c378083.yaml diff --git a/releasenotes/notes/add-compute-feature-ide-bus-b63802502c378083.yaml b/releasenotes/notes/add-compute-feature-ide-bus-b63802502c378083.yaml new file mode 100644 index 0000000000..43a0e8c53c --- /dev/null +++ b/releasenotes/notes/add-compute-feature-ide-bus-b63802502c378083.yaml @@ -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. diff --git a/tempest/api/compute/servers/test_server_rescue.py b/tempest/api/compute/servers/test_server_rescue.py index c222893341..a9f8c09521 100644 --- a/tempest/api/compute/servers/test_server_rescue.py +++ b/tempest/api/compute/servers/test_server_rescue.py @@ -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""" diff --git a/tempest/config.py b/tempest/config.py index 0df50451cd..c2378d116d 100644 --- a/tempest/config.py +++ b/tempest/config.py @@ -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?'), ]