Browse Source

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
changes/21/702921/13
Carlos Goncalves 1 year ago
parent
commit
7cca66d7a1
2 changed files with 17 additions and 14 deletions
  1. +0
    -12
      playbooks/Octavia-DSVM/pre.yaml
  2. +17
    -2
      zuul.d/jobs.yaml

+ 0
- 12
playbooks/Octavia-DSVM/pre.yaml View File

@ -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

+ 17
- 2
zuul.d/jobs.yaml View File

@ -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


Loading…
Cancel
Save