From 7cca66d7a1373f0d7ea632390251cbf496e51a3f Mon Sep 17 00:00:00 2001 From: Carlos Goncalves Date: Thu, 16 Jan 2020 17:50:44 +0100 Subject: [PATCH] Enable KVM libvirt type on all scenario jobs A subset of nodepool providers have KVM nested virtualization enabled. At present, examples are Vexxhost, OVH, FortNebula and Limestone. We've had a pre-run script for CI to enable KVM when running in one of those providers. This has some drawbacks: 1. With Zuul v3, DEVSTACK_GATE_LIBVIRT_TYPE is obsoleted in favor of LIBVIRT_TYPE in devstack_localrc. 2. The list was outdated (e.g. Vexxhost and FortNebula were not in). 3. Some of the nested virt friendly providers have mixed KVM/TCG servers. 3. Enablement of nested virtualization would require updating of the KVM providers list in our side. When LIBVIR_TYPE=KVM, devstack checks if KVM is really available (via devstack/lib/nova). If it is not, it falls back to qemu (TCG). This check is available since at least Mitaka. Also, some provider nodes expose a generic CPU model. Libvirt matches the named CPU model to the closest from the host. As a result, the matched one may not include the CPUID parameter which seems to be required for nested virtualization. This find-by-match (cpu_mode option in Nova) can be switched "host-passthrough" in which case will cause libvirt to tell KVM to passthrough the host CPU with no modifications. The disadvantage of this mode is guests can only be migrated to an exactly matching host CPU, but we don't need this in CI. Depends-On: https://review.opendev.org/#/c/703324/ Change-Id: I6c4596aa9cc2d7f7703c5acb54fdaed97756788a --- playbooks/Octavia-DSVM/pre.yaml | 12 ------------ zuul.d/jobs.yaml | 19 +++++++++++++++++-- 2 files changed, 17 insertions(+), 14 deletions(-) delete mode 100644 playbooks/Octavia-DSVM/pre.yaml diff --git a/playbooks/Octavia-DSVM/pre.yaml b/playbooks/Octavia-DSVM/pre.yaml deleted file mode 100644 index 9d6beb75..00000000 --- a/playbooks/Octavia-DSVM/pre.yaml +++ /dev/null @@ -1,12 +0,0 @@ -- hosts: all - name: Octavia DSVM jobs pre-run playbook - tasks: - - shell: - executable: /bin/bash - cmd: | - set -e - set -x - if $(egrep --quiet '(vmx|svm)' /proc/cpuinfo) && [[ ( ! $(hostname) =~ "ovh" && ! $(hostname) =~ "limestone" ) ]]; then - export DEVSTACK_GATE_LIBVIRT_TYPE=kvm - fi - diff --git a/zuul.d/jobs.yaml b/zuul.d/jobs.yaml index 84623742..062f90a7 100644 --- a/zuul.d/jobs.yaml +++ b/zuul.d/jobs.yaml @@ -36,11 +36,11 @@ parent: devstack-tempest timeout: 7800 required-projects: + - openstack/devstack - openstack/octavia - openstack/octavia-lib - openstack/octavia-tempest-plugin - openstack/python-octaviaclient - pre-run: playbooks/Octavia-DSVM/pre.yaml irrelevant-files: - ^.*\.rst$ - ^api-ref/.*$ @@ -51,6 +51,8 @@ devstack_localrc: TEMPEST_PLUGINS: /opt/stack/octavia-tempest-plugin USE_PYTHON3: true + LIBVIRT_TYPE: kvm + LIBVIRT_CPU_MODE: host-passthrough devstack_local_conf: post-config: $OCTAVIA_CONF: @@ -88,11 +90,11 @@ parent: devstack-tempest-ipv6 timeout: 7800 required-projects: + - openstack/devstack - openstack/octavia - openstack/octavia-lib - openstack/octavia-tempest-plugin - openstack/python-octaviaclient - pre-run: playbooks/Octavia-DSVM/pre.yaml irrelevant-files: - ^.*\.rst$ - ^api-ref/.*$ @@ -103,6 +105,8 @@ devstack_localrc: TEMPEST_PLUGINS: /opt/stack/octavia-tempest-plugin USE_PYTHON3: true + LIBVIRT_TYPE: kvm + LIBVIRT_CPU_MODE: host-passthrough devstack_local_conf: post-config: $OCTAVIA_CONF: @@ -144,6 +148,8 @@ vars: devstack_localrc: DIB_LOCAL_ELEMENTS: openstack-ci-mirrors + LIBVIRT_TYPE: kvm + LIBVIRT_CPU_MODE: host-passthrough devstack_local_conf: post-config: $OCTAVIA_CONF: @@ -231,6 +237,8 @@ HOST_IP: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}" TEMPEST_PLUGINS: /opt/stack/octavia-tempest-plugin USE_PYTHON3: true + LIBVIRT_TYPE: kvm + LIBVIRT_CPU_MODE: host-passthrough # Octavia specific settings OCTAVIA_CONTROLLER_IP_PORT_LIST: 192.168.0.3:5555,192.168.0.4:5555 OCTAVIA_MGMT_PORT_IP: 192.168.0.3 @@ -271,6 +279,8 @@ RABBIT_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}" GLANCE_HOSTPORT: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}:9292" USE_PYTHON3: true + LIBVIRT_TYPE: kvm + LIBVIRT_CPU_MODE: host-passthrough # Octavia specific settings OCTAVIA_CONTROLLER_IP_PORT_LIST: 192.168.0.3:5555,192.168.0.4:5555 OCTAVIA_NODE: subnode @@ -507,9 +517,13 @@ controller: devstack_localrc: USE_PYTHON3: False + LIBVIRT_TYPE: kvm + LIBVIRT_CPU_MODE: host-passthrough controller2: devstack_localrc: USE_PYTHON3: False + LIBVIRT_TYPE: kvm + LIBVIRT_CPU_MODE: host-passthrough - job: name: octavia-v2-act-stdby-dsvm-scenario-two-node @@ -652,6 +666,7 @@ parent: octavia-v2-dsvm-scenario required-projects: - openstack/cinder + - openstack/devstack - openstack/diskimage-builder - openstack/octavia - openstack/octavia-lib