61 Commits

Author SHA1 Message Date
Kevin Zhao
551848dd69 Fix devstack default settings in aarch64
1. Lack qemu-efi in ubuntu
2. Lack edk2.git-aarch64 in Fedora/Centos
3. Remove NOVNC disable.

Change-Id: Ifbd0c386df6b28bc64cef20cab8e08f99a85c782
Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
2020-05-11 08:24:54 +00:00
Lee Yarwood
169f5dee47 libvirt: Support the use of the virt-preview repo when using Fedora
The virt-preview repo provides the latest rawhide versions of QEMU,
Libvirt and other virt tools for older releases of Fedora. This repo is
extremely useful when testing features in OpenStack that rely on these
latest builds well in advance of them landing in full Fedora, CentOS or
RHEL releases.

This change adds a ``ENABLE_FEDORA_VIRT_PREVIEW_REPO`` configurable
to control when this repo is enabled and used when deploying on Fedora.

Change-Id: I5c3e1b7b632fd73310c462530990cdb0e0c0ceea
2020-01-27 18:02:30 +00:00
Ian Wienand
2e66778699 Drop Xenial support
With the goals of Ussuri being Python 3.6 [1], the python 3.5
environment on Xenial is too old.  Remove testing and the most obvious
bits of support from devstack.

Also drop claimed support for artful, which is long EOL.

[1] https://governance.openstack.org/tc/reference/runtimes/ussuri.html

Change-Id: Iefcca99904dde76b34efbbfc0e04515dfa5a09e5
2019-11-21 18:38:32 +00:00
melanie witt
1d378dcf6d Remove n-novnc service requirement for TLS configuration
When configuring TLS between the console proxy (where the n-novnc
service runs) and the compute host, some configuration for QEMU needs
to be done on the compute host. The existing code for this requires the
n-novnc service to be running, which it is in a single node all-in-one
deployment. However, when running in a multinode deployment, the
n-novnc service runs only on the controller and not on the subnode.
Yet, we need to configure QEMU on the subnode compute host as well.

This removes the n-novnc service requirement to enable TLS QEMU
configuration to occur on a compute subnode in a multinode deployment.

Closes-Bug: #1849418

Change-Id: I8b6970e91ad7f52ff489cb9f776ca216d8f86aa4
2019-10-23 04:53:42 +00:00
melanie witt
e2853bf2d0 Set ownership of /etc/pki/<console> files for TLS
OpenSSL 1.0.2 generates key files with default permissions: 644 and the
files are copied to the /etc/pki/* directories with sudo.

When the default CI node Ubuntu version was changed from Xenial =>
Bionic we changed from OpenSSL 1.0.2 => 1.1.0. And OpenSSL 1.1.0
generates key files with default permissions: 600. When we copy the key
file to /etc/pki/* using sudo, it becomes owned by root and then the
console-related users are unable to read it.

This sets the ownership of the /etc/pki/<console> files to the
user:group intended to read them.

Closes-Bug: #1819794

Change-Id: I437a46c875cf633272e8cad0811e5557f2ac3641
2019-03-25 03:42:18 +00:00
Zuul
9f71c4ad4e Merge "nova: add support for TLS between novnc proxy & compute nodes" 2018-02-20 09:39:19 +00:00
Zuul
c19d0cbb27 Merge "Fix libvirt daemon name condition" 2017-11-21 20:04:34 +00:00
Ian Wienand
0d0b69027b Restore qemu-kvm install for CentOS
The kvmibm removal I009ae4779588615633bff81d0c47a1b879ec9279
incorrectly removed this (the check was install if *not* kvmibm).
Since we don't support kvmibm any more, it should be safe to install
everywhere as done here.

For the full history, it started with us installing qemu-kvm-ev with
Ide91b261f35fb19d8bd7155ca016fa3b76a45ea1, then we fixed it to be more
generic and just install qemu-kvm with
I46da627c0da8925064862fdc283db81591979285, then Fedora 26 support in
I5c79ad1ef0b11dba30c931a59786f9eb7e7f8587 made this install everywhere
*but* kvmibm.

Change-Id: If3e9661451ad1055e7c8d670605a53095f0aeda4
2017-11-17 10:41:55 +11:00
Daniel P. Berrange
e9870eb18d nova: add support for TLS between novnc proxy & compute nodes
Nova is gaining the ability to run TLS over the connection between the
novnc proxy service and the QEMU/KVM compute node VNC server.

This adds a new config param - 'NOVA_CONSOLE_PROXY_COMPUTE_TLS=True' -
which instructs devstack to configure libvirt/QEMU to enable TLS for the
VNC server, and to configure the novncproxy to use TLS when connecting.
NB this use of TLS is distinct from use of TLS for the public facing API
controlled by USE_SSL, they can be enabled independently.

This is done in a generic manner so that it is easy to extend to cover
use of TLS with the SPICE and serial console proxy services too.

Change-Id: Ib29d3f5f18533115b9c51e27b373e92fc0a28d1a
Depends-on: I9cc9a380500715e60bd05aa5c29ee46bc6f8d6c2
Implements bp: websocket-proxy-to-host-security
2017-10-19 18:32:51 +00:00
Jan Zerebecki
2c2ca80ce0 Fix libvirt daemon name condition
This makes the condition that chooses which daemon name libvirt to call
the same as for choosing the livirt package names.

Without this fix the condition checking for a directory is incorrect
when livirt is not yet installed, but is used before installing the
packages.

Change-Id: Ib5eb12769128527a6f4b3b5f7674bd2dad0ed160
2017-10-17 18:34:30 +02:00
Markus Zoeller
b8335eebe8 Drop support for "kvmibm" distro
The IBM hypervisor distro "KVM for IBM z Systems" gets discontiued,
like announced in March 2017 [1]. The key dates are:

* 03/2017: announcement
* 08/2017: the last day to order (EOM)
* 03/2018: the End of Service (EOL)

As the CI which tests OpenStack with KVM on IBM Z doesn't rely on this
distro anymore and EOM has reached, we remove the Devstack support for
this distro.

This basically reverts commit a5ea08b of Dec 2015.

NOTE: This doesn't affect other distros which have KVM on Z support.

References:
[1] FAQ for KVM for IBM z Systems Delivery Strategy Change
    https://www-01.ibm.com/common/ssi/cgi-bin/ssialias?htmlfid=ZSQ03110USEN&

Change-Id: I009ae4779588615633bff81d0c47a1b879ec9279
2017-10-10 11:08:09 +02:00
Attila Fazekas
7bbd4e95d0 Add f26 to the supported distros
The only mentionable diff is the kvm alias
does not exists so we will install
qemu-kvm as with rhel7 which also exists
in the older supported fedoras.

kvm also just an alias in suse so
switching to qemu-kvm  in suse as well.

Change-Id: I5c79ad1ef0b11dba30c931a59786f9eb7e7f8587
2017-07-24 07:32:15 +02:00
Kevin Benton
d1fe0e62e7 Always setup libvirt for tap devices when using Neutron
This logic has been tied to OVS since it was introduced in [1] and
revised in [2]. However, many other backends may use tap devices that
aren't related to OVS, such as Calico[3] and Linux Bridge after [4]
merges.

This patch just removes the dependency on OVS specifically so
/dev/net/tun is added to cgroups whenever any Neutron backend is used.
This is done in other deployment tools like Juju[5] so it's not
unprecedented.

1. Ifab268f739b004db13024633e8abeb17691b9e46
2. Ic1da132fa421f1c70c10a319ee3239831b0f956f
3.
http://docs.projectcalico.org/master/getting-started/openstack/installation/ubuntu#compute-node-install
4. I23c5faaeab69aede1fd038a36f4a0b8f928498ce
5.
2790f81ecd/templates/qemu.conf

Change-Id: I075595158d8f3b5a6811c4794aa7b91912940db5
Partial-Bug: #1675343
2017-05-17 06:07:35 +00:00
Sean Dague
f28e7ef6ba uninstall libvirt-python and reinstall
libvirt-python compiles against the currently installed libvirt. If
you upgrade that, it needs to rebuild, however it won't change
versions, so pip install just noops. Force an uninstall / reinstall of
it every time to handle potential upgrades of libvirt.

Change-Id: If34541b34aa6d55eedaf6c603fd1fe92eb887308
2017-05-08 07:30:20 -04:00
Jenkins
03fbc0d71b Merge "Do not use libvirt-bin package anymore" 2017-04-07 00:37:36 +00:00
Jenkins
ec60d050f5 Merge "Remove the EBTABLES_RACE_FIX added for Trusty" 2017-04-07 00:33:30 +00:00
Ian Wienand
bfcc760b96 Enable libvirt coredumps
This adds a flag and basic config for enabling coredumps for libvirt.

Partial-Bug: 1643911
Co-Authored-By: Matthew Booth <mbooth@redhat.com>

Change-Id: If7cd54e804a5a389a0d82a325b58f5b41b8ef0db
2017-03-30 17:29:29 +11:00
Jordan Pittier
1298f1bacd Remove the EBTABLES_RACE_FIX added for Trusty
Now that we don't support Ubuntu Trusty anymore, we can remove
the ebtables race workaround.

Closes-Bug: #1675714
Change-Id: I70483f871e35fcaa933d1b7bac7dbb396aa22cef
2017-03-28 08:16:07 +11:00
David Rabel
682e0abe1a Do not use libvirt-bin package anymore
The package libvirt-bin is a transitional package in Debian and should
not be used anymore.

Ubuntu Xenial is an exception here.

Because of that this change also adds the possibility to use "not:" to
exclude distros in files/debs/* just as "dist:" limits distros.

Depends-On: Icc59ea79f54d4ff8751f2e353ee3530fff3d961e
Closes-Bug: #1673840
Change-Id: I3998a7178d14ec40eae5cb199d66da9546cd6ccf
2017-03-24 10:44:10 +01:00
Evgeny Antyshev
008aa3e095 Fix install_libvirt for other RHEL-based distros
Since https://review.openstack.org/#/c/438325 landed
it only works for Centos 7, but not for other
RHEL-based distributions: Virtuozzo and, probably, RHEV.

Both of above have own version for qemu-kvm package: qemu-kvm-vz and qemu-kvm-rhev,
accordingly. These packages provide "qemu-kvm", like qemu-kvm-ev,
and, when you call "yum install qemu-kvm", they replace the default OS package.

Change-Id: I46da627c0da8925064862fdc283db81591979285
2017-03-02 11:14:25 +00:00
Ian Wienand
52bb64105f Use qemu-kvm-ev package on centos
For the latest qemu-kvm, you have to use the qemu-kvm-ev package,
which is based off the qemu-kvm-rhev package, which is explained in
[1] but you probably can't read it.  The gist is, that qemu-kvm-rhev
is a later build of kvm that is incompatible with the base version
provided.  qemu-kvm-rhev is only provided with the RHV (ovirt) and
RHOS (openstack) products.  CentOS rebuilds this package as
qemu-kvm-ev as part of it's virtualisation SIG.

I9a972e3fde2e4e552f6fc98350820c07873c3de3 has bumped up the minimum
qemu version to 2.1.0.  It seems there is a an issue (bug #1668164)
where having the qemu-system package installed gets picked up if
installed, and reports the incorrect version to nova, causing failure.

This removes the installs from files/rpms/nova as it is all being done
in function-libvirt.  We only install the qemu-kvm-ev package on
centos and remove the old work-around.

[1] https://access.redhat.com/solutions/629513
[2] https://wiki.centos.org/SpecialInterestGroup/Virtualization

Change-Id: Ide91b261f35fb19d8bd7155ca016fa3b76a45ea1
2017-02-27 18:59:49 +11:00
Sean Dague
999dd7e989 only apply ebtables race fix on trusty
Change-Id: Ifc83e7301d9d921ce9ceed349f116584ce03842b
2017-02-09 17:56:40 -05:00
Jenkins
1c13be860b Merge "Modify the default Qemu packages name for AArch64." 2016-10-10 13:58:17 +00:00
Kevin Zhao
a80d4097a9 Modify the default Qemu packages name for AArch64.
In Debian jessie and later release,there is no packages
called "qemu-kvm" for AArch64. Also modify the libguestfs0
packages for AArch64

Closes-bug: #1612182

Change-Id: I5eb6bd137896eb9abfc4f8dbb41b41105e4820cd
Signed-off-by: Kevin Zhao <kevin.zhao@linaro.org>
2016-09-22 07:44:43 +00:00
Lenny Verkhovsky
0a40710b9f Adding vfio to cgroup_device_acl during libvirt configuration
vfio should be added to cgroups on some of the Distributions like
Ubuntu 16-04

Change-Id: I7239858b6307e37bf1237b92d69a0520ab5ad304
2016-09-04 12:52:01 +00:00
Janki Chhatbar
8f586fbefe Start virtlogd service
Ensure the virtlogd service is started, to work-around various
platform issues where it isn't started correctly.

Closes-Bug: #1603009
Change-Id: I548b377df6b2f0c287429e4387ee33184a82a64d
2016-08-30 10:37:21 +10:00
Jenkins
0a73b22b6c Merge "functions-libvirt: Add log filter to capture CPU driver errors" 2016-06-09 14:22:11 +00:00
Sean Dague
214459cdf7 remove addition of gate64 cpu
Nova has been fixed to not need this work around. We shouldn't keep it
in devstack.

Change-Id: Ie2b1c6b8ddce4a2fd94af06745d59455208f0633
2016-06-03 15:03:37 +10:00
Kashyap Chamarthy
07dc2bf776 functions-libvirt: Add log filter to capture CPU driver errors
Two things:

  (a) Add the log filter to capture libvirt CPU manipulation driver
      related error messages when things fallout (e.g. CPU model
      comparision failures during live migration).

  (b) While we're at it, remove the "1:qemu_monitor" log filter, because
      the existing filter "1:qemu" should take care of logging the
      interactions with QEMU monitor console.  This is the case since
      the introduction of VIR_LOG_INIT() macro in upstream libvirt,
      which performs a substring match on a given file name.  (Available
      from libvirt version v1.2.10 onwards).

Change-Id: I75befd52d9f892eb5a6236eee9a397fab7602ecc
2016-06-02 15:28:56 +02:00
Jenkins
8ca268b7c3 Merge "libvirt: don't repeatedly configure libvirtd logging" 2016-01-20 01:06:16 +00:00
Alexander Schmidt
a5ea08b752 Add distro support for KVM for IBM z Systems
Add "KVM for IBM z Systems" to the list of Fedora-like distros.

As the distribution does not have a dedicated kvm package,
prevent the installation of the kvm package during the libvirt
setup.

Change-Id: Ibb5c60797d6867264f9dea7fea85cdf1d7c72ded
2016-01-07 10:14:39 +01:00
Mark McLoughlin
76cbbe37aa libvirt: don't repeatedly configure libvirtd logging
/etc/libvirt is not world-readable (at least on Fedora and RHEL) so
use sudo with the grep that checks whether we have already configured
libvirtd logging. Also, change the regex so we don't count commented
out logging config.

Change-Id: I67484b28aafd0fa828385321fa96d9141cb4cb59
Signed-off-by: Mark McLoughlin <markmc@redhat.com>
2015-12-14 11:36:42 +00:00
Ian Wienand
523f488036 Namespace XTRACE commands
I noticed this when debugging some grenade issues failures.

An include of grenade/functions stores the current value of XTRACE
(on) and disables xtrace for the rest of the import.

We then include devstack's "functions" library, which now overwrites
the stored value of XTRACE the current state; i.e. disabled.

When it finishes it restores the prior state (disabled), and then
grenade restores the same value of XTRACE (disabled).

The result is that xtrace is incorrectly disabled until the next time
it just happens to be turned on.

The solution is to name-space the store of the current-value of xtrace
so when we finish sourcing a file, we always restore the tracing value
to what it was when we entered.

Some files had already discovered this.  In general there is
inconsistency around the setting of the variable, and a lot of obvious
copy-paste.  This brings consistency across all files by using
_XTRACE_* prefixes for the sotre/restore of tracing values.

Change-Id: Iba7739eada5711d9c269cb4127fa712e9f961695
2015-11-27 15:36:04 +11:00
Sean Dague
7860f2ba31 install ebtables locking workaround
ebtables is racing with itself when nova and libvirt attempt to create
rules at the same time in the nat table. ebtables now has an explicit
--concurrent flag, that all tools must opt into to prevent ebtables
from inherently being unsafe to run.

libvirt gained this support in 1.2.11, which is too new for our ubuntu
primary testing environment. Nova still hasn't added this support,
though even if it did, we'd run into the issue with libvirt.

We can do the most ghetto thing possible and create a wrapper for
ebtables that does explicit locking on it's own. It's pretty terrible,
but it should work. And it is the kind of work around that people
unable to upgrade libvirt will probably need to do.

This is an opt in value which we should set in the gate to True.

Related-Bug: #1501558

Change-Id: Ic6fa847eba34c21593b9df86a1c2c179534d0ba5
2015-11-18 10:59:50 -05:00
Hirofumi Ichihara
508931ff36 Remove Ubuntu 14.10 as supported distribution
Ubuntu 14.10(utopic) reached end of life[1].

[1]: https://lists.ubuntu.com/archives/ubuntu-announce/2015-July/000197.html

Change-Id: Iab13ca797bda56462d9d117aa500d3ba0d9bebcb
2015-11-02 17:50:31 +09:00
Aaron Rosen
bd5e6b1659 Remove unnecessary execute permissions
These files have acquired execute permissions that
are not strictly necessary because they are being 
sourced, and not intended to be run separately.

Restore to 644

Change-Id: I0b8654123416a07521502b61610ca45c94494a07
2015-10-01 21:01:35 +00:00
Ian Wienand
614ca26b47 Install qemu-kvm package on centos/fedora
Change I79a8d8ac7ad2fbd7d2fce696821d130218e43e03 removed the install
of python-libguestfs, which was actually hiding a dependency issue on
Centos.  The "kvm" package is ultimately missing some bios files from
"seabios-bin" -- however with python-libguestfs installed this was
coming in via a dependency chain that pulled in qemu-kvm, which has
the dependency.

qemu-kvm is not strictly required as all the functionality is within
qemu-system-x86.  But while we get [1] sorted out this restores the
job functionality.

[1] https://bugzilla.redhat.com/show_bug.cgi?id=1235890

Change-Id: I3379bc497978befac48c5af0f1035b96d030b7eb
2015-06-26 14:45:04 +10:00
Dirk Mueller
0ae942b41c Only install python-libguestfs bindings when needed
Currently those bindings are missing from SLES12, and since
they're not actually used unless file injection is enabled
(which is not by default), only conditionally depend on it.

Change-Id: I79a8d8ac7ad2fbd7d2fce696821d130218e43e03
2015-06-23 12:22:21 +02:00
Ian Wienand
3380a16974 Disable firewalld always
We've bike-sheded over this before
(I5252a12223a35f7fb7a4ac3c58aa4a3cd1bc4799) but I have just traced
down further issues to firewalld with neutron+ipv6 (see the bug).

In fact, as mentioned in the comments, RDO disables firewalld and the
neutron guide says to disable it [1].  The force flag is left if
anyone really wants this; but nobody is testing (or, as far as I can
tell, working on) this so bring devstack back into line and disable it
always.  Note we do not remove the package; as has been found in the
puppet scripts this can lead to dependency issues.

[1] http://docs.openstack.org/developer/devstack/guides/neutron.html

Change-Id: Ief7cb33d926a9538f4eb39c74d906ee0c879de35
Partial-Bug: 1455303
2015-05-15 19:14:19 +10:00
Sean Dague
60996b1b60 introduce pip_install_gr
This creates a new pip_install_gr that installs from global
requirements allowed versions. Now that stable branches are getting
capped all of devstack needs to be fixed to do things like this.

Change-Id: I8fd0ef2bfc544ca2576fab09d3018f760b8848fe
2015-04-08 10:28:17 -04:00
Andrew McDermott
bcef63ed43 Update qemu package name for Ubuntu aarch64
The qemu-system package, and not qemu-kvm, should be installed on either
trusty- or utopic-based ARMv8 (aarch64) Ubuntu releases. Additionally,
libguestfs is not available so that is not installed.

No changes are required for vivid.

Change-Id: Id9dc1fc465bd7acab17c991c292fb531016758ad
Signed-off-by: Andrew McDermott <andrew.mcdermott@linaro.org>
2015-04-05 17:10:32 +00:00
Jenkins
0f173a4821 Merge "Update libvirt cpu map before starting nova" 2015-04-03 20:21:21 +00:00
Kashyap Chamarthy
d3cfb82c65 functions-libvirt: Enable DEBUG_LIBVIRT config attribute by default
Enabling it by default because:

  - This allows you to get the relevant logs right away when something
    in the libvirt code path fails, without having to submit another
    change and keep doing a 'recheck' to re-run the CI check/gate jobs
    until you hit the bug.

  - The libvirt log filters specified in the function
    'configure_libvirt' are much more _selective_ and not a catch-all
    debug option where you end up with the unhelpful situation of having
    to find a "specific piece of hay in a haystack"[1].

FWIW, I always have it enabled in local test environments, and I don't
see the resulting libvirtd.log growing beyond a couple of MB for
three-four days of usage.

[1] http://lists.openstack.org/pipermail/openstack-dev/2014-January/024414.html

Change-Id: I5e0b35446075b419fe473e1db8d0bfedd7009741
2015-04-01 12:05:07 +02:00
Clark Boylan
edd6048168 Update libvirt cpu map before starting nova
We are trying to get a working 64bit qemu cpu model in the gate for nova
live migration testing. It appears that we need to make this change
prior to nova starting.

Make the change in configure_libvirt() to handle this along with the
other libvirt config updates. This allows us to restart the libvirt
service once. This function calls a python tool which parses and updates
the XML if necessary.

Change-Id: I00667713bfba67ab8cedbcb1660ff94d4f4bcc07
2015-03-31 15:06:30 -07:00
Kashyap Chamarthy
ae7b4f9b9e functions-libvirt: Enable 'qemu_monitor' logging filter for libvirt
A lot of libvirt interactions with QEMU are via the QEMU monitor
console, which allows you to either query or modify the state of a
virtual machine. Spefici examples include: querying the status of live
block operations, live snapshot operations, live migration, etc.

Enabling the 'qemu_monitor' log filter allows us to capture precisely
what commands libvirt is sending to QEMU.

Note that the log level was intentionally set to '1' (i.e. debug) for
this specific filter, because (a) it's not extremely verbose, (b) when
something breaks, it's helpful to have the exact sequence of
interactions between libvirt and QEMU.

Change-Id: Iba95b6bd7c9f197c8d48c7d978f538e50d4e31fa
2015-03-31 21:35:05 +02:00
Sean Dague
206c596d69 add back python-guestfs
This is needed otherwise we fall back to the nbd code path which is
super hacky. This shouldn't have been deleted for the venv path.

Change-Id: If5cb6cb4944bd0ed3548d53c98443b76725d1c0c
2015-03-30 13:56:11 -04:00
Dean Troyer
4533eeec1f Install Nova into its own venv
Install a couple of optional feature prereqs in hypervisor plugins.

rootwrap is horribly called indirectly via PATH.  The choice, other than fixing
such nonsense, is to force the path in sudo.

TODO:
* python guestfs isn't in pypi, need to specifically install it to not
  use the distro package

Change-Id: Iad9a66d8a937fd0b0d1874005588c702e3d75e04
2015-03-26 14:54:00 -05:00
Attila Fazekas
1f316beb20 Remove rhel6 and py26 support
el6 is shipped with Python 2.6.x which is not expected
to be supported with the openstack kilo release.

For el6 support we need to do lot of thing differently,
which makes the code more complicated.

This change removes el6 and py26 support from devstack.

This change also removed a discontinued (1 year ago)
openSUSE 12.2 code path, which used a similar codepath as el6.

Several comment related to el6 also removed or modified.

Change-Id: Iea0b0c98a5e11fd85bb5e93c099f740fe05d2f3a
2015-01-27 09:22:52 +01:00
Sean Dague
537532931d Make changes such that -o nounset runs
This makes a bunch of variable cleanups that will let -o nounset
function, for the time being we hide nounset behind another setting
variable so that it's not on by default.

Because this is bash, and things are only executed on demand, this
probably only works in the config it was run in. Expect cleaning up
all the paths to be something that takes quite a while.

This also includes a new set of unit tests around the trueorfalse
function, because my change in how it worked, didn't. Tests are good
m'kay.

Change-Id: I71a896623ea9e1f042a73dc0678ce85acf0dc87d
2015-01-15 13:06:14 -05:00
Sean Dague
e263c82e48 add shebang lines to all lib files
With gerrit 2.8, and the new change screen, this will trigger syntax
highlighting in gerrit. Thus making reviewing code a lot nicer.

Change-Id: Id238748417ffab53e02d59413dba66f61e724383
2014-12-10 11:28:05 -05:00