From 9cad92d41cafc1eb4cb333fa966fb0de056ee2bd Mon Sep 17 00:00:00 2001 From: Jonathan Rosser Date: Mon, 12 Feb 2024 13:26:45 +0000 Subject: [PATCH] Allow virtualisation type to be defined in a test scenario Change-Id: I6d3055139bc6482c6d7fe28dea9b5b5ead500a5c --- .../templates/user_variables.aio.yml.j2 | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 index da76d8c368..8686814176 100644 --- a/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 +++ b/tests/roles/bootstrap-host/templates/user_variables.aio.yml.j2 @@ -347,3 +347,14 @@ tempest_test_includelist_cinder: {% if 'quorum' in bootstrap_host_scenarios_expanded %} oslomsg_rabbit_quorum_queues: True {% endif %} + +# NOTE(jrosser) nested virt is not usable in general in opendev.org CI jobs, +# but if the keyword 'kvm' or 'qemu' is present in the expanded scenario then +# force the use of that virtualisation type. If neither is specified, +# default to qemu in zuul jobs, but allow the os_nova role to autodetect the +# virtualisation type local testing by leaving nova_virt_type undefined. +{% if 'kvm' in bootstrap_host_scenarios_expanded %} +nova_virt_type: kvm +{% elif (('qemu' in bootstrap_host_scenarios_expanded) or nodepool_dir.stat.exists) %} +nova_virt_type: qemu +{% endif %}