From 62a0b475259e27e7ce82405b0b2ba016ad779a99 Mon Sep 17 00:00:00 2001 From: Luke Browning Date: Wed, 15 Nov 2017 19:22:53 -0600 Subject: [PATCH] Utilize Ubuntu's hardware enablement stack for trovestack This brings in the latest fixes which is often important for nested virtualization. It is required for ppc64el. This stack is installed via a new post-install.d script in the trove integration element ubuntu-xenial-guest. A user that is manually creating datastore images may install this stack by setting the following environment variable prior to running the disk-image-create command. export DIB_USE_HWE_KERNEL=true Change-Id: Iaf01c543ea210bd4725ab909aff6884df451b198 --- .../post-install.d/91-hwe-kernel | 29 +++++++++++++++++++ integration/scripts/functions_qemu | 7 +++++ 2 files changed, 36 insertions(+) create mode 100644 integration/scripts/files/elements/ubuntu-xenial-guest/post-install.d/91-hwe-kernel diff --git a/integration/scripts/files/elements/ubuntu-xenial-guest/post-install.d/91-hwe-kernel b/integration/scripts/files/elements/ubuntu-xenial-guest/post-install.d/91-hwe-kernel new file mode 100644 index 0000000000..b60a0a95e0 --- /dev/null +++ b/integration/scripts/files/elements/ubuntu-xenial-guest/post-install.d/91-hwe-kernel @@ -0,0 +1,29 @@ +#!/bin/bash + +set -e +set -o xtrace + +# The HWE stack must be installed for nested virtualization on ppc64el. This +# environment variable is set automatically by trovestack, but it may also be +# set by the user when manually invoking disk-image-create. + +case "$DIB_USE_HWE_KERNEL" in + true|True|TRUE|yes|Yes|YES) + DIB_USE_HWE_KERNEL=true + ;; + *) + DIB_USE_HWE_KERNEL=false + ;; +esac + +if [ "$DIB_USE_HWE_KERNEL" == "true" ]; then + export DEBIAN_FRONTEND=noninteractive + + PKG_ARCH=$(dpkg --print-architecture) + + case "$PKG_ARCH" in + amd64|arm64|ppc64el|s390x) + apt-get --allow-unauthenticated install -y linux-generic-hwe-16.04 + ;; + esac +fi diff --git a/integration/scripts/functions_qemu b/integration/scripts/functions_qemu index aa608e34f6..f3219592c8 100644 --- a/integration/scripts/functions_qemu +++ b/integration/scripts/functions_qemu @@ -10,6 +10,12 @@ USE_TMPFS=${USE_TMPFS:-true} +# Use the latest distro provided hardware enablement stack which is required +# by some platforms (ppc64el) for nested virtualization. Trovestack runs a +# VM (db guest image) in a VM (OpenStack+Trove) + +DIB_USE_HWE_KERNEL=${DIB_USE_HWE_KERNEL:-true} + function build_vm() { exclaim "Actually building the image, this can take up to 15 minutes" @@ -29,6 +35,7 @@ function build_vm() { if [ $DISTRO == 'ubuntu' ]; then export DIB_RELEASE=$RELEASE export DIB_CLOUD_IMAGES=cloud-images.ubuntu.com + export DIB_USE_HWE_KERNEL ARCH=$(dpkg --print-architecture) elif [ $DISTRO == 'fedora' ]; then EXTRA_ELEMENTS=selinux-permissive