Compare commits
131 Commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 1183167f19 | |||
| 2bb18a4caa | |||
| 461089b238 | |||
| 722465ec97 | |||
| e62f4f25f3 | |||
| b31d70a576 | |||
| 94b49698a8 | |||
| 4181791e06 | |||
| b12cc4181c | |||
| 977b591ee1 | |||
| 30a7d790b6 | |||
| 74dbd6ee8d | |||
| 44c3ea4f1b | |||
| 211cc4c036 | |||
| e6bb5c9959 | |||
| 49c1a34e7a | |||
| aeae198c17 | |||
| 88b9edf921 | |||
| 12752ea219 | |||
| 100946429a | |||
| 0e95a7221a | |||
| ce2962ab48 | |||
| 0b0e6a6474 | |||
| b5c2e7b3fa | |||
| 3de92db663 | |||
| b9b6d6b862 | |||
| 995c906950 | |||
| 8fa03a37ad | |||
| c61380a136 | |||
| 3154eab0d7 | |||
| e7d2623dca | |||
| ccd116d364 | |||
| ca5f919561 | |||
| fdfc14451a | |||
| 90e5479f38 | |||
| 28ee346393 | |||
| ea82effa19 | |||
| d266c87b1d | |||
| 51a3f2ef1e | |||
| d9e2d10d28 | |||
| 79bef068b6 | |||
| 8506b5bd7c | |||
| 0af962d60a | |||
| b70d98fe75 | |||
| facf15626e | |||
| 1a21ccbdf8 | |||
| cf0bf746e9 | |||
| 85340e77f3 | |||
| bd6e5205b1 | |||
| 02f8c16c9b | |||
| 8d347090d3 | |||
| e1fb94f82a | |||
| ce1ae9ddef | |||
| 9ddae9b388 | |||
| fe7cfa6b8c | |||
| 8a38a73ddf | |||
| eacaa99853 | |||
| 8ff52ea12b | |||
| d5af514ac9 | |||
| 44d07f3001 | |||
| 8eede1fc39 | |||
| 7391297bc3 | |||
| e6e7100e85 | |||
| c869d59857 | |||
| 96dbf55016 | |||
| e661cae7e8 | |||
| 906cf81528 | |||
| f7d87aa433 | |||
| 35fb53423a | |||
| 0ae279b54a | |||
| d0657a02e5 | |||
| 6dd896fefa | |||
| e85c68e60f | |||
| 0e08e9b48c | |||
| 599b241d32 | |||
| c64ea4f213 | |||
| 8e1d5aa22e | |||
| 1cdf413ac6 | |||
| 1d5be95196 | |||
| 50e3c06ec2 | |||
| 34c2842676 | |||
| 560ee16a85 | |||
| 083eeee5af | |||
| 08254ca312 | |||
| 2f889954ce | |||
| 111a38b4d6 | |||
| 9eb64896dd | |||
| 92a34dbe95 | |||
| 47b7b84422 | |||
| 4fd2831753 | |||
| 071374fa05 | |||
| 83a81755ac | |||
| 64d68679d9 | |||
| fe52d7f0a8 | |||
| 5c765cb8a1 | |||
| d450e146cc | |||
| 1baa8905d5 | |||
| 42be2425d8 | |||
| 85c2999e27 | |||
| bfae1bee79 | |||
| 48417ca241 | |||
| 1b601c7b1e | |||
| bab0c92103 | |||
| 6964ba4a98 | |||
| 8615563df4 | |||
| c6dfd169ae | |||
| 3b0c035b90 | |||
| 7191c5e7e7 | |||
| 76c519bde6 | |||
| 45f71b10ef | |||
| af75f689fa | |||
| 4423450eb3 | |||
| c2772c2984 | |||
| d380858b2d | |||
| 4baeb3b51f | |||
| 676dcaf944 | |||
| ce0ff1fd9d | |||
| eca9783a0a | |||
| f4a703661e | |||
| aac6b6c791 | |||
| 729b196445 | |||
| 45b029064f | |||
| 0ed70e3f76 | |||
| 5c51a95d10 | |||
| e79913c65f | |||
| 8dc342d400 | |||
| 189c7ff142 | |||
| 14779fc992 | |||
| cebd00aa04 | |||
| 13e8db5a6f | |||
| 4aa27976eb |
@@ -2,3 +2,4 @@
|
||||
host=review.opendev.org
|
||||
port=29418
|
||||
project=openstack/devstack.git
|
||||
defaultbranch=stable/zed
|
||||
|
||||
+70
-119
@@ -1,11 +1,3 @@
|
||||
- pragma:
|
||||
# NOTE(gtema): this is required for the changes in SDK feature/r1 branch to
|
||||
# be using devstack
|
||||
# TODO(gtema): delete this once r1 branch is merged into master
|
||||
implied-branches:
|
||||
- master
|
||||
- feature/r1
|
||||
|
||||
- nodeset:
|
||||
name: openstack-single-node
|
||||
nodes:
|
||||
@@ -16,6 +8,16 @@
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: openstack-single-node-jammy
|
||||
nodes:
|
||||
- name: controller
|
||||
label: ubuntu-jammy
|
||||
groups:
|
||||
- name: tempest
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: openstack-single-node-focal
|
||||
nodes:
|
||||
@@ -46,26 +48,6 @@
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: devstack-single-node-centos-7
|
||||
nodes:
|
||||
- name: controller
|
||||
label: centos-7
|
||||
groups:
|
||||
- name: tempest
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: devstack-single-node-centos-8-stream
|
||||
nodes:
|
||||
- name: controller
|
||||
label: centos-8-stream
|
||||
groups:
|
||||
- name: tempest
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: devstack-single-node-centos-9-stream
|
||||
nodes:
|
||||
@@ -86,16 +68,6 @@
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: devstack-single-node-fedora-latest
|
||||
nodes:
|
||||
- name: controller
|
||||
label: fedora-35
|
||||
groups:
|
||||
- name: tempest
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: devstack-single-node-debian-bullseye
|
||||
nodes:
|
||||
@@ -106,16 +78,6 @@
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: devstack-single-node-openeuler-20.03-sp2
|
||||
nodes:
|
||||
- name: controller
|
||||
label: openEuler-20-03-LTS-SP2
|
||||
groups:
|
||||
- name: tempest
|
||||
nodes:
|
||||
- controller
|
||||
|
||||
- nodeset:
|
||||
name: openstack-two-node
|
||||
nodes:
|
||||
@@ -147,12 +109,12 @@
|
||||
- compute1
|
||||
|
||||
- nodeset:
|
||||
name: openstack-two-node-centos-8-stream
|
||||
name: openstack-two-node-centos-9-stream
|
||||
nodes:
|
||||
- name: controller
|
||||
label: centos-8-stream
|
||||
label: centos-9-stream
|
||||
- name: compute1
|
||||
label: centos-8-stream
|
||||
label: centos-9-stream
|
||||
groups:
|
||||
# Node where tests are executed and test results collected
|
||||
- name: tempest
|
||||
@@ -387,8 +349,10 @@
|
||||
'{{ devstack_log_dir }}/devstacklog.txt.summary': logs
|
||||
'{{ devstack_log_dir }}/tcpdump.pcap': logs
|
||||
'{{ devstack_log_dir }}/worlddump-latest.txt': logs
|
||||
'{{ devstack_log_dir }}/qemu.coredump': logs
|
||||
'{{ devstack_full_log}}': logs
|
||||
'{{ stage_dir }}/verify_tempest_conf.log': logs
|
||||
'{{ stage_dir }}/performance.json': logs
|
||||
'{{ stage_dir }}/apache': logs
|
||||
'{{ stage_dir }}/apache_config': logs
|
||||
'{{ stage_dir }}/etc': logs
|
||||
@@ -407,6 +371,7 @@
|
||||
'{{ stage_dir }}/rpm-qa.txt': logs
|
||||
'{{ stage_dir }}/core': logs
|
||||
'{{ stage_dir }}/listen53.txt': logs
|
||||
'{{ stage_dir }}/services.txt': logs
|
||||
'{{ stage_dir }}/deprecations.log': logs
|
||||
'{{ stage_dir }}/audit.log': logs
|
||||
/etc/ceph: logs
|
||||
@@ -633,11 +598,13 @@
|
||||
name: devstack-ipv6
|
||||
parent: devstack
|
||||
description: |
|
||||
Devstack single node job for integration gate with IPv6.
|
||||
Devstack single node job for integration gate with IPv6,
|
||||
all services and tunnels using IPv6 addresses.
|
||||
vars:
|
||||
devstack_localrc:
|
||||
SERVICE_IP_VERSION: 6
|
||||
SERVICE_HOST: ""
|
||||
TUNNEL_IP_VERSION: 6
|
||||
|
||||
- job:
|
||||
name: devstack-enforce-scope
|
||||
@@ -646,10 +613,7 @@
|
||||
This job runs the devstack with scope checks enabled.
|
||||
vars:
|
||||
devstack_localrc:
|
||||
# Keep enabeling the services here to run with system scope
|
||||
CINDER_ENFORCE_SCOPE: true
|
||||
GLANCE_ENFORCE_SCOPE: true
|
||||
NEUTRON_ENFORCE_SCOPE: true
|
||||
ENFORCE_SCOPE: true
|
||||
|
||||
- job:
|
||||
name: devstack-multinode
|
||||
@@ -658,27 +622,23 @@
|
||||
description: |
|
||||
Simple multinode test to verify multinode functionality on devstack side.
|
||||
This is not meant to be used as a parent job.
|
||||
vars:
|
||||
devstack_localrc:
|
||||
MYSQL_REDUCE_MEMORY: true
|
||||
|
||||
# NOTE(ianw) Platform tests have traditionally been non-voting because
|
||||
# we often have to rush things through devstack to stabilise the gate,
|
||||
# and these platforms don't have the round-the-clock support to avoid
|
||||
# becoming blockers in that situation.
|
||||
- job:
|
||||
name: devstack-platform-centos-8-stream
|
||||
parent: tempest-full-py3
|
||||
description: CentOS 8 Stream platform test
|
||||
nodeset: devstack-single-node-centos-8-stream
|
||||
voting: false
|
||||
timeout: 9000
|
||||
vars:
|
||||
configure_swap_size: 4096
|
||||
|
||||
- job:
|
||||
name: devstack-platform-centos-9-stream
|
||||
parent: tempest-full-py3
|
||||
description: CentOS 9 Stream platform test
|
||||
nodeset: devstack-single-node-centos-9-stream
|
||||
timeout: 9000
|
||||
# TODO(kopecmartin) n-v until the following is resolved:
|
||||
# https://bugs.launchpad.net/neutron/+bug/1979047
|
||||
voting: false
|
||||
vars:
|
||||
configure_swap_size: 4096
|
||||
|
||||
@@ -687,17 +647,50 @@
|
||||
parent: tempest-full-py3
|
||||
description: Debian Bullseye platform test
|
||||
nodeset: devstack-single-node-debian-bullseye
|
||||
voting: false
|
||||
timeout: 9000
|
||||
vars:
|
||||
configure_swap_size: 4096
|
||||
# NOTE(yoctozepto): Debian Bullseye does not yet offer OVN. Switch to OVS
|
||||
# for the time being.
|
||||
|
||||
- job:
|
||||
name: devstack-platform-ubuntu-jammy
|
||||
parent: tempest-full-py3
|
||||
description: Ubuntu 22.04 LTS (jammy) platform test
|
||||
nodeset: openstack-single-node-jammy
|
||||
timeout: 9000
|
||||
vars:
|
||||
configure_swap_size: 4096
|
||||
devstack_services:
|
||||
# Horizon doesn't like py310
|
||||
horizon: false
|
||||
|
||||
- job:
|
||||
name: devstack-platform-ubuntu-jammy-ovn-source
|
||||
parent: devstack-platform-ubuntu-jammy
|
||||
description: Ubuntu 22.04 LTS (jammy) platform test (OVN from source)
|
||||
voting: false
|
||||
vars:
|
||||
devstack_localrc:
|
||||
OVN_BUILD_FROM_SOURCE: True
|
||||
OVN_BRANCH: "v21.06.0"
|
||||
OVS_BRANCH: "a4b04276ab5934d087669ff2d191a23931335c87"
|
||||
OVS_SYSCONFDIR: "/usr/local/etc/openvswitch"
|
||||
|
||||
- job:
|
||||
name: devstack-platform-ubuntu-jammy-ovs
|
||||
parent: tempest-full-py3
|
||||
description: Ubuntu 22.04 LTS (jammy) platform test (OVS)
|
||||
nodeset: openstack-single-node-jammy
|
||||
voting: false
|
||||
timeout: 9000
|
||||
vars:
|
||||
configure_swap_size: 8192
|
||||
devstack_localrc:
|
||||
Q_AGENT: openvswitch
|
||||
Q_ML2_PLUGIN_MECHANISM_DRIVERS: openvswitch
|
||||
Q_ML2_TENANT_NETWORK_TYPE: vxlan
|
||||
devstack_services:
|
||||
# Horizon doesn't like py310
|
||||
horizon: false
|
||||
# Disable OVN services
|
||||
ovn-northd: false
|
||||
ovn-controller: false
|
||||
@@ -723,20 +716,6 @@
|
||||
# Enable Neutron ML2/OVS services
|
||||
q-agt: true
|
||||
|
||||
- job:
|
||||
name: devstack-platform-openEuler-20.03-SP2
|
||||
parent: tempest-full-py3
|
||||
description: openEuler 20.03 SP2 platform test
|
||||
nodeset: devstack-single-node-openeuler-20.03-sp2
|
||||
voting: false
|
||||
timeout: 9000
|
||||
vars:
|
||||
configure_swap_size: 4096
|
||||
devstack_localrc:
|
||||
# NOTE(wxy): OVN package is not supported by openEuler yet. Build it
|
||||
# from source instead.
|
||||
OVN_BUILD_FROM_SOURCE: True
|
||||
|
||||
- job:
|
||||
name: devstack-no-tls-proxy
|
||||
parent: tempest-full-py3
|
||||
@@ -748,30 +727,6 @@
|
||||
devstack_services:
|
||||
tls-proxy: false
|
||||
|
||||
- job:
|
||||
name: devstack-platform-fedora-latest
|
||||
parent: tempest-full-py3
|
||||
description: Fedora latest platform test
|
||||
nodeset: devstack-single-node-fedora-latest
|
||||
voting: false
|
||||
vars:
|
||||
configure_swap_size: 4096
|
||||
# Python 3.10 dependency issues; see
|
||||
# https://bugs.launchpad.net/horizon/+bug/1960204
|
||||
devstack_services:
|
||||
horizon: false
|
||||
|
||||
- job:
|
||||
name: devstack-platform-fedora-latest-virt-preview
|
||||
parent: tempest-full-py3
|
||||
description: Fedora latest platform test using the virt-preview repo.
|
||||
nodeset: devstack-single-node-fedora-latest
|
||||
voting: false
|
||||
vars:
|
||||
configure_swap_size: 4096
|
||||
devstack_localrc:
|
||||
ENABLE_FEDORA_VIRT_PREVIEW_REPO: true
|
||||
|
||||
- job:
|
||||
name: devstack-tox-base
|
||||
parent: devstack
|
||||
@@ -845,11 +800,11 @@
|
||||
- devstack
|
||||
- devstack-ipv6
|
||||
- devstack-enforce-scope
|
||||
- devstack-platform-fedora-latest
|
||||
- devstack-platform-centos-8-stream
|
||||
- devstack-platform-centos-9-stream
|
||||
- devstack-platform-debian-bullseye
|
||||
- devstack-platform-openEuler-20.03-SP2
|
||||
- devstack-platform-ubuntu-jammy
|
||||
- devstack-platform-ubuntu-jammy-ovn-source
|
||||
- devstack-platform-ubuntu-jammy-ovs
|
||||
- devstack-multinode
|
||||
- devstack-unit-tests
|
||||
- openstack-tox-bashate
|
||||
@@ -893,7 +848,11 @@
|
||||
jobs:
|
||||
- devstack
|
||||
- devstack-ipv6
|
||||
- devstack-platform-centos-9-stream
|
||||
# TODO(kopecmartin) n-v until the following is resolved:
|
||||
# https://bugs.launchpad.net/neutron/+bug/1979047
|
||||
# - devstack-platform-centos-9-stream
|
||||
- devstack-platform-debian-bullseye
|
||||
- devstack-platform-ubuntu-jammy
|
||||
- devstack-enforce-scope
|
||||
- devstack-multinode
|
||||
- devstack-unit-tests
|
||||
@@ -941,10 +900,6 @@
|
||||
# Next cycle we can remove this if everything run out stable enough.
|
||||
# * nova-multi-cell: maintained by nova and currently non-voting in the
|
||||
# check queue for nova changes but relies on devstack configuration
|
||||
# * devstack-platform-fedora-latest-virt-preview: Maintained by lyarwood
|
||||
# for Nova to allow early testing of the latest versions of Libvirt and
|
||||
# QEMU. Should only graduate out of experimental if it ever moves into
|
||||
# the check queue for Nova.
|
||||
|
||||
experimental:
|
||||
jobs:
|
||||
@@ -973,8 +928,4 @@
|
||||
irrelevant-files:
|
||||
- ^.*\.rst$
|
||||
- ^doc/.*$
|
||||
- devstack-platform-fedora-latest-virt-preview
|
||||
- devstack-no-tls-proxy
|
||||
periodic:
|
||||
jobs:
|
||||
- devstack-no-tls-proxy
|
||||
|
||||
@@ -279,7 +279,7 @@ number of days of old log files to keep.
|
||||
|
||||
::
|
||||
|
||||
LOGDAYS=1
|
||||
LOGDAYS=2
|
||||
|
||||
Some coloring is used during the DevStack runs to make it easier to
|
||||
see what is going on. This can be disabled with::
|
||||
@@ -521,8 +521,8 @@ behavior:
|
||||
can be configured with any valid IPv6 prefix. The default values make
|
||||
use of an auto-generated ``IPV6_GLOBAL_ID`` to comply with RFC4193.
|
||||
|
||||
Service Version
|
||||
~~~~~~~~~~~~~~~
|
||||
Service IP Version
|
||||
~~~~~~~~~~~~~~~~~~
|
||||
|
||||
DevStack can enable service operation over either IPv4 or IPv6 by
|
||||
setting ``SERVICE_IP_VERSION`` to either ``SERVICE_IP_VERSION=4`` or
|
||||
@@ -542,6 +542,27 @@ optionally be used to alter the default IPv6 address::
|
||||
|
||||
HOST_IPV6=${some_local_ipv6_address}
|
||||
|
||||
Tunnel IP Version
|
||||
~~~~~~~~~~~~~~~~~
|
||||
|
||||
DevStack can enable tunnel operation over either IPv4 or IPv6 by
|
||||
setting ``TUNNEL_IP_VERSION`` to either ``TUNNEL_IP_VERSION=4`` or
|
||||
``TUNNEL_IP_VERSION=6`` respectively.
|
||||
|
||||
When set to ``4`` Neutron will use an IPv4 address for tunnel endpoints,
|
||||
for example, ``HOST_IP``.
|
||||
|
||||
When set to ``6`` Neutron will use an IPv6 address for tunnel endpoints,
|
||||
for example, ``HOST_IPV6``.
|
||||
|
||||
The default value for this setting is ``4``. Dual-mode support, for
|
||||
example ``4+6`` is not supported, as this value must match the address
|
||||
family of the local tunnel endpoint IP(v6) address.
|
||||
|
||||
The value of ``TUNNEL_IP_VERSION`` has a direct relationship to the
|
||||
setting of ``TUNNEL_ENDPOINT_IP``, which will default to ``HOST_IP``
|
||||
when set to ``4``, and ``HOST_IPV6`` when set to ``6``.
|
||||
|
||||
Multi-node setup
|
||||
~~~~~~~~~~~~~~~~
|
||||
|
||||
|
||||
@@ -75,13 +75,21 @@ Otherwise create the stack user:
|
||||
|
||||
useradd -s /bin/bash -d /opt/stack -m stack
|
||||
|
||||
Ensure home directory for the ``stack`` user has executable permission for all,
|
||||
as RHEL based distros create it with ``700`` and Ubuntu 21.04+ with ``750``
|
||||
which can cause issues during deployment.
|
||||
|
||||
::
|
||||
|
||||
chmod +x /opt/stack
|
||||
|
||||
This user will be making many changes to your system during installation
|
||||
and operation so it needs to have sudo privileges to root without a
|
||||
password:
|
||||
|
||||
::
|
||||
|
||||
echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
|
||||
|
||||
From here on use the ``stack`` user. **Logout** and **login** as the
|
||||
``stack`` user.
|
||||
|
||||
@@ -49,13 +49,21 @@ below)
|
||||
|
||||
$ sudo useradd -s /bin/bash -d /opt/stack -m stack
|
||||
|
||||
Ensure home directory for the ``stack`` user has executable permission for all,
|
||||
as RHEL based distros create it with ``700`` and Ubuntu 21.04+ with ``750``
|
||||
which can cause issues during deployment.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ sudo chmod +x /opt/stack
|
||||
|
||||
Since this user will be making many changes to your system, it will need
|
||||
to have sudo privileges:
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ apt-get install sudo -y || yum install -y sudo
|
||||
$ echo "stack ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
|
||||
$ echo "stack ALL=(ALL) NOPASSWD: ALL" | sudo tee /etc/sudoers.d/stack
|
||||
|
||||
.. note:: On some systems you may need to use ``sudo visudo``.
|
||||
|
||||
|
||||
@@ -38,7 +38,7 @@ Install Linux
|
||||
|
||||
Start with a clean and minimal install of a Linux system. DevStack
|
||||
attempts to support the two latest LTS releases of Ubuntu, the
|
||||
latest/current Fedora version, CentOS/RHEL 8, OpenSUSE and openEuler.
|
||||
latest/current Fedora version, CentOS/RHEL 8 and OpenSUSE.
|
||||
|
||||
If you do not have a preference, Ubuntu 20.04 (Focal Fossa) is the
|
||||
most tested, and will probably go the smoothest.
|
||||
@@ -57,6 +57,14 @@ to run DevStack with
|
||||
|
||||
$ sudo useradd -s /bin/bash -d /opt/stack -m stack
|
||||
|
||||
Ensure home directory for the ``stack`` user has executable permission for all,
|
||||
as RHEL based distros create it with ``700`` and Ubuntu 21.04+ with ``750``
|
||||
which can cause issues during deployment.
|
||||
|
||||
.. code-block:: console
|
||||
|
||||
$ sudo chmod +x /opt/stack
|
||||
|
||||
Since this user will be making many changes to your system, it should
|
||||
have sudo privileges:
|
||||
|
||||
|
||||
@@ -238,7 +238,7 @@ package dependencies, packages may be listed at the following
|
||||
locations in the top-level of the plugin repository:
|
||||
|
||||
- ``./devstack/files/debs/$plugin_name`` - Packages to install when running
|
||||
on Ubuntu, Debian or Linux Mint.
|
||||
on Ubuntu or Debian.
|
||||
|
||||
- ``./devstack/files/rpms/$plugin_name`` - Packages to install when running
|
||||
on Red Hat, Fedora, or CentOS.
|
||||
|
||||
@@ -1,7 +1,5 @@
|
||||
conntrack
|
||||
curl
|
||||
dnsmasq-base
|
||||
dnsmasq-utils # for dhcp_release
|
||||
ebtables
|
||||
genisoimage # required for config_drive
|
||||
iptables
|
||||
|
||||
@@ -1,8 +1,6 @@
|
||||
cdrkit-cdrtools-compat # dist:sle12
|
||||
conntrack-tools
|
||||
curl
|
||||
dnsmasq
|
||||
dnsmasq-utils # dist:opensuse-12.3,opensuse-13.1
|
||||
ebtables
|
||||
iptables
|
||||
iputils
|
||||
|
||||
+1
-1
@@ -1,3 +1,3 @@
|
||||
ceph # NOPRIME
|
||||
redhat-lsb-core # not:rhel9,openEuler-20.03
|
||||
redhat-lsb-core # not:rhel9
|
||||
xfsprogs
|
||||
|
||||
+2
-3
@@ -16,7 +16,7 @@ libjpeg-turbo-devel # Pillow 3.0.0
|
||||
libxml2-devel # lxml
|
||||
libxslt-devel # lxml
|
||||
libyaml-devel
|
||||
make # dist:openEuler-20.03
|
||||
mod_ssl # required for tls-proxy on centos 9 stream computes
|
||||
net-tools
|
||||
openssh-server
|
||||
openssl
|
||||
@@ -28,8 +28,7 @@ psmisc
|
||||
python3-devel
|
||||
python3-pip
|
||||
python3-systemd
|
||||
redhat-rpm-config # not:openEuler-20.03 missing dep for gcc hardening flags, see rhbz#1217376
|
||||
systemd-devel # dist:openEuler-20.03
|
||||
redhat-rpm-config # missing dep for gcc hardening flags, see rhbz#1217376
|
||||
tar
|
||||
tcpdump
|
||||
unzip
|
||||
|
||||
+1
-3
@@ -1,12 +1,10 @@
|
||||
conntrack-tools
|
||||
curl
|
||||
dnsmasq # for q-dhcp
|
||||
dnsmasq-utils # for dhcp_release
|
||||
ebtables
|
||||
genisoimage # not:rhel9 required for config_drive
|
||||
iptables
|
||||
iputils
|
||||
kernel-modules # not:openEuler-20.03
|
||||
kernel-modules
|
||||
kpartx
|
||||
parted
|
||||
polkit
|
||||
|
||||
+1
-1
@@ -1,5 +1,5 @@
|
||||
curl
|
||||
liberasurecode-devel # not:openEuler-20.03
|
||||
liberasurecode-devel
|
||||
memcached
|
||||
rsync-daemon
|
||||
sqlite
|
||||
|
||||
@@ -414,10 +414,10 @@ function upload_image {
|
||||
# kernel for use when uploading the root filesystem.
|
||||
local kernel_id="" ramdisk_id="";
|
||||
if [ -n "$kernel" ]; then
|
||||
kernel_id=$(openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name-kernel" $(_image_properties_to_arg $img_property) --public --container-format aki --disk-format aki < "$kernel" | grep ' id ' | get_field 2)
|
||||
kernel_id=$(openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name-kernel" $(_image_properties_to_arg $img_property) --public --container-format aki --disk-format aki < "$kernel" -f value -c id)
|
||||
fi
|
||||
if [ -n "$ramdisk" ]; then
|
||||
ramdisk_id=$(openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name-ramdisk" $(_image_properties_to_arg $img_property) --public --container-format ari --disk-format ari < "$ramdisk" | grep ' id ' | get_field 2)
|
||||
ramdisk_id=$(openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name-ramdisk" $(_image_properties_to_arg $img_property) --public --container-format ari --disk-format ari < "$ramdisk" -f value -c id)
|
||||
fi
|
||||
_upload_image "${image_name%.img}" ami ami "$image" ${kernel_id:+ kernel_id=$kernel_id} ${ramdisk_id:+ ramdisk_id=$ramdisk_id} $img_property
|
||||
fi
|
||||
|
||||
+41
-25
@@ -49,7 +49,7 @@ KILL_PATH="$(which kill)"
|
||||
STACK_ENV_VARS="BASE_SQL_CONN DATA_DIR DEST ENABLED_SERVICES HOST_IP \
|
||||
KEYSTONE_SERVICE_URI \
|
||||
LOGFILE OS_CACERT SERVICE_HOST STACK_USER TLS_IP \
|
||||
HOST_IPV6 SERVICE_IP_VERSION"
|
||||
HOST_IPV6 SERVICE_IP_VERSION TUNNEL_ENDPOINT_IP TUNNEL_IP_VERSION"
|
||||
|
||||
|
||||
# Saves significant environment variables to .stackenv for later use
|
||||
@@ -399,7 +399,7 @@ function _ensure_lsb_release {
|
||||
elif [[ -x $(command -v zypper 2>/dev/null) ]]; then
|
||||
sudo zypper -n install lsb-release
|
||||
elif [[ -x $(command -v dnf 2>/dev/null) ]]; then
|
||||
sudo dnf install -y redhat-lsb-core || sudo dnf install -y openeuler-lsb
|
||||
sudo dnf install -y redhat-lsb-core
|
||||
else
|
||||
die $LINENO "Unable to find or auto-install lsb_release"
|
||||
fi
|
||||
@@ -426,7 +426,7 @@ function GetOSVersion {
|
||||
os_VENDOR=$(lsb_release -i -s)
|
||||
fi
|
||||
|
||||
if [[ $os_VENDOR =~ (Debian|Ubuntu|LinuxMint) ]]; then
|
||||
if [[ $os_VENDOR =~ (Debian|Ubuntu) ]]; then
|
||||
os_PACKAGE="deb"
|
||||
else
|
||||
os_PACKAGE="rpm"
|
||||
@@ -444,9 +444,8 @@ declare -g DISTRO
|
||||
|
||||
function GetDistro {
|
||||
GetOSVersion
|
||||
if [[ "$os_VENDOR" =~ (Ubuntu) || "$os_VENDOR" =~ (Debian) || \
|
||||
"$os_VENDOR" =~ (LinuxMint) ]]; then
|
||||
# 'Everyone' refers to Ubuntu / Debian / Mint releases by
|
||||
if [[ "$os_VENDOR" =~ (Ubuntu) || "$os_VENDOR" =~ (Debian) ]]; then
|
||||
# 'Everyone' refers to Ubuntu / Debian releases by
|
||||
# the code name adjective
|
||||
DISTRO=$os_CODENAME
|
||||
elif [[ "$os_VENDOR" =~ (Fedora) ]]; then
|
||||
@@ -471,10 +470,6 @@ function GetDistro {
|
||||
# Drop the . release as we assume it's compatible
|
||||
# XXX re-evaluate when we get RHEL10
|
||||
DISTRO="rhel${os_RELEASE::1}"
|
||||
elif [[ "$os_VENDOR" =~ (openEuler) ]]; then
|
||||
# The DISTRO here is `openEuler-20.03`. While, actually only openEuler
|
||||
# 20.03 LTS SP2 is fully tested. Other SP version maybe have bugs.
|
||||
DISTRO="openEuler-$os_RELEASE"
|
||||
else
|
||||
# We can't make a good choice here. Setting a sensible DISTRO
|
||||
# is part of the problem, but not the major issue -- we really
|
||||
@@ -526,7 +521,6 @@ function is_fedora {
|
||||
fi
|
||||
|
||||
[ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \
|
||||
[ "$os_VENDOR" = "openEuler" ] || \
|
||||
[ "$os_VENDOR" = "RedHatEnterpriseServer" ] || \
|
||||
[ "$os_VENDOR" = "RedHatEnterprise" ] || \
|
||||
[ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "CentOSStream" ] || \
|
||||
@@ -576,12 +570,6 @@ function is_ubuntu {
|
||||
[ "$os_PACKAGE" = "deb" ]
|
||||
}
|
||||
|
||||
function is_openeuler {
|
||||
if [[ -z "$os_PACKAGE" ]]; then
|
||||
GetOSVersion
|
||||
fi
|
||||
[ "$os_VENDOR" = "openEuler" ]
|
||||
}
|
||||
# Git Functions
|
||||
# =============
|
||||
|
||||
@@ -646,8 +634,10 @@ function git_clone {
|
||||
echo "the project to the \$PROJECTS variable in the job definition."
|
||||
die $LINENO "ERROR_ON_CLONE is set to True so cloning not allowed in this configuration"
|
||||
fi
|
||||
# '--branch' can also take tags
|
||||
git_timed clone $git_clone_flags $git_remote $git_dest --branch $git_ref
|
||||
git_timed clone --no-checkout $git_clone_flags $git_remote $git_dest
|
||||
cd $git_dest
|
||||
git_timed fetch $git_clone_flags origin $git_ref
|
||||
git_timed checkout FETCH_HEAD
|
||||
elif [[ "$RECLONE" = "True" ]]; then
|
||||
# if it does exist then simulate what clone does if asked to RECLONE
|
||||
cd $git_dest
|
||||
@@ -657,7 +647,7 @@ function git_clone {
|
||||
# remove the existing ignored files (like pyc) as they cause breakage
|
||||
# (due to the py files having older timestamps than our pyc, so python
|
||||
# thinks the pyc files are correct using them)
|
||||
find $git_dest -name '*.pyc' -delete
|
||||
sudo find $git_dest -name '*.pyc' -delete
|
||||
|
||||
# handle git_ref accordingly to type (tag, branch)
|
||||
if [[ -n "`git show-ref refs/tags/$git_ref`" ]]; then
|
||||
@@ -673,6 +663,18 @@ function git_clone {
|
||||
fi
|
||||
fi
|
||||
|
||||
# NOTE(ianw) 2022-04-13 : commit [1] has broken many assumptions
|
||||
# about how we clone and work with repos. Mark them safe globally
|
||||
# as a work-around.
|
||||
#
|
||||
# NOTE(danms): On bionic (and likely others) git-config may write
|
||||
# ~stackuser/.gitconfig if not run with sudo -H. Using --system
|
||||
# writes these changes to /etc/gitconfig which is more
|
||||
# discoverable anyway.
|
||||
#
|
||||
# [1] https://github.com/git/git/commit/8959555cee7ec045958f9b6dd62e541affb7e7d9
|
||||
sudo git config --system --add safe.directory ${git_dest}
|
||||
|
||||
# print out the results so we know what change was used in the logs
|
||||
cd $git_dest
|
||||
git show --oneline | head -1
|
||||
@@ -1154,7 +1156,7 @@ function is_ironic_hardware {
|
||||
}
|
||||
|
||||
function is_ironic_enforce_scope {
|
||||
is_service_enabled ironic && [[ "$IRONIC_ENFORCE_SCOPE" == "True" ]] && return 0
|
||||
is_service_enabled ironic && [[ "$IRONIC_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]] && return 0
|
||||
return 1
|
||||
}
|
||||
|
||||
@@ -1563,6 +1565,7 @@ function write_user_unit_file {
|
||||
local command="$2"
|
||||
local group=$3
|
||||
local user=$4
|
||||
local env_vars="$5"
|
||||
local extra=""
|
||||
if [[ -n "$group" ]]; then
|
||||
extra="Group=$group"
|
||||
@@ -1576,6 +1579,9 @@ function write_user_unit_file {
|
||||
iniset -sudo $unitfile "Service" "KillMode" "process"
|
||||
iniset -sudo $unitfile "Service" "TimeoutStopSec" "300"
|
||||
iniset -sudo $unitfile "Service" "ExecReload" "$KILL_PATH -HUP \$MAINPID"
|
||||
if [[ -n "$env_vars" ]] ; then
|
||||
iniset -sudo $unitfile "Service" "Environment" "$env_vars"
|
||||
fi
|
||||
if [[ -n "$group" ]]; then
|
||||
iniset -sudo $unitfile "Service" "Group" "$group"
|
||||
fi
|
||||
@@ -1590,6 +1596,7 @@ function write_uwsgi_user_unit_file {
|
||||
local command="$2"
|
||||
local group=$3
|
||||
local user=$4
|
||||
local env_vars="$5"
|
||||
local unitfile="$SYSTEMD_DIR/$service"
|
||||
mkdir -p $SYSTEMD_DIR
|
||||
|
||||
@@ -1604,6 +1611,9 @@ function write_uwsgi_user_unit_file {
|
||||
iniset -sudo $unitfile "Service" "NotifyAccess" "all"
|
||||
iniset -sudo $unitfile "Service" "RestartForceExitStatus" "100"
|
||||
|
||||
if [[ -n "$env_vars" ]] ; then
|
||||
iniset -sudo $unitfile "Service" "Environment" "$env_vars"
|
||||
fi
|
||||
if [[ -n "$group" ]]; then
|
||||
iniset -sudo $unitfile "Service" "Group" "$group"
|
||||
fi
|
||||
@@ -1651,10 +1661,14 @@ function _run_under_systemd {
|
||||
local systemd_service="devstack@$service.service"
|
||||
local group=$3
|
||||
local user=${4:-$STACK_USER}
|
||||
if [[ -z "$user" ]]; then
|
||||
user=$STACK_USER
|
||||
fi
|
||||
local env_vars="$5"
|
||||
if [[ "$command" =~ "uwsgi" ]] ; then
|
||||
write_uwsgi_user_unit_file $systemd_service "$cmd" "$group" "$user"
|
||||
write_uwsgi_user_unit_file $systemd_service "$cmd" "$group" "$user" "$env_vars"
|
||||
else
|
||||
write_user_unit_file $systemd_service "$cmd" "$group" "$user"
|
||||
write_user_unit_file $systemd_service "$cmd" "$group" "$user" "$env_vars"
|
||||
fi
|
||||
|
||||
$SYSTEMCTL enable $systemd_service
|
||||
@@ -1675,18 +1689,20 @@ function is_running {
|
||||
# If the command includes shell metachatacters (;<>*) it must be run using a shell
|
||||
# If an optional group is provided sg will be used to run the
|
||||
# command as that group.
|
||||
# run_process service "command-line" [group] [user]
|
||||
# run_process service "command-line" [group] [user] [env_vars]
|
||||
# env_vars must be a space separated list of variable assigments, ie: "A=1 B=2"
|
||||
function run_process {
|
||||
local service=$1
|
||||
local command="$2"
|
||||
local group=$3
|
||||
local user=$4
|
||||
local env_vars="$5"
|
||||
|
||||
local name=$service
|
||||
|
||||
time_start "run_process"
|
||||
if is_service_enabled $service; then
|
||||
_run_under_systemd "$name" "$command" "$group" "$user"
|
||||
_run_under_systemd "$name" "$command" "$group" "$user" "$env_vars"
|
||||
fi
|
||||
time_stop "run_process"
|
||||
}
|
||||
|
||||
@@ -189,6 +189,9 @@ function iniset {
|
||||
local option=$3
|
||||
local value=$4
|
||||
|
||||
# Escape the ampersand character (&)
|
||||
value=$(echo $value | sed -e 's/&/\\&/g')
|
||||
|
||||
if [[ -z $section || -z $option ]]; then
|
||||
$xtrace
|
||||
return
|
||||
|
||||
@@ -186,15 +186,11 @@ function pip_install {
|
||||
|
||||
$xtrace
|
||||
|
||||
# adding SETUPTOOLS_SYS_PATH_TECHNIQUE is a workaround to keep
|
||||
# the same behaviour of setuptools before version 25.0.0.
|
||||
# related issue: https://github.com/pypa/pip/issues/3874
|
||||
$sudo_pip \
|
||||
http_proxy="${http_proxy:-}" \
|
||||
https_proxy="${https_proxy:-}" \
|
||||
no_proxy="${no_proxy:-}" \
|
||||
PIP_FIND_LINKS=$PIP_FIND_LINKS \
|
||||
SETUPTOOLS_SYS_PATH_TECHNIQUE=rewrite \
|
||||
$cmd_pip $upgrade \
|
||||
$@
|
||||
result=$?
|
||||
|
||||
+1
-1
@@ -95,7 +95,7 @@ function install_apache_uwsgi {
|
||||
# didn't fix Python 3.10 compatibility before release. Should be
|
||||
# fixed in uwsgi 4.9.0; can remove this when packages available
|
||||
# or we drop this release
|
||||
elif is_fedora && ! is_openeuler && ! [[ $DISTRO =~ f35 ]]; then
|
||||
elif is_fedora && ! [[ $DISTRO =~ f35 ]]; then
|
||||
# Note httpd comes with mod_proxy_uwsgi and it is loaded by
|
||||
# default; the mod_proxy_uwsgi package actually conflicts now.
|
||||
# See:
|
||||
|
||||
+43
-17
@@ -91,6 +91,8 @@ CINDER_VOLUME_CLEAR=$(echo ${CINDER_VOLUME_CLEAR} | tr '[:upper:]' '[:lower:]')
|
||||
# Default to lioadm
|
||||
CINDER_ISCSI_HELPER=${CINDER_ISCSI_HELPER:-lioadm}
|
||||
|
||||
VOLUME_TYPE_MULTIATTACH=${VOLUME_TYPE_MULTIATTACH:-multiattach}
|
||||
|
||||
# EL and SUSE should only use lioadm
|
||||
if is_fedora || is_suse; then
|
||||
if [[ ${CINDER_ISCSI_HELPER} != "lioadm" ]]; then
|
||||
@@ -380,7 +382,7 @@ function configure_cinder {
|
||||
iniset $CINDER_CONF coordination backend_url "etcd3+http://${SERVICE_HOST}:$ETCD_PORT"
|
||||
fi
|
||||
|
||||
if [[ "$CINDER_ENFORCE_SCOPE" == True ]] ; then
|
||||
if [[ "$CINDER_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
|
||||
iniset $CINDER_CONF oslo_policy enforce_scope true
|
||||
iniset $CINDER_CONF oslo_policy enforce_new_defaults true
|
||||
fi
|
||||
@@ -388,16 +390,24 @@ function configure_cinder {
|
||||
|
||||
# create_cinder_accounts() - Set up common required cinder accounts
|
||||
|
||||
# Tenant User Roles
|
||||
# Project User Roles
|
||||
# ------------------------------------------------------------------
|
||||
# service cinder admin # if enabled
|
||||
# SERVICE_PROJECT_NAME cinder service
|
||||
# SERVICE_PROJECT_NAME cinder creator (if Barbican is enabled)
|
||||
|
||||
# Migrated from keystone_data.sh
|
||||
function create_cinder_accounts {
|
||||
# Cinder
|
||||
if [[ "$ENABLED_SERVICES" =~ "c-api" ]]; then
|
||||
|
||||
create_service_user "cinder"
|
||||
local extra_role=""
|
||||
|
||||
# cinder needs the "creator" role in order to interact with barbican
|
||||
if is_service_enabled barbican; then
|
||||
extra_role=$(get_or_create_role "creator")
|
||||
fi
|
||||
|
||||
create_service_user "cinder" $extra_role
|
||||
|
||||
# block-storage is the official service type
|
||||
get_or_create_service "cinder" "block-storage" "Cinder Volume Service"
|
||||
@@ -552,8 +562,13 @@ function start_cinder {
|
||||
fi
|
||||
|
||||
run_process c-sch "$CINDER_BIN_DIR/cinder-scheduler --config-file $CINDER_CONF"
|
||||
run_process c-bak "$CINDER_BIN_DIR/cinder-backup --config-file $CINDER_CONF"
|
||||
run_process c-vol "$CINDER_BIN_DIR/cinder-volume --config-file $CINDER_CONF"
|
||||
# Tune glibc for Python Services using single malloc arena for all threads
|
||||
# and disabling dynamic thresholds to reduce memory usage when using native
|
||||
# threads directly or via eventlet.tpool
|
||||
# https://www.gnu.org/software/libc/manual/html_node/Memory-Allocation-Tunables.html
|
||||
malloc_tuning="MALLOC_ARENA_MAX=1 MALLOC_MMAP_THRESHOLD_=131072 MALLOC_TRIM_THRESHOLD_=262144"
|
||||
run_process c-bak "$CINDER_BIN_DIR/cinder-backup --config-file $CINDER_CONF" "" "" "$malloc_tuning"
|
||||
run_process c-vol "$CINDER_BIN_DIR/cinder-volume --config-file $CINDER_CONF" "" "" "$malloc_tuning"
|
||||
|
||||
# NOTE(jdg): For cinder, startup order matters. To ensure that repor_capabilities is received
|
||||
# by the scheduler start the cinder-volume service last (or restart it) after the scheduler
|
||||
@@ -568,6 +583,23 @@ function stop_cinder {
|
||||
stop_process c-vol
|
||||
}
|
||||
|
||||
function create_one_type {
|
||||
type_name=$1
|
||||
property_key=$2
|
||||
property_value=$3
|
||||
# NOTE (e0ne): openstack client doesn't work with cinder in noauth mode
|
||||
if is_service_enabled keystone; then
|
||||
openstack --os-region-name="$REGION_NAME" volume type create --property $property_key="$property_value" $type_name
|
||||
else
|
||||
# TODO (e0ne): use openstack client once it will support cinder in noauth mode:
|
||||
# https://bugs.launchpad.net/python-cinderclient/+bug/1755279
|
||||
local cinder_url
|
||||
cinder_url=$CINDER_SERVICE_PROTOCOL://$SERVICE_HOST:$CINDER_SERVICE_PORT/v3
|
||||
OS_USER_ID=$OS_USERNAME OS_PROJECT_ID=$OS_PROJECT_NAME cinder --os-auth-type noauth --os-endpoint=$cinder_url type-create $type_name
|
||||
OS_USER_ID=$OS_USERNAME OS_PROJECT_ID=$OS_PROJECT_NAME cinder --os-auth-type noauth --os-endpoint=$cinder_url type-key $type_name set $property_key="$property_value"
|
||||
fi
|
||||
}
|
||||
|
||||
# create_volume_types() - Create Cinder's configured volume types
|
||||
function create_volume_types {
|
||||
# Create volume types
|
||||
@@ -575,19 +607,13 @@ function create_volume_types {
|
||||
local be be_name
|
||||
for be in ${CINDER_ENABLED_BACKENDS//,/ }; do
|
||||
be_name=${be##*:}
|
||||
# NOTE (e0ne): openstack client doesn't work with cinder in noauth mode
|
||||
if is_service_enabled keystone; then
|
||||
openstack --os-region-name="$REGION_NAME" volume type create --property volume_backend_name="${be_name}" ${be_name}
|
||||
else
|
||||
# TODO (e0ne): use openstack client once it will support cinder in noauth mode:
|
||||
# https://bugs.launchpad.net/python-cinderclient/+bug/1755279
|
||||
local cinder_url
|
||||
cinder_url=$CINDER_SERVICE_PROTOCOL://$SERVICE_HOST:$CINDER_SERVICE_PORT/v3
|
||||
OS_USER_ID=$OS_USERNAME OS_PROJECT_ID=$OS_PROJECT_NAME cinder --os-auth-type noauth --os-endpoint=$cinder_url type-create ${be_name}
|
||||
OS_USER_ID=$OS_USERNAME OS_PROJECT_ID=$OS_PROJECT_NAME cinder --os-auth-type noauth --os-endpoint=$cinder_url type-key ${be_name} set volume_backend_name=${be_name}
|
||||
fi
|
||||
create_one_type $be_name "volume_backend_name" $be_name
|
||||
done
|
||||
|
||||
if [[ $ENABLE_VOLUME_MULTIATTACH == "True" ]]; then
|
||||
create_one_type $VOLUME_TYPE_MULTIATTACH $VOLUME_TYPE_MULTIATTACH "<is> True"
|
||||
fi
|
||||
|
||||
# Increase quota for the service project if glance is using cinder,
|
||||
# since it's likely to occasionally go above the default 10 in parallel
|
||||
# test execution.
|
||||
|
||||
@@ -26,12 +26,15 @@ CINDER_BAK_CEPH_USER=${CINDER_BAK_CEPH_USER:-cinder-bak}
|
||||
|
||||
|
||||
function configure_cinder_backup_ceph {
|
||||
sudo ceph -c ${CEPH_CONF_FILE} osd pool create ${CINDER_BAK_CEPH_POOL} ${CINDER_BAK_CEPH_POOL_PG} ${CINDER_BAK_CEPH_POOL_PGP}
|
||||
if [[ "$REMOTE_CEPH" = "False" && "$CEPH_REPLICAS" -ne 1 ]]; then
|
||||
sudo ceph -c ${CEPH_CONF_FILE} osd pool set ${CINDER_BAK_CEPH_POOL} crush_ruleset ${RULE_ID}
|
||||
# Execute this part only when cephadm is not used
|
||||
if [[ "$CEPHADM_DEPLOY" = "False" ]]; then
|
||||
sudo ceph -c ${CEPH_CONF_FILE} osd pool create ${CINDER_BAK_CEPH_POOL} ${CINDER_BAK_CEPH_POOL_PG} ${CINDER_BAK_CEPH_POOL_PGP}
|
||||
if [[ "$REMOTE_CEPH" = "False" && "$CEPH_REPLICAS" -ne 1 ]]; then
|
||||
sudo ceph -c ${CEPH_CONF_FILE} osd pool set ${CINDER_BAK_CEPH_POOL} crush_ruleset ${RULE_ID}
|
||||
fi
|
||||
sudo ceph -c ${CEPH_CONF_FILE} auth get-or-create client.${CINDER_BAK_CEPH_USER} mon "allow r" osd "allow class-read object_prefix rbd_children, allow rwx pool=${CINDER_BAK_CEPH_POOL}, allow rwx pool=${CINDER_CEPH_POOL}" | sudo tee ${CEPH_CONF_DIR}/ceph.client.${CINDER_BAK_CEPH_USER}.keyring
|
||||
sudo chown $(whoami):$(whoami) ${CEPH_CONF_DIR}/ceph.client.${CINDER_BAK_CEPH_USER}.keyring
|
||||
fi
|
||||
sudo ceph -c ${CEPH_CONF_FILE} auth get-or-create client.${CINDER_BAK_CEPH_USER} mon "allow r" osd "allow class-read object_prefix rbd_children, allow rwx pool=${CINDER_BAK_CEPH_POOL}, allow rwx pool=${CINDER_CEPH_POOL}" | sudo tee ${CEPH_CONF_DIR}/ceph.client.${CINDER_BAK_CEPH_USER}.keyring
|
||||
sudo chown $(whoami):$(whoami) ${CEPH_CONF_DIR}/ceph.client.${CINDER_BAK_CEPH_USER}.keyring
|
||||
|
||||
iniset $CINDER_CONF DEFAULT backup_driver "cinder.backup.drivers.ceph.CephBackupDriver"
|
||||
iniset $CINDER_CONF DEFAULT backup_ceph_conf "$CEPH_CONF_FILE"
|
||||
|
||||
+34
-1
@@ -150,6 +150,29 @@ function configure_database_mysql {
|
||||
iniset -sudo $my_conf mysqld log-queries-not-using-indexes 1
|
||||
fi
|
||||
|
||||
if [[ "$MYSQL_GATHER_PERFORMANCE" == "True" ]]; then
|
||||
echo "enabling MySQL performance counting"
|
||||
|
||||
# Install our sqlalchemy plugin
|
||||
pip_install ${TOP_DIR}/tools/dbcounter
|
||||
|
||||
# Create our stats database for accounting
|
||||
recreate_database stats
|
||||
mysql -u $DATABASE_USER -p$DATABASE_PASSWORD -h $MYSQL_HOST -e \
|
||||
"CREATE TABLE queries (db VARCHAR(32), op VARCHAR(32),
|
||||
count INT, PRIMARY KEY (db, op)) ENGINE MEMORY" stats
|
||||
fi
|
||||
|
||||
if [[ "$MYSQL_REDUCE_MEMORY" == "True" ]]; then
|
||||
iniset -sudo $my_conf mysqld read_buffer_size 64K
|
||||
iniset -sudo $my_conf mysqld innodb_buffer_pool_size 16M
|
||||
iniset -sudo $my_conf mysqld thread_stack 192K
|
||||
iniset -sudo $my_conf mysqld thread_cache_size 8
|
||||
iniset -sudo $my_conf mysqld tmp_table_size 8M
|
||||
iniset -sudo $my_conf mysqld sort_buffer_size 8M
|
||||
iniset -sudo $my_conf mysqld max_allowed_packet 8M
|
||||
fi
|
||||
|
||||
restart_service $MYSQL_SERVICE_NAME
|
||||
}
|
||||
|
||||
@@ -209,7 +232,17 @@ function install_database_python_mysql {
|
||||
|
||||
function database_connection_url_mysql {
|
||||
local db=$1
|
||||
echo "$BASE_SQL_CONN/$db?charset=utf8"
|
||||
local plugin
|
||||
|
||||
# NOTE(danms): We don't enable perf on subnodes yet because the
|
||||
# plugin is not installed there
|
||||
if [[ "$MYSQL_GATHER_PERFORMANCE" == "True" ]]; then
|
||||
if is_service_enabled mysql; then
|
||||
plugin="&plugin=dbcounter"
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "$BASE_SQL_CONN/$db?charset=utf8$plugin"
|
||||
}
|
||||
|
||||
|
||||
|
||||
+1
-1
@@ -432,7 +432,7 @@ function configure_glance {
|
||||
iniset $GLANCE_API_CONF DEFAULT workers "$API_WORKERS"
|
||||
fi
|
||||
|
||||
if [[ "$GLANCE_ENFORCE_SCOPE" == True ]] ; then
|
||||
if [[ "$GLANCE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
|
||||
iniset $GLANCE_API_CONF oslo_policy enforce_scope true
|
||||
iniset $GLANCE_API_CONF oslo_policy enforce_new_defaults true
|
||||
iniset $GLANCE_API_CONF DEFAULT enforce_secure_rbac true
|
||||
|
||||
+1
-1
@@ -265,7 +265,7 @@ function configure_keystone {
|
||||
iniset $KEYSTONE_CONF security_compliance lockout_duration $KEYSTONE_LOCKOUT_DURATION
|
||||
iniset $KEYSTONE_CONF security_compliance unique_last_password_count $KEYSTONE_UNIQUE_LAST_PASSWORD_COUNT
|
||||
fi
|
||||
if [[ "$KEYSTONE_ENFORCE_SCOPE" == True ]] ; then
|
||||
if [[ "$KEYSTONE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
|
||||
iniset $KEYSTONE_CONF oslo_policy enforce_scope true
|
||||
iniset $KEYSTONE_CONF oslo_policy enforce_new_defaults true
|
||||
iniset $KEYSTONE_CONF oslo_policy policy_file policy.yaml
|
||||
|
||||
+23
-8
@@ -114,6 +114,12 @@ NEUTRON_TENANT_VLAN_RANGE=${NEUTRON_TENANT_VLAN_RANGE:-${TENANT_VLAN_RANGE:-100:
|
||||
# Physical network for VLAN network usage.
|
||||
NEUTRON_PHYSICAL_NETWORK=${NEUTRON_PHYSICAL_NETWORK:-}
|
||||
|
||||
# The name of the service in the endpoint URL
|
||||
NEUTRON_ENDPOINT_SERVICE_NAME=${NEUTRON_ENDPOINT_SERVICE_NAME-"networking"}
|
||||
if [[ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" && -z "$NEUTRON_ENDPOINT_SERVICE_NAME" ]]; then
|
||||
NEUTRON_ENDPOINT_SERVICE_NAME="networking"
|
||||
fi
|
||||
|
||||
|
||||
# Additional neutron api config files
|
||||
declare -a -g _NEUTRON_SERVER_EXTRA_CONF_FILES_ABS
|
||||
@@ -213,7 +219,6 @@ function configure_neutron_new {
|
||||
iniset $NEUTRON_CONF DEFAULT core_plugin $NEUTRON_CORE_PLUGIN
|
||||
|
||||
iniset $NEUTRON_CONF DEFAULT policy_file $policy_file
|
||||
iniset $NEUTRON_CONF DEFAULT allow_overlapping_ips True
|
||||
iniset $NEUTRON_CONF DEFAULT router_distributed $NEUTRON_DISTRIBUTED_ROUTING
|
||||
|
||||
iniset $NEUTRON_CONF DEFAULT auth_strategy $NEUTRON_AUTH_STRATEGY
|
||||
@@ -229,7 +234,12 @@ function configure_neutron_new {
|
||||
else
|
||||
mech_drivers+=",linuxbridge"
|
||||
fi
|
||||
if [[ "$mech_drivers" == *"linuxbridge"* ]]; then
|
||||
iniset $NEUTRON_CONF experimental linuxbridge True
|
||||
fi
|
||||
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF ml2 mechanism_drivers $mech_drivers
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF ml2 overlay_ip_version $TUNNEL_IP_VERSION
|
||||
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF ml2_type_vxlan vni_ranges 1001:2000
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF ml2_type_flat flat_networks $PUBLIC_NETWORK_NAME
|
||||
@@ -251,10 +261,10 @@ function configure_neutron_new {
|
||||
# Configure the neutron agent
|
||||
if [[ $NEUTRON_AGENT == "linuxbridge" ]]; then
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF securitygroup firewall_driver iptables
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF vxlan local_ip $HOST_IP
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF vxlan local_ip $TUNNEL_ENDPOINT_IP
|
||||
elif [[ $NEUTRON_AGENT == "openvswitch" ]]; then
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF securitygroup firewall_driver openvswitch
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF ovs local_ip $HOST_IP
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF ovs local_ip $TUNNEL_ENDPOINT_IP
|
||||
|
||||
if [[ "$NEUTRON_DISTRIBUTED_ROUTING" = "True" ]]; then
|
||||
iniset $NEUTRON_CORE_PLUGIN_CONF agent l2_population True
|
||||
@@ -392,10 +402,13 @@ function create_neutron_accounts_new {
|
||||
local neutron_url
|
||||
|
||||
if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then
|
||||
neutron_url=$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST/networking/
|
||||
neutron_url=$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST/
|
||||
else
|
||||
neutron_url=$NEUTRON_SERVICE_PROTOCOL://$NEUTRON_SERVICE_HOST:$NEUTRON_SERVICE_PORT/
|
||||
fi
|
||||
if [ ! -z "$NEUTRON_ENDPOINT_SERVICE_NAME" ]; then
|
||||
neutron_url=$neutron_url$NEUTRON_ENDPOINT_SERVICE_NAME
|
||||
fi
|
||||
|
||||
|
||||
if [[ "$ENABLED_SERVICES" =~ "neutron-api" ]]; then
|
||||
@@ -476,19 +489,22 @@ function start_neutron_api {
|
||||
|
||||
if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then
|
||||
run_process neutron-api "$(which uwsgi) --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF"
|
||||
neutron_url=$service_protocol://$NEUTRON_SERVICE_HOST/networking/
|
||||
neutron_url=$service_protocol://$NEUTRON_SERVICE_HOST/
|
||||
enable_service neutron-rpc-server
|
||||
run_process neutron-rpc-server "$NEUTRON_BIN_DIR/neutron-rpc-server $opts"
|
||||
else
|
||||
# Start the Neutron service
|
||||
# TODO(sc68cal) Stop hard coding this
|
||||
run_process neutron-api "$NEUTRON_BIN_DIR/neutron-server $opts"
|
||||
neutron_url=$service_protocol://$NEUTRON_SERVICE_HOST:$service_port
|
||||
neutron_url=$service_protocol://$NEUTRON_SERVICE_HOST:$service_port/
|
||||
# Start proxy if enabled
|
||||
if is_service_enabled tls-proxy; then
|
||||
start_tls_proxy neutron '*' $NEUTRON_SERVICE_PORT $NEUTRON_SERVICE_HOST $NEUTRON_SERVICE_PORT_INT
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "$NEUTRON_ENDPOINT_SERVICE_NAME" ]; then
|
||||
neutron_url=$neutron_url$NEUTRON_ENDPOINT_SERVICE_NAME
|
||||
fi
|
||||
|
||||
if ! wait_for_service $SERVICE_TIMEOUT $neutron_url; then
|
||||
die $LINENO "neutron-api did not start"
|
||||
@@ -551,7 +567,6 @@ function stop_neutron_new {
|
||||
fi
|
||||
|
||||
if is_service_enabled neutron-metadata-agent; then
|
||||
sudo pkill -9 -f neutron-ns-metadata-proxy || :
|
||||
stop_process neutron-metadata-agent
|
||||
fi
|
||||
}
|
||||
@@ -632,7 +647,7 @@ function configure_neutron {
|
||||
# configure_rbac_policies() - Configure Neutron to enforce new RBAC
|
||||
# policies and scopes if NEUTRON_ENFORCE_SCOPE == True
|
||||
function configure_rbac_policies {
|
||||
if [ "$NEUTRON_ENFORCE_SCOPE" == "True" ]; then
|
||||
if [[ "$NEUTRON_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then
|
||||
iniset $NEUTRON_CONF oslo_policy enforce_new_defaults True
|
||||
iniset $NEUTRON_CONF oslo_policy enforce_scope True
|
||||
else
|
||||
|
||||
+36
-14
@@ -138,10 +138,19 @@ Q_NOTIFY_NOVA_PORT_DATA_CHANGES=${Q_NOTIFY_NOVA_PORT_DATA_CHANGES:-True}
|
||||
VIF_PLUGGING_IS_FATAL=${VIF_PLUGGING_IS_FATAL:-True}
|
||||
VIF_PLUGGING_TIMEOUT=${VIF_PLUGGING_TIMEOUT:-300}
|
||||
|
||||
# Allow to skip stopping of OVN services
|
||||
SKIP_STOP_OVN=${SKIP_STOP_OVN:-False}
|
||||
|
||||
# The directory which contains files for Q_PLUGIN_EXTRA_CONF_FILES.
|
||||
# /etc/neutron is assumed by many of devstack plugins. Do not change.
|
||||
_Q_PLUGIN_EXTRA_CONF_PATH=/etc/neutron
|
||||
|
||||
# The name of the service in the endpoint URL
|
||||
NEUTRON_ENDPOINT_SERVICE_NAME=${NEUTRON_ENDPOINT_SERVICE_NAME-"networking"}
|
||||
if [[ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" && -z "$NEUTRON_ENDPOINT_SERVICE_NAME" ]]; then
|
||||
NEUTRON_ENDPOINT_SERVICE_NAME="networking"
|
||||
fi
|
||||
|
||||
# List of config file names in addition to the main plugin config file
|
||||
# To add additional plugin config files, use ``neutron_server_config_add``
|
||||
# utility function. For example:
|
||||
@@ -243,13 +252,6 @@ if [[ $Q_AGENT == "linuxbridge" && -z ${LB_PHYSICAL_INTERFACE} ]]; then
|
||||
LB_PHYSICAL_INTERFACE=$default_route_dev
|
||||
fi
|
||||
|
||||
# When Neutron tunnels are enabled it is needed to specify the
|
||||
# IP address of the end point in the local server. This IP is set
|
||||
# by default to the same IP address that the HOST IP.
|
||||
# This variable can be used to specify a different end point IP address
|
||||
# Example: ``TUNNEL_ENDPOINT_IP=1.1.1.1``
|
||||
TUNNEL_ENDPOINT_IP=${TUNNEL_ENDPOINT_IP:-$HOST_IP}
|
||||
|
||||
# With the openvswitch plugin, set to True in ``localrc`` to enable
|
||||
# provider GRE tunnels when ``ENABLE_TENANT_TUNNELS`` is False.
|
||||
#
|
||||
@@ -435,10 +437,13 @@ function create_nova_conf_neutron {
|
||||
function create_mutnauq_accounts {
|
||||
local neutron_url
|
||||
if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then
|
||||
neutron_url=$Q_PROTOCOL://$SERVICE_HOST/networking/
|
||||
neutron_url=$Q_PROTOCOL://$SERVICE_HOST/
|
||||
else
|
||||
neutron_url=$Q_PROTOCOL://$SERVICE_HOST:$Q_PORT/
|
||||
fi
|
||||
if [ ! -z "$NEUTRON_ENDPOINT_SERVICE_NAME" ]; then
|
||||
neutron_url=$neutron_url$NEUTRON_ENDPOINT_SERVICE_NAME
|
||||
fi
|
||||
|
||||
if [[ "$ENABLED_SERVICES" =~ "q-svc" ]]; then
|
||||
|
||||
@@ -500,7 +505,7 @@ function configure_neutron_after_post_config {
|
||||
# configure_rbac_policies() - Configure Neutron to enforce new RBAC
|
||||
# policies and scopes if NEUTRON_ENFORCE_SCOPE == True
|
||||
function configure_rbac_policies {
|
||||
if [ "$NEUTRON_ENFORCE_SCOPE" == "True" ]; then
|
||||
if [[ "$NEUTRON_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == True ]]; then
|
||||
iniset $NEUTRON_CONF oslo_policy enforce_new_defaults True
|
||||
iniset $NEUTRON_CONF oslo_policy enforce_scope True
|
||||
else
|
||||
@@ -542,17 +547,20 @@ function start_neutron_service_and_check {
|
||||
if [ "$NEUTRON_DEPLOY_MOD_WSGI" == "True" ]; then
|
||||
enable_service neutron-api
|
||||
run_process neutron-api "$(which uwsgi) --procname-prefix neutron-api --ini $NEUTRON_UWSGI_CONF"
|
||||
neutron_url=$Q_PROTOCOL://$Q_HOST/networking/
|
||||
neutron_url=$Q_PROTOCOL://$Q_HOST/
|
||||
enable_service neutron-rpc-server
|
||||
run_process neutron-rpc-server "$NEUTRON_BIN_DIR/neutron-rpc-server $cfg_file_options"
|
||||
else
|
||||
run_process q-svc "$NEUTRON_BIN_DIR/neutron-server $cfg_file_options"
|
||||
neutron_url=$service_protocol://$Q_HOST:$service_port
|
||||
neutron_url=$service_protocol://$Q_HOST:$service_port/
|
||||
# Start proxy if enabled
|
||||
if is_service_enabled tls-proxy; then
|
||||
start_tls_proxy neutron '*' $Q_PORT $Q_HOST $Q_PORT_INT
|
||||
fi
|
||||
fi
|
||||
if [ ! -z "$NEUTRON_ENDPOINT_SERVICE_NAME" ]; then
|
||||
neutron_url=$neutron_url$NEUTRON_ENDPOINT_SERVICE_NAME
|
||||
fi
|
||||
echo "Waiting for Neutron to start..."
|
||||
|
||||
local testcmd="wget ${ssl_ca} --no-proxy -q -O- $neutron_url"
|
||||
@@ -620,7 +628,6 @@ function stop_mutnauq_other {
|
||||
fi
|
||||
|
||||
if is_service_enabled q-meta; then
|
||||
sudo pkill -9 -f neutron-ns-metadata-proxy || :
|
||||
stop_process q-meta
|
||||
fi
|
||||
|
||||
@@ -638,7 +645,7 @@ function stop_mutnauq {
|
||||
stop_mutnauq_other
|
||||
stop_mutnauq_l2_agent
|
||||
|
||||
if [[ $Q_AGENT == "ovn" ]]; then
|
||||
if [[ $Q_AGENT == "ovn" && $SKIP_STOP_OVN != "True" ]]; then
|
||||
stop_ovn
|
||||
fi
|
||||
}
|
||||
@@ -909,18 +916,30 @@ function _configure_neutron_plugin_agent {
|
||||
neutron_plugin_configure_plugin_agent
|
||||
}
|
||||
|
||||
function _replace_api_paste_composite {
|
||||
local sep
|
||||
sep=$(echo -ne "\x01")
|
||||
# Replace it
|
||||
$sudo sed -i -e "s/\/\: neutronversions_composite/\/"${NEUTRON_ENDPOINT_SERVICE_NAME}"\/\: neutronversions_composite/" "$Q_API_PASTE_FILE"
|
||||
$sudo sed -i -e "s/\/healthcheck\: healthcheck/\/"${NEUTRON_ENDPOINT_SERVICE_NAME}"\/healthcheck\: healthcheck/" "$Q_API_PASTE_FILE"
|
||||
$sudo sed -i -e "s/\/v2.0\: neutronapi_v2_0/\/"${NEUTRON_ENDPOINT_SERVICE_NAME}"\/v2.0\: neutronapi_v2_0/" "$Q_API_PASTE_FILE"
|
||||
}
|
||||
|
||||
# _configure_neutron_service() - Set config files for neutron service
|
||||
# It is called when q-svc is enabled.
|
||||
function _configure_neutron_service {
|
||||
Q_API_PASTE_FILE=$NEUTRON_CONF_DIR/api-paste.ini
|
||||
cp $NEUTRON_DIR/etc/api-paste.ini $Q_API_PASTE_FILE
|
||||
|
||||
if [[ -n "$NEUTRON_ENDPOINT_SERVICE_NAME" ]]; then
|
||||
_replace_api_paste_composite
|
||||
fi
|
||||
|
||||
# Update either configuration file with plugin
|
||||
iniset $NEUTRON_CONF DEFAULT core_plugin $Q_PLUGIN_CLASS
|
||||
|
||||
iniset $NEUTRON_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
|
||||
iniset $NEUTRON_CONF oslo_policy policy_file $Q_POLICY_FILE
|
||||
iniset $NEUTRON_CONF DEFAULT allow_overlapping_ips $Q_ALLOW_OVERLAPPING_IP
|
||||
|
||||
iniset $NEUTRON_CONF DEFAULT auth_strategy $Q_AUTH_STRATEGY
|
||||
configure_keystone_authtoken_middleware $NEUTRON_CONF $Q_ADMIN_USERNAME
|
||||
@@ -931,6 +950,9 @@ function _configure_neutron_service {
|
||||
|
||||
configure_keystone_authtoken_middleware $NEUTRON_CONF nova nova
|
||||
|
||||
# Configuration for placement client
|
||||
configure_keystone_authtoken_middleware $NEUTRON_CONF placement placement
|
||||
|
||||
# Configure plugin
|
||||
neutron_plugin_configure_service
|
||||
}
|
||||
|
||||
@@ -125,6 +125,10 @@ function neutron_plugin_configure_service {
|
||||
fi
|
||||
|
||||
populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2 mechanism_drivers=$Q_ML2_PLUGIN_MECHANISM_DRIVERS
|
||||
if [[ "$Q_ML2_PLUGIN_MECHANISM_DRIVERS" == *"linuxbridge"* ]]; then
|
||||
iniset $NEUTRON_CONF experimental linuxbridge True
|
||||
fi
|
||||
populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2 overlay_ip_version=$TUNNEL_IP_VERSION
|
||||
|
||||
if [[ -n "$Q_ML2_PLUGIN_TYPE_DRIVERS" ]]; then
|
||||
populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2 type_drivers=$Q_ML2_PLUGIN_TYPE_DRIVERS
|
||||
|
||||
@@ -99,8 +99,10 @@ ENABLE_CHASSIS_AS_GW=$(trueorfalse True ENABLE_CHASSIS_AS_GW)
|
||||
OVN_L3_CREATE_PUBLIC_NETWORK=$(trueorfalse True OVN_L3_CREATE_PUBLIC_NETWORK)
|
||||
|
||||
export OVSDB_SERVER_LOCAL_HOST=$SERVICE_LOCAL_HOST
|
||||
TUNNEL_IP=$TUNNEL_ENDPOINT_IP
|
||||
if [[ "$SERVICE_IP_VERSION" == 6 ]]; then
|
||||
OVSDB_SERVER_LOCAL_HOST=[$OVSDB_SERVER_LOCAL_HOST]
|
||||
TUNNEL_IP=[$TUNNEL_IP]
|
||||
fi
|
||||
|
||||
OVN_IGMP_SNOOPING_ENABLE=$(trueorfalse False OVN_IGMP_SNOOPING_ENABLE)
|
||||
@@ -169,12 +171,23 @@ Q_LOG_DRIVER_LOG_BASE=${Q_LOG_DRIVER_LOG_BASE:-acl_log_meter}
|
||||
# Utility Functions
|
||||
# -----------------
|
||||
|
||||
function wait_for_db_file {
|
||||
local count=0
|
||||
while [ ! -f $1 ]; do
|
||||
sleep 1
|
||||
count=$((count+1))
|
||||
if [ "$count" -gt 40 ]; then
|
||||
die $LINENO "DB File $1 not found"
|
||||
fi
|
||||
done
|
||||
}
|
||||
|
||||
function wait_for_sock_file {
|
||||
local count=0
|
||||
while [ ! -S $1 ]; do
|
||||
sleep 1
|
||||
count=$((count+1))
|
||||
if [ "$count" -gt 5 ]; then
|
||||
if [ "$count" -gt 40 ]; then
|
||||
die $LINENO "Socket $1 not found"
|
||||
fi
|
||||
done
|
||||
@@ -384,6 +397,8 @@ function install_ovn {
|
||||
sudo mkdir -p $OVS_PREFIX/var/log/ovn
|
||||
sudo chown $(whoami) $OVS_PREFIX/var/log/ovn
|
||||
else
|
||||
# Load fixup_ovn_centos
|
||||
source ${TOP_DIR}/tools/fixup_stuff.sh
|
||||
fixup_ovn_centos
|
||||
install_package $(get_packages openvswitch)
|
||||
install_package $(get_packages ovn)
|
||||
@@ -575,6 +590,7 @@ function init_ovn {
|
||||
rm -f $OVS_DATADIR/.*.db.~lock~
|
||||
sudo rm -f $OVN_DATADIR/*.db
|
||||
sudo rm -f $OVN_DATADIR/.*.db.~lock~
|
||||
sudo rm -f $OVN_RUNDIR/*.sock
|
||||
}
|
||||
|
||||
function _start_ovs {
|
||||
@@ -601,7 +617,7 @@ function _start_ovs {
|
||||
dbcmd+=" --remote=db:hardware_vtep,Global,managers $OVS_DATADIR/vtep.db"
|
||||
fi
|
||||
dbcmd+=" $OVS_DATADIR/conf.db"
|
||||
_run_process ovsdb-server "$dbcmd"
|
||||
_run_process ovsdb-server "$dbcmd" "" "$STACK_GROUP" "root"
|
||||
|
||||
# Note: ovn-controller will create and configure br-int once it is started.
|
||||
# So, no need to create it now because nothing depends on that bridge here.
|
||||
@@ -626,8 +642,8 @@ function _start_ovs {
|
||||
sudo ovs-vsctl --no-wait set open_vswitch . external-ids:ovn-remote="$OVN_SB_REMOTE"
|
||||
sudo ovs-vsctl --no-wait set open_vswitch . external-ids:ovn-bridge="br-int"
|
||||
sudo ovs-vsctl --no-wait set open_vswitch . external-ids:ovn-encap-type="geneve"
|
||||
sudo ovs-vsctl --no-wait set open_vswitch . external-ids:ovn-encap-ip="$HOST_IP"
|
||||
sudo ovs-vsctl --no-wait set open_vswitch . external-ids:hostname="$LOCAL_HOSTNAME"
|
||||
sudo ovs-vsctl --no-wait set open_vswitch . external-ids:ovn-encap-ip="$TUNNEL_IP"
|
||||
sudo ovs-vsctl --no-wait set open_vswitch . external-ids:hostname=$(hostname)
|
||||
# Select this chassis to host gateway routers
|
||||
if [[ "$ENABLE_CHASSIS_AS_GW" == "True" ]]; then
|
||||
sudo ovs-vsctl --no-wait set open_vswitch . external-ids:ovn-cms-options="enable-chassis-as-gw"
|
||||
@@ -641,7 +657,7 @@ function _start_ovs {
|
||||
if is_service_enabled ovn-controller-vtep ; then
|
||||
ovn_base_setup_bridge br-v
|
||||
vtep-ctl add-ps br-v
|
||||
vtep-ctl set Physical_Switch br-v tunnel_ips=$HOST_IP
|
||||
vtep-ctl set Physical_Switch br-v tunnel_ips=$TUNNEL_IP
|
||||
|
||||
enable_service ovs-vtep
|
||||
local vtepcmd="$OVS_SCRIPTDIR/ovs-vtep --log-file --pidfile --detach br-v"
|
||||
@@ -689,14 +705,17 @@ function start_ovn {
|
||||
local cmd="/bin/bash $SCRIPTDIR/ovn-ctl --no-monitor start_northd"
|
||||
local stop_cmd="/bin/bash $SCRIPTDIR/ovn-ctl stop_northd"
|
||||
|
||||
_run_process ovn-northd "$cmd" "$stop_cmd"
|
||||
_run_process ovn-northd "$cmd" "$stop_cmd" "$STACK_GROUP" "root"
|
||||
else
|
||||
_start_process "$OVN_NORTHD_SERVICE"
|
||||
fi
|
||||
|
||||
# Wait for the service to be ready
|
||||
# Check for socket and db files for both OVN NB and SB
|
||||
wait_for_sock_file $OVS_RUNDIR/ovnnb_db.sock
|
||||
wait_for_sock_file $OVS_RUNDIR/ovnsb_db.sock
|
||||
wait_for_db_file $OVN_DATADIR/ovnnb_db.db
|
||||
wait_for_db_file $OVN_DATADIR/ovnsb_db.db
|
||||
|
||||
if is_service_enabled tls-proxy; then
|
||||
sudo ovn-nbctl --db=unix:$OVS_RUNDIR/ovnnb_db.sock set-ssl $INT_CA_DIR/private/$DEVSTACK_CERT_NAME.key $INT_CA_DIR/$DEVSTACK_CERT_NAME.crt $INT_CA_DIR/ca-chain.pem
|
||||
|
||||
@@ -87,9 +87,15 @@ function prepare_for_ovs_compilation {
|
||||
|
||||
install_package kernel-devel-$KERNEL_VERSION
|
||||
install_package kernel-headers-$KERNEL_VERSION
|
||||
if is_service_enabled tls-proxy; then
|
||||
install_package openssl-devel
|
||||
fi
|
||||
|
||||
elif is_ubuntu ; then
|
||||
install_package linux-headers-$KERNEL_VERSION
|
||||
if is_service_enabled tls-proxy; then
|
||||
install_package libssl-dev
|
||||
fi
|
||||
fi
|
||||
}
|
||||
|
||||
@@ -158,10 +164,8 @@ function compile_ovs {
|
||||
sudo make install
|
||||
if [[ "$build_modules" == "True" ]]; then
|
||||
sudo make INSTALL_MOD_DIR=kernel/net/openvswitch modules_install
|
||||
reload_ovs_kernel_modules
|
||||
else
|
||||
load_ovs_kernel_modules
|
||||
fi
|
||||
reload_ovs_kernel_modules
|
||||
|
||||
cd $_pwd
|
||||
}
|
||||
|
||||
@@ -147,10 +147,6 @@ function _neutron_get_ext_gw_interface {
|
||||
}
|
||||
|
||||
function create_neutron_initial_network {
|
||||
local project_id
|
||||
project_id=$(openstack project list | grep " demo " | get_field 1)
|
||||
die_if_not_set $LINENO project_id "Failure retrieving project_id for demo"
|
||||
|
||||
# Allow drivers that need to create an initial network to do so here
|
||||
if type -p neutron_plugin_create_initial_network_profile > /dev/null; then
|
||||
neutron_plugin_create_initial_network_profile $PHYSICAL_NETWORK
|
||||
@@ -170,15 +166,15 @@ function create_neutron_initial_network {
|
||||
if is_provider_network; then
|
||||
die_if_not_set $LINENO PHYSICAL_NETWORK "You must specify the PHYSICAL_NETWORK"
|
||||
die_if_not_set $LINENO PROVIDER_NETWORK_TYPE "You must specify the PROVIDER_NETWORK_TYPE"
|
||||
NET_ID=$(openstack --os-cloud devstack-admin-demo --os-region "$REGION_NAME" network create $PHYSICAL_NETWORK --provider-network-type $PROVIDER_NETWORK_TYPE --provider-physical-network "$PHYSICAL_NETWORK" ${SEGMENTATION_ID:+--provider-segment $SEGMENTATION_ID} --share | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PHYSICAL_NETWORK $project_id"
|
||||
NET_ID=$(openstack --os-cloud devstack-admin-demo --os-region "$REGION_NAME" network create $PHYSICAL_NETWORK --provider-network-type $PROVIDER_NETWORK_TYPE --provider-physical-network "$PHYSICAL_NETWORK" ${SEGMENTATION_ID:+--provider-segment $SEGMENTATION_ID} --share -f value -c id)
|
||||
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PHYSICAL_NETWORK"
|
||||
|
||||
if [[ "$IP_VERSION" =~ 4.* ]]; then
|
||||
if [ -z $SUBNETPOOL_V4_ID ]; then
|
||||
fixed_range_v4=$FIXED_RANGE
|
||||
fi
|
||||
SUBNET_ID=$(openstack --os-cloud devstack --os-region "$REGION_NAME" subnet create --ip-version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} $PROVIDER_SUBNET_NAME --gateway $NETWORK_GATEWAY ${SUBNETPOOL_V4_ID:+--subnet-pool $SUBNETPOOL_V4_ID} --network $NET_ID ${fixed_range_v4:+--subnet-range $fixed_range_v4} | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO SUBNET_ID "Failure creating SUBNET_ID for $PROVIDER_SUBNET_NAME $project_id"
|
||||
SUBNET_ID=$(openstack --os-cloud devstack --os-region "$REGION_NAME" subnet create --ip-version 4 ${ALLOCATION_POOL:+--allocation-pool $ALLOCATION_POOL} $PROVIDER_SUBNET_NAME --gateway $NETWORK_GATEWAY ${SUBNETPOOL_V4_ID:+--subnet-pool $SUBNETPOOL_V4_ID} --network $NET_ID ${fixed_range_v4:+--subnet-range $fixed_range_v4} -f value -c id)
|
||||
die_if_not_set $LINENO SUBNET_ID "Failure creating SUBNET_ID for $PROVIDER_SUBNET_NAME"
|
||||
fi
|
||||
|
||||
if [[ "$IP_VERSION" =~ .*6 ]]; then
|
||||
@@ -187,8 +183,8 @@ function create_neutron_initial_network {
|
||||
if [ -z $SUBNETPOOL_V6_ID ]; then
|
||||
fixed_range_v6=$IPV6_PROVIDER_FIXED_RANGE
|
||||
fi
|
||||
IPV6_SUBNET_ID=$(openstack --os-cloud devstack --os-region "$REGION_NAME" subnet create --ip-version 6 --gateway $IPV6_PROVIDER_NETWORK_GATEWAY $IPV6_PROVIDER_SUBNET_NAME ${SUBNETPOOL_V6_ID:+--subnet-pool $SUBNETPOOL_V6_ID} --network $NET_ID ${fixed_range_v6:+--subnet-range $fixed_range_v6} | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO IPV6_SUBNET_ID "Failure creating IPV6_SUBNET_ID for $IPV6_PROVIDER_SUBNET_NAME $project_id"
|
||||
IPV6_SUBNET_ID=$(openstack --os-cloud devstack --os-region "$REGION_NAME" subnet create --ip-version 6 --gateway $IPV6_PROVIDER_NETWORK_GATEWAY $IPV6_PROVIDER_SUBNET_NAME ${SUBNETPOOL_V6_ID:+--subnet-pool $SUBNETPOOL_V6_ID} --network $NET_ID ${fixed_range_v6:+--subnet-range $fixed_range_v6} -f value -c id)
|
||||
die_if_not_set $LINENO IPV6_SUBNET_ID "Failure creating IPV6_SUBNET_ID for $IPV6_PROVIDER_SUBNET_NAME"
|
||||
fi
|
||||
|
||||
if [[ $Q_AGENT == "openvswitch" ]]; then
|
||||
@@ -197,17 +193,17 @@ function create_neutron_initial_network {
|
||||
sudo ip link set $PUBLIC_INTERFACE up
|
||||
fi
|
||||
else
|
||||
NET_ID=$(openstack --os-cloud devstack --os-region "$REGION_NAME" network create "$PRIVATE_NETWORK_NAME" | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PRIVATE_NETWORK_NAME $project_id"
|
||||
NET_ID=$(openstack --os-cloud devstack --os-region "$REGION_NAME" network create "$PRIVATE_NETWORK_NAME" -f value -c id)
|
||||
die_if_not_set $LINENO NET_ID "Failure creating NET_ID for $PRIVATE_NETWORK_NAME"
|
||||
|
||||
if [[ "$IP_VERSION" =~ 4.* ]]; then
|
||||
# Create IPv4 private subnet
|
||||
SUBNET_ID=$(_neutron_create_private_subnet_v4 $project_id)
|
||||
SUBNET_ID=$(_neutron_create_private_subnet_v4)
|
||||
fi
|
||||
|
||||
if [[ "$IP_VERSION" =~ .*6 ]]; then
|
||||
# Create IPv6 private subnet
|
||||
IPV6_SUBNET_ID=$(_neutron_create_private_subnet_v6 $project_id)
|
||||
IPV6_SUBNET_ID=$(_neutron_create_private_subnet_v6)
|
||||
fi
|
||||
fi
|
||||
|
||||
@@ -215,12 +211,12 @@ function create_neutron_initial_network {
|
||||
# Create a router, and add the private subnet as one of its interfaces
|
||||
if [[ "$Q_L3_ROUTER_PER_TENANT" == "True" ]]; then
|
||||
# create a tenant-owned router.
|
||||
ROUTER_ID=$(openstack --os-cloud devstack --os-region "$REGION_NAME" router create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO ROUTER_ID "Failure creating ROUTER_ID for $project_id $Q_ROUTER_NAME"
|
||||
ROUTER_ID=$(openstack --os-cloud devstack --os-region "$REGION_NAME" router create $Q_ROUTER_NAME -f value -c id)
|
||||
die_if_not_set $LINENO ROUTER_ID "Failure creating router $Q_ROUTER_NAME"
|
||||
else
|
||||
# Plugin only supports creating a single router, which should be admin owned.
|
||||
ROUTER_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" router create $Q_ROUTER_NAME | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO ROUTER_ID "Failure creating ROUTER_ID for $Q_ROUTER_NAME"
|
||||
ROUTER_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" router create $Q_ROUTER_NAME -f value -c id)
|
||||
die_if_not_set $LINENO ROUTER_ID "Failure creating router $Q_ROUTER_NAME"
|
||||
fi
|
||||
|
||||
EXTERNAL_NETWORK_FLAGS="--external"
|
||||
@@ -229,9 +225,9 @@ function create_neutron_initial_network {
|
||||
fi
|
||||
# Create an external network, and a subnet. Configure the external network as router gw
|
||||
if [ "$Q_USE_PROVIDERNET_FOR_PUBLIC" = "True" ]; then
|
||||
EXT_NET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" network create "$PUBLIC_NETWORK_NAME" $EXTERNAL_NETWORK_FLAGS --provider-network-type ${PUBLIC_PROVIDERNET_TYPE:-flat} ${PUBLIC_PROVIDERNET_SEGMENTATION_ID:+--provider-segment $PUBLIC_PROVIDERNET_SEGMENTATION_ID} --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} | grep ' id ' | get_field 2)
|
||||
EXT_NET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" network create "$PUBLIC_NETWORK_NAME" $EXTERNAL_NETWORK_FLAGS --provider-network-type ${PUBLIC_PROVIDERNET_TYPE:-flat} ${PUBLIC_PROVIDERNET_SEGMENTATION_ID:+--provider-segment $PUBLIC_PROVIDERNET_SEGMENTATION_ID} --provider-physical-network ${PUBLIC_PHYSICAL_NETWORK} -f value -c id)
|
||||
else
|
||||
EXT_NET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" network create "$PUBLIC_NETWORK_NAME" $EXTERNAL_NETWORK_FLAGS | grep ' id ' | get_field 2)
|
||||
EXT_NET_ID=$(openstack --os-cloud devstack-admin --os-region "$REGION_NAME" network create "$PUBLIC_NETWORK_NAME" $EXTERNAL_NETWORK_FLAGS -f value -c id)
|
||||
fi
|
||||
die_if_not_set $LINENO EXT_NET_ID "Failure creating EXT_NET_ID for $PUBLIC_NETWORK_NAME"
|
||||
|
||||
@@ -249,7 +245,6 @@ function create_neutron_initial_network {
|
||||
|
||||
# Create private IPv4 subnet
|
||||
function _neutron_create_private_subnet_v4 {
|
||||
local project_id=$1
|
||||
if [ -z $SUBNETPOOL_V4_ID ]; then
|
||||
fixed_range_v4=$FIXED_RANGE
|
||||
fi
|
||||
@@ -262,14 +257,13 @@ function _neutron_create_private_subnet_v4 {
|
||||
subnet_params+="${fixed_range_v4:+--subnet-range $fixed_range_v4} "
|
||||
subnet_params+="--network $NET_ID $PRIVATE_SUBNET_NAME"
|
||||
local subnet_id
|
||||
subnet_id=$(openstack --os-cloud devstack-admin-demo --os-region "$REGION_NAME" subnet create $subnet_params | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO subnet_id "Failure creating private IPv4 subnet for $project_id"
|
||||
subnet_id=$(openstack --os-cloud devstack-admin-demo --os-region "$REGION_NAME" subnet create $subnet_params -f value -c id)
|
||||
die_if_not_set $LINENO subnet_id "Failure creating private IPv4 subnet"
|
||||
echo $subnet_id
|
||||
}
|
||||
|
||||
# Create private IPv6 subnet
|
||||
function _neutron_create_private_subnet_v6 {
|
||||
local project_id=$1
|
||||
die_if_not_set $LINENO IPV6_RA_MODE "IPV6 RA Mode not set"
|
||||
die_if_not_set $LINENO IPV6_ADDRESS_MODE "IPV6 Address Mode not set"
|
||||
local ipv6_modes="--ipv6-ra-mode $IPV6_RA_MODE --ipv6-address-mode $IPV6_ADDRESS_MODE"
|
||||
@@ -284,8 +278,8 @@ function _neutron_create_private_subnet_v6 {
|
||||
subnet_params+="${fixed_range_v6:+--subnet-range $fixed_range_v6} "
|
||||
subnet_params+="$ipv6_modes --network $NET_ID $IPV6_PRIVATE_SUBNET_NAME "
|
||||
local ipv6_subnet_id
|
||||
ipv6_subnet_id=$(openstack --os-cloud devstack-admin-demo --os-region "$REGION_NAME" subnet create $subnet_params | grep ' id ' | get_field 2)
|
||||
die_if_not_set $LINENO ipv6_subnet_id "Failure creating private IPv6 subnet for $project_id"
|
||||
ipv6_subnet_id=$(openstack --os-cloud devstack-admin-demo --os-region "$REGION_NAME" subnet create $subnet_params -f value -c id)
|
||||
die_if_not_set $LINENO ipv6_subnet_id "Failure creating private IPv6 subnet"
|
||||
echo $ipv6_subnet_id
|
||||
}
|
||||
|
||||
@@ -409,7 +403,10 @@ function _neutron_configure_router_v6 {
|
||||
ext_gw_interface=$(_neutron_get_ext_gw_interface)
|
||||
local ipv6_cidr_len=${IPV6_PUBLIC_RANGE#*/}
|
||||
|
||||
# Configure interface for public bridge
|
||||
# Configure interface for public bridge by setting the interface
|
||||
# to "up" in case the job is running entirely private network based
|
||||
# testing.
|
||||
sudo ip link set $ext_gw_interface up
|
||||
sudo ip -6 addr replace $ipv6_ext_gw_ip/$ipv6_cidr_len dev $ext_gw_interface
|
||||
# Any IPv6 private subnet that uses the default IPV6 subnet pool
|
||||
# and that is plugged into the default router (Q_ROUTER_NAME) will
|
||||
|
||||
@@ -103,24 +103,10 @@ FORCE_CONFIG_DRIVE=${FORCE_CONFIG_DRIVE:-"False"}
|
||||
|
||||
# The following NOVA_FILTERS contains SameHostFilter and DifferentHostFilter with
|
||||
# the default filters.
|
||||
NOVA_FILTERS="AvailabilityZoneFilter,ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter,DifferentHostFilter"
|
||||
NOVA_FILTERS="ComputeFilter,ComputeCapabilitiesFilter,ImagePropertiesFilter,ServerGroupAntiAffinityFilter,ServerGroupAffinityFilter,SameHostFilter,DifferentHostFilter"
|
||||
|
||||
QEMU_CONF=/etc/libvirt/qemu.conf
|
||||
|
||||
# Set default defaults here as some hypervisor drivers override these
|
||||
PUBLIC_INTERFACE_DEFAULT=br100
|
||||
# Set ``GUEST_INTERFACE_DEFAULT`` to some interface on the box so that
|
||||
# the default isn't completely crazy. This will match ``eth*``, ``em*``, or
|
||||
# the new ``p*`` interfaces, then basically picks the first
|
||||
# alphabetically. It's probably wrong, however it's less wrong than
|
||||
# always using ``eth0`` which doesn't exist on new Linux distros at all.
|
||||
GUEST_INTERFACE_DEFAULT=$(ip link \
|
||||
| grep 'state UP' \
|
||||
| awk '{print $2}' \
|
||||
| sed 's/://' \
|
||||
| grep ^[ep] \
|
||||
| head -1)
|
||||
|
||||
# ``NOVA_VNC_ENABLED`` can be used to forcibly enable VNC configuration.
|
||||
# In multi-node setups allows compute hosts to not run ``n-novnc``.
|
||||
NOVA_VNC_ENABLED=$(trueorfalse False NOVA_VNC_ENABLED)
|
||||
@@ -324,11 +310,7 @@ EOF
|
||||
|
||||
# set chap algorithms. The default chap_algorithm is md5 which will
|
||||
# not work under FIPS.
|
||||
# FIXME(alee) For some reason, this breaks openeuler. Openeuler devs should weigh in
|
||||
# and determine the correct solution for openeuler here
|
||||
if ! is_openeuler; then
|
||||
iniset -sudo /etc/iscsi/iscsid.conf DEFAULT "node.session.auth.chap_algs" "SHA3-256,SHA256"
|
||||
fi
|
||||
iniset -sudo /etc/iscsi/iscsid.conf DEFAULT "node.session.auth.chap_algs" "SHA3-256,SHA256"
|
||||
|
||||
# ensure that iscsid is started, even when disabled by default
|
||||
restart_service iscsid
|
||||
@@ -1000,6 +982,10 @@ function start_nova_compute {
|
||||
# by the compute process.
|
||||
configure_console_compute
|
||||
|
||||
# Set rebuild timeout longer for BFV instances because we likely have
|
||||
# slower disk than expected. Default is 20s/GB
|
||||
iniset $NOVA_CPU_CONF DEFAULT reimage_timeout_per_gb 60
|
||||
|
||||
# Configure the OVSDB connection for os-vif
|
||||
if [ -n "$OVSDB_SERVER_LOCAL_HOST" ]; then
|
||||
iniset $NOVA_CPU_CONF os_vif_ovs ovsdb_connection "tcp:$OVSDB_SERVER_LOCAL_HOST:6640"
|
||||
@@ -1045,7 +1031,6 @@ function start_nova_rest {
|
||||
local old_path=$PATH
|
||||
export PATH=$NOVA_BIN_DIR:$PATH
|
||||
|
||||
local api_cell_conf=$NOVA_CONF
|
||||
local compute_cell_conf=$NOVA_CONF
|
||||
|
||||
run_process n-sch "$NOVA_BIN_DIR/nova-scheduler --config-file $compute_cell_conf"
|
||||
|
||||
@@ -402,6 +402,11 @@ function configure_swift {
|
||||
# Versioned Writes
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:versioned_writes allow_versioned_writes true
|
||||
|
||||
# Add sha1 temporary https://storyboard.openstack.org/#!/story/2010068
|
||||
if [[ "$SWIFT_ENABLE_TEMPURLS" == "True" ]]; then
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:tempurl allowed_digests "sha1 sha256 sha512"
|
||||
fi
|
||||
|
||||
# Configure Ceilometer
|
||||
if is_service_enabled ceilometer; then
|
||||
iniset ${SWIFT_CONFIG_PROXY_SERVER} filter:ceilometer "set log_level" "WARN"
|
||||
|
||||
+139
-20
@@ -58,7 +58,7 @@ BUILD_TIMEOUT=${BUILD_TIMEOUT:-196}
|
||||
# This must be False on stable branches, as master tempest
|
||||
# deps do not match stable branch deps. Set this to True to
|
||||
# have tempest installed in DevStack by default.
|
||||
INSTALL_TEMPEST=${INSTALL_TEMPEST:-"True"}
|
||||
INSTALL_TEMPEST=${INSTALL_TEMPEST:-"False"}
|
||||
|
||||
# This variable is passed directly to pip install inside the common tox venv
|
||||
# that is created
|
||||
@@ -71,6 +71,17 @@ TEMPEST_VOLUME_VENDOR=${TEMPEST_VOLUME_VENDOR:-$TEMPEST_DEFAULT_VOLUME_VENDOR}
|
||||
TEMPEST_DEFAULT_STORAGE_PROTOCOL="iSCSI"
|
||||
TEMPEST_STORAGE_PROTOCOL=${TEMPEST_STORAGE_PROTOCOL:-$TEMPEST_DEFAULT_STORAGE_PROTOCOL}
|
||||
|
||||
# Glance/Image variables
|
||||
# When Glance image import is enabled, image creation is asynchronous and images
|
||||
# may not yet be active when tempest looks for them. In that case, we poll
|
||||
# Glance every TEMPEST_GLANCE_IMPORT_POLL_INTERVAL seconds for the number of
|
||||
# times specified by TEMPEST_GLANCE_IMPORT_POLL_LIMIT. If you are importing
|
||||
# multiple images, set TEMPEST_GLANCE_IMAGE_COUNT so the poller does not quit
|
||||
# too early (though it will not exceed the polling limit).
|
||||
TEMPEST_GLANCE_IMPORT_POLL_INTERVAL=${TEMPEST_GLANCE_IMPORT_POLL_INTERVAL:-1}
|
||||
TEMPEST_GLANCE_IMPORT_POLL_LIMIT=${TEMPEST_GLANCE_IMPORT_POLL_LIMIT:-12}
|
||||
TEMPEST_GLANCE_IMAGE_COUNT=${TEMPEST_GLANCE_IMAGE_COUNT:-1}
|
||||
|
||||
# Neutron/Network variables
|
||||
IPV6_ENABLED=$(trueorfalse True IPV6_ENABLED)
|
||||
IPV6_SUBNET_ATTRIBUTES_ENABLED=$(trueorfalse True IPV6_SUBNET_ATTRIBUTES_ENABLED)
|
||||
@@ -117,6 +128,13 @@ function set_tempest_venv_constraints {
|
||||
(cd $REQUIREMENTS_DIR &&
|
||||
git show master:upper-constraints.txt 2>/dev/null ||
|
||||
git show origin/master:upper-constraints.txt) > $tmp_c
|
||||
# NOTE(gmann): we need to set the below env var pointing to master
|
||||
# constraints even that is what default in tox.ini. Otherwise it can
|
||||
# create the issue for grenade run where old and new devstack can have
|
||||
# different tempest (old and master) to install. For detail problem,
|
||||
# refer to the https://bugs.launchpad.net/devstack/+bug/2003993
|
||||
export UPPER_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/master
|
||||
export TOX_CONSTRAINTS_FILE=https://releases.openstack.org/constraints/upper/master
|
||||
else
|
||||
echo "Using $TEMPEST_VENV_UPPER_CONSTRAINTS constraints in Tempest virtual env."
|
||||
cat $TEMPEST_VENV_UPPER_CONSTRAINTS > $tmp_c
|
||||
@@ -127,6 +145,48 @@ function set_tempest_venv_constraints {
|
||||
fi
|
||||
}
|
||||
|
||||
# Makes a call to glance to get a list of active images, ignoring
|
||||
# ramdisk and kernel images. Takes 3 arguments, an array and two
|
||||
# variables. The array will contain the list of active image UUIDs;
|
||||
# if an image with ``DEFAULT_IMAGE_NAME`` is found, its UUID will be
|
||||
# set as the value of *both* other parameters.
|
||||
function get_active_images {
|
||||
declare -n img_array=$1
|
||||
declare -n img_id=$2
|
||||
declare -n img_id_alt=$3
|
||||
|
||||
# start with a fresh array in case we are called multiple times
|
||||
img_array=()
|
||||
|
||||
while read -r IMAGE_NAME IMAGE_UUID; do
|
||||
if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
|
||||
img_id="$IMAGE_UUID"
|
||||
img_id_alt="$IMAGE_UUID"
|
||||
fi
|
||||
img_array+=($IMAGE_UUID)
|
||||
done < <(openstack --os-cloud devstack-admin image list --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
|
||||
}
|
||||
|
||||
function poll_glance_images {
|
||||
declare -n image_array=$1
|
||||
declare -n image_id=$2
|
||||
declare -n image_id_alt=$3
|
||||
local -i poll_count
|
||||
|
||||
poll_count=$TEMPEST_GLANCE_IMPORT_POLL_LIMIT
|
||||
while (( poll_count-- > 0 )) ; do
|
||||
sleep $TEMPEST_GLANCE_IMPORT_POLL_INTERVAL
|
||||
get_active_images image_array image_id image_id_alt
|
||||
if (( ${#image_array[*]} >= $TEMPEST_GLANCE_IMAGE_COUNT )) ; then
|
||||
return
|
||||
fi
|
||||
done
|
||||
local msg
|
||||
msg="Polling limit of $TEMPEST_GLANCE_IMPORT_POLL_LIMIT exceeded; "
|
||||
msg+="poll interval was $TEMPEST_GLANCE_IMPORT_POLL_INTERVAL sec"
|
||||
warn $LINENO "$msg"
|
||||
}
|
||||
|
||||
# configure_tempest() - Set config files, create data dirs, etc
|
||||
function configure_tempest {
|
||||
if [[ "$INSTALL_TEMPEST" == "True" ]]; then
|
||||
@@ -168,13 +228,21 @@ function configure_tempest {
|
||||
declare -a images
|
||||
|
||||
if is_service_enabled glance; then
|
||||
while read -r IMAGE_NAME IMAGE_UUID; do
|
||||
if [ "$IMAGE_NAME" = "$DEFAULT_IMAGE_NAME" ]; then
|
||||
image_uuid="$IMAGE_UUID"
|
||||
image_uuid_alt="$IMAGE_UUID"
|
||||
get_active_images images image_uuid image_uuid_alt
|
||||
|
||||
if (( ${#images[*]} < $TEMPEST_GLANCE_IMAGE_COUNT )); then
|
||||
# Glance image import is asynchronous and may be configured
|
||||
# to do image conversion. If image import is being used,
|
||||
# it's possible that this code is being executed before the
|
||||
# import has completed and there may be no active images yet.
|
||||
if [[ "$GLANCE_USE_IMPORT_WORKFLOW" == "True" ]]; then
|
||||
poll_glance_images images image_uuid image_uuid_alt
|
||||
if (( ${#images[*]} < $TEMPEST_GLANCE_IMAGE_COUNT )); then
|
||||
echo "Only found ${#images[*]} image(s), was looking for $TEMPEST_GLANCE_IMAGE_COUNT"
|
||||
exit 1
|
||||
fi
|
||||
fi
|
||||
images+=($IMAGE_UUID)
|
||||
done < <(openstack --os-cloud devstack-admin image list --property status=active | awk -F'|' '!/^(+--)|ID|aki|ari/ { print $3,$2 }')
|
||||
fi
|
||||
|
||||
case "${#images[*]}" in
|
||||
0)
|
||||
@@ -394,7 +462,7 @@ function configure_tempest {
|
||||
# NOTE- To avoid microversion tests failure on stable branch, we need to change "tempest_compute_max_microversion"
|
||||
# for stable branch on each release which should be changed from "latest" to max supported version of that release.
|
||||
local tempest_compute_min_microversion=${TEMPEST_COMPUTE_MIN_MICROVERSION:-None}
|
||||
local tempest_compute_max_microversion=${TEMPEST_COMPUTE_MAX_MICROVERSION:-"latest"}
|
||||
local tempest_compute_max_microversion=${TEMPEST_COMPUTE_MAX_MICROVERSION:-"2.93"}
|
||||
# Reset microversions to None where v2.0 is running which does not support microversion.
|
||||
# Both "None" means no microversion testing.
|
||||
if [[ "$TEMPEST_COMPUTE_TYPE" == "compute_legacy" ]]; then
|
||||
@@ -487,7 +555,7 @@ function configure_tempest {
|
||||
fi
|
||||
iniset $TEMPEST_CONFIG volume-feature-enabled volume_revert $(trueorfalse False TEMPEST_VOLUME_REVERT_TO_SNAPSHOT)
|
||||
local tempest_volume_min_microversion=${TEMPEST_VOLUME_MIN_MICROVERSION:-None}
|
||||
local tempest_volume_max_microversion=${TEMPEST_VOLUME_MAX_MICROVERSION:-"latest"}
|
||||
local tempest_volume_max_microversion=${TEMPEST_VOLUME_MAX_MICROVERSION:-"3.70"}
|
||||
if [ "$tempest_volume_min_microversion" == "None" ]; then
|
||||
inicomment $TEMPEST_CONFIG volume min_microversion
|
||||
else
|
||||
@@ -536,13 +604,17 @@ function configure_tempest {
|
||||
iniset $TEMPEST_CONFIG volume storage_protocol "$TEMPEST_STORAGE_PROTOCOL"
|
||||
fi
|
||||
|
||||
if [[ $ENABLE_VOLUME_MULTIATTACH == "True" ]]; then
|
||||
iniset $TEMPEST_CONFIG volume volume_type_multiattach $VOLUME_TYPE_MULTIATTACH
|
||||
fi
|
||||
|
||||
# Placement Features
|
||||
# Set the microversion range for placement.
|
||||
# Setting [None, latest] range of microversion which allow Tempest to run all microversions tests.
|
||||
# NOTE- To avoid microversion tests failure on stable branch, we need to change "tempest_placement_max_microversion"
|
||||
# for stable branch on each release which should be changed from "latest" to max supported version of that release.
|
||||
local tempest_placement_min_microversion=${TEMPEST_PLACEMENT_MIN_MICROVERSION:-None}
|
||||
local tempest_placement_max_microversion=${TEMPEST_PLACEMENT_MAX_MICROVERSION:-"latest"}
|
||||
local tempest_placement_max_microversion=${TEMPEST_PLACEMENT_MAX_MICROVERSION:-"1.39"}
|
||||
if [ "$tempest_placement_min_microversion" == "None" ]; then
|
||||
inicomment $TEMPEST_CONFIG placement min_microversion
|
||||
else
|
||||
@@ -607,14 +679,19 @@ function configure_tempest {
|
||||
# If services enable the enforce_scope for their policy
|
||||
# we need to enable the same on Tempest side so that
|
||||
# test can be run with scoped token.
|
||||
if [[ "$KEYSTONE_ENFORCE_SCOPE" == True ]] ; then
|
||||
if [[ "$KEYSTONE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
|
||||
iniset $TEMPEST_CONFIG enforce_scope keystone true
|
||||
iniset $TEMPEST_CONFIG auth admin_system 'all'
|
||||
iniset $TEMPEST_CONFIG auth admin_project_name ''
|
||||
fi
|
||||
iniset $TEMPEST_CONFIG enforce_scope glance "$GLANCE_ENFORCE_SCOPE"
|
||||
|
||||
iniset $TEMPEST_CONFIG enforce_scope cinder "$CINDER_ENFORCE_SCOPE"
|
||||
if [[ "$GLANCE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
|
||||
iniset $TEMPEST_CONFIG enforce_scope glance true
|
||||
fi
|
||||
|
||||
if [[ "$CINDER_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
|
||||
iniset $TEMPEST_CONFIG enforce_scope cinder true
|
||||
fi
|
||||
|
||||
if [ "$VIRT_DRIVER" = "libvirt" ] && [ "$LIBVIRT_TYPE" = "lxc" ]; then
|
||||
# libvirt-lxc does not support boot from volume or attaching volumes
|
||||
@@ -629,13 +706,13 @@ function configure_tempest {
|
||||
local tmp_cfg_file
|
||||
tmp_cfg_file=$(mktemp)
|
||||
cd $TEMPEST_DIR
|
||||
if [[ "$OFFLINE" != "True" ]]; then
|
||||
tox -revenv-tempest --notest
|
||||
fi
|
||||
|
||||
local tmp_u_c_m
|
||||
tmp_u_c_m=$(mktemp -t tempest_u_c_m.XXXXXXXXXX)
|
||||
set_tempest_venv_constraints $tmp_u_c_m
|
||||
if [[ "$OFFLINE" != "True" ]]; then
|
||||
tox -revenv-tempest --notest
|
||||
fi
|
||||
tox -evenv-tempest -- pip install -c $tmp_u_c_m -r requirements.txt
|
||||
rm -f $tmp_u_c_m
|
||||
|
||||
@@ -672,7 +749,30 @@ function configure_tempest {
|
||||
DISABLE_NETWORK_API_EXTENSIONS+=", l3_agent_scheduler"
|
||||
fi
|
||||
|
||||
local network_api_extensions=${NETWORK_API_EXTENSIONS:-"all"}
|
||||
DEFAULT_NET_EXT="address-scope,agent,allowed-address-pairs,auto-allocated-topology"
|
||||
DEFAULT_NET_EXT+=",availability_zone,binding,default-subnetpools,dhcp_agent_scheduler"
|
||||
DEFAULT_NET_EXT+=",dvr,ext-gw-mode,external-net,extra_dhcp_opt,extraroute,flavors"
|
||||
DEFAULT_NET_EXT+=",l3-flavors,l3-ha,l3_agent_scheduler,multi-provider,net-mtu"
|
||||
DEFAULT_NET_EXT+=",network-ip-availability,network_availability_zone,pagination"
|
||||
DEFAULT_NET_EXT+=",port-security,project-id,provider,quotas,quota_details,rbac-policies"
|
||||
DEFAULT_NET_EXT+=",revision-if-match,router,router_availability_zone,security-group,service-type,sorting"
|
||||
DEFAULT_NET_EXT+=",standard-attr-description,standard-attr-revisions,standard-attr-tag,standard-attr-timestamp"
|
||||
DEFAULT_NET_EXT+=",subnet-service-types,subnet_allocation,net-mtu-writable,ip-substring-filtering"
|
||||
DEFAULT_NET_EXT+=",availability_zone_filter,filter-validation,empty-string-filtering,port-mac-address-regenerate"
|
||||
DEFAULT_NET_EXT+=",port-security-groups-filtering,fip-port-details,binding-extended"
|
||||
DEFAULT_NET_EXT+=",subnet_onboard,l3-port-ip-change-not-allowed,agent-resources-synced"
|
||||
DEFAULT_NET_EXT+=",floatingip-pools,rbac-security-groups,subnetpool-prefix-ops,router-admin-state-down-before-update"
|
||||
DEFAULT_NET_EXT+=",rbac-subnetpool,tag-ports-during-bulk-creation,stateful-security-group,address-group,extraroute-atomic"
|
||||
DEFAULT_NET_EXT+=",port-numa-affinity-policy,rbac-address-scope,security-groups-remote-address-group,trunk,trunk-details"
|
||||
DEFAULT_NET_EXT+=",rbac-address-group,port-device-profile"
|
||||
DEFAULT_NET_EXT+=",multiple-external-gateways,qos-pps-minimum,l3-ext-ndp-proxy,rbac-bgpvpn"
|
||||
DEFAULT_NET_EXT+=",qos-pps,ecmp_routes,bgp,floating-ip-port-forwarding-port-ranges"
|
||||
# New in Yoga
|
||||
DEFAULT_NET_EXT+=",security-groups-shared-filtering,security-groups-normalized-cidr,quota-check-limit"
|
||||
DEFAULT_NET_EXT+=",port-resource-request-groups"
|
||||
# New in Zed
|
||||
DEFAULT_NET_EXT+=",port-mac-override,floating-ip-port-forwarding-detail,network-cascade-delete"
|
||||
local network_api_extensions=${NETWORK_API_EXTENSIONS:-$DEFAULT_NET_EXT}
|
||||
if [[ ! -z "$DISABLE_NETWORK_API_EXTENSIONS" ]]; then
|
||||
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
||||
network_api_extensions=${NETWORK_API_EXTENSIONS:-$(iniget $tmp_cfg_file network-feature-enabled api_extensions | tr -d " ")}
|
||||
@@ -684,7 +784,10 @@ function configure_tempest {
|
||||
fi
|
||||
iniset $TEMPEST_CONFIG network-feature-enabled api_extensions $network_api_extensions
|
||||
# Swift API Extensions
|
||||
local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-"all"}
|
||||
DEFAULT_SWIFT_OPT="account_quotas,bulk_delete,bulk_upload,container_quotas"
|
||||
DEFAULT_SWIFT_OPT+=",container_sync,crossdomain,formpost,ratelimit,slo"
|
||||
DEFAULT_SWIFT_OPT+=",staticweb,tempauth,tempurl,versioned_writes"
|
||||
local object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$DEFAULT_SWIFT_OPT}
|
||||
if [[ ! -z "$DISABLE_OBJECT_STORAGE_API_EXTENSIONS" ]]; then
|
||||
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
||||
object_storage_api_extensions=${OBJECT_STORAGE_API_EXTENSIONS:-$(iniget $tmp_cfg_file object-storage-feature-enabled discoverable_apis | tr -d " ")}
|
||||
@@ -693,7 +796,18 @@ function configure_tempest {
|
||||
fi
|
||||
iniset $TEMPEST_CONFIG object-storage-feature-enabled discoverable_apis $object_storage_api_extensions
|
||||
# Cinder API Extensions
|
||||
local volume_api_extensions=${VOLUME_API_EXTENSIONS:-"all"}
|
||||
DEFAULT_VOL_EXT="OS-SCH-HNT,backups,capabilities,cgsnapshots,consistencygroups"
|
||||
DEFAULT_VOL_EXT+=",encryption,os-admin-actions,os-availability-zone"
|
||||
DEFAULT_VOL_EXT+=",os-extended-services,os-extended-snapshot-attributes"
|
||||
DEFAULT_VOL_EXT+=",os-hosts,os-quota-class-sets,os-quota-sets"
|
||||
DEFAULT_VOL_EXT+=",os-services,os-snapshot-actions,os-snapshot-manage"
|
||||
DEFAULT_VOL_EXT+=",os-snapshot-unmanage,os-types-extra-specs,os-types-manage"
|
||||
DEFAULT_VOL_EXT+=",os-used-limits,os-vol-host-attr,os-vol-image-meta"
|
||||
DEFAULT_VOL_EXT+=",os-vol-mig-status-attr,os-vol-tenant-attr,os-volume-actions"
|
||||
DEFAULT_VOL_EXT+=",os-volume-encryption-metadata,os-volume-manage"
|
||||
DEFAULT_VOL_EXT+=",os-volume-transfer,os-volume-type-access"
|
||||
DEFAULT_VOL_EXT+=",os-volume-unmanage,qos-specs,scheduler-stats"
|
||||
local volume_api_extensions=${VOLUME_API_EXTENSIONS:-$DEFAULT_VOL_EXT}
|
||||
if [[ ! -z "$DISABLE_VOLUME_API_EXTENSIONS" ]]; then
|
||||
# Enabled extensions are either the ones explicitly specified or those available on the API endpoint
|
||||
volume_api_extensions=${VOLUME_API_EXTENSIONS:-$(iniget $tmp_cfg_file volume-feature-enabled api_extensions | tr -d " ")}
|
||||
@@ -709,7 +823,12 @@ function configure_tempest {
|
||||
# install_tempest() - Collect source and prepare
|
||||
function install_tempest {
|
||||
git_clone $TEMPEST_REPO $TEMPEST_DIR $TEMPEST_BRANCH
|
||||
pip_install 'tox!=2.8.0'
|
||||
# NOTE(gmann): Pinning tox<4.0.0 for stable/zed and lower. Tox 4.0.0
|
||||
# released after zed was released and has some incompatible changes
|
||||
# and it is ok not to fix the issues caused by tox 4.0.0 in stable
|
||||
# beanches jobs. We can continue testing the stable/zed and lower
|
||||
# branches with tox<4.0.0
|
||||
pip_install 'tox!=2.8.0,<4.0.0'
|
||||
pushd $TEMPEST_DIR
|
||||
# NOTE(gmann): checkout the TEMPEST_BRANCH in case TEMPEST_BRANCH
|
||||
# is tag name not master. git_clone would not checkout tag because
|
||||
|
||||
@@ -557,7 +557,7 @@ $listen_string
|
||||
ErrorLog $APACHE_LOG_DIR/tls-proxy_error.log
|
||||
ErrorLogFormat "%{cu}t [%-m:%l] [pid %P:tid %T] %7F: %E: [client\ %a] [frontend\ %A] %M% ,\ referer\ %{Referer}i"
|
||||
LogLevel info
|
||||
CustomLog $APACHE_LOG_DIR/tls-proxy_access.log "%{%Y-%m-%d}t %{%T}t.%{msec_frac}t [%l] %a \"%r\" %>s %b"
|
||||
CustomLog $APACHE_LOG_DIR/tls-proxy_access.log combined
|
||||
</VirtualHost>
|
||||
EOF
|
||||
if is_suse ; then
|
||||
|
||||
@@ -17,9 +17,18 @@
|
||||
dest: "{{ stage_dir }}/verify_tempest_conf.log"
|
||||
state: hard
|
||||
when: tempest_log.stat.exists
|
||||
- name: Capture most recent qemu crash dump, if any
|
||||
shell:
|
||||
executable: /bin/bash
|
||||
cmd: |
|
||||
coredumpctl -o {{ devstack_log_dir }}/qemu.coredump dump /usr/bin/qemu-system-x86_64
|
||||
ignore_errors: yes
|
||||
roles:
|
||||
- export-devstack-journal
|
||||
- apache-logs-conf
|
||||
# This should run as early as possible to make sure we don't skew
|
||||
# the post-tempest results with other activities.
|
||||
- capture-performance-data
|
||||
- devstack-project-conf
|
||||
# capture-system-logs should be the last role before stage-output
|
||||
- capture-system-logs
|
||||
|
||||
@@ -5,4 +5,10 @@
|
||||
bindep_profile: test
|
||||
bindep_dir: "{{ zuul_work_dir }}"
|
||||
- test-setup
|
||||
- ensure-tox
|
||||
# NOTE(gmann): Pinning tox<4.0.0 for stable/zed and lower. Tox 4.0.0
|
||||
# released after zed was released and has some incompatible changes
|
||||
# and it is ok not to fix the issues caused by tox 4.0.0 in stable
|
||||
# beanches jobs. We can continue testing the stable/zed and lower
|
||||
# branches with tox<4.0.0
|
||||
- role: ensure-tox
|
||||
ensure_tox_version: "<4"
|
||||
|
||||
@@ -6,6 +6,12 @@
|
||||
bindep_profile: test
|
||||
bindep_dir: "{{ zuul_work_dir }}"
|
||||
- test-setup
|
||||
- ensure-tox
|
||||
# NOTE(gmann): Pinning tox<4.0.0 for stable/zed and lower. Tox 4.0.0
|
||||
# released after zed was released and has some incompatible changes
|
||||
# and it is ok not to fix the issues caused by tox 4.0.0 in stable
|
||||
# beanches jobs. We can continue testing the stable/zed and lower
|
||||
# branches with tox<4.0.0
|
||||
- role: ensure-tox
|
||||
ensure_tox_version: "<4"
|
||||
- get-devstack-os-environment
|
||||
- tox
|
||||
|
||||
@@ -64,7 +64,6 @@
|
||||
'Debian': '/etc/apache2/sites-enabled/'
|
||||
'Suse': '/etc/apache2/conf.d/'
|
||||
'RedHat': '/etc/httpd/conf.d/'
|
||||
'openEuler': '/etc/httpd/conf.d/'
|
||||
|
||||
- name: Discover configurations
|
||||
find:
|
||||
|
||||
@@ -0,0 +1,25 @@
|
||||
Generate performance logs for staging
|
||||
|
||||
Captures usage information from mysql, systemd, apache logs, and other
|
||||
parts of the system and generates a performance.json file in the
|
||||
staging directory.
|
||||
|
||||
**Role Variables**
|
||||
|
||||
.. zuul:rolevar:: stage_dir
|
||||
:default: {{ ansible_user_dir }}
|
||||
|
||||
The base stage directory
|
||||
|
||||
.. zuul:rolevar:: devstack_conf_dir
|
||||
:default: /opt/stack
|
||||
|
||||
The base devstack destination directory
|
||||
|
||||
.. zuul:rolevar:: debian_suse_apache_deref_logs
|
||||
|
||||
The apache logs found in the debian/suse locations
|
||||
|
||||
.. zuul:rolevar:: redhat_apache_deref_logs
|
||||
|
||||
The apache logs found in the redhat locations
|
||||
@@ -0,0 +1,3 @@
|
||||
devstack_base_dir: /opt/stack
|
||||
devstack_conf_dir: "{{ devstack_base_dir }}"
|
||||
stage_dir: "{{ ansible_user_dir }}"
|
||||
@@ -0,0 +1,16 @@
|
||||
- name: Generate statistics
|
||||
shell:
|
||||
executable: /bin/bash
|
||||
cmd: |
|
||||
source {{ devstack_conf_dir }}/stackrc
|
||||
python3 {{ devstack_conf_dir }}/tools/get-stats.py \
|
||||
--db-user="$DATABASE_USER" \
|
||||
--db-pass="$DATABASE_PASSWORD" \
|
||||
--db-host="$DATABASE_HOST" \
|
||||
{{ apache_logs }} > {{ stage_dir }}/performance.json
|
||||
vars:
|
||||
apache_logs: >-
|
||||
{% for i in debian_suse_apache_deref_logs.results | default([]) + redhat_apache_deref_logs.results | default([]) %}
|
||||
--apache-log="{{ i.stat.path }}"
|
||||
{% endfor %}
|
||||
ignore_errors: yes
|
||||
@@ -9,6 +9,7 @@ Stage a number of different logs / reports:
|
||||
- coredumps
|
||||
- dns resolver
|
||||
- listen53
|
||||
- services
|
||||
- unbound.log
|
||||
- deprecation messages
|
||||
|
||||
|
||||
@@ -19,6 +19,9 @@
|
||||
rpm -qa | sort > {{ stage_dir }}/rpm-qa.txt
|
||||
fi
|
||||
|
||||
# Services status
|
||||
sudo systemctl status --all > services.txt 2>/dev/null
|
||||
|
||||
# NOTE(kchamart) The 'audit.log' can be useful in cases when QEMU
|
||||
# failed to start due to denials from SELinux — useful for CentOS
|
||||
# and Fedora machines. For Ubuntu (which runs AppArmor), DevStack
|
||||
|
||||
@@ -1,10 +1,10 @@
|
||||
Verify the IPv6-only deployments
|
||||
Verify all addresses in IPv6-only deployments
|
||||
|
||||
This role needs to be invoked from a playbook that
|
||||
run tests. This role verifies the IPv6 setting on
|
||||
devstack side and devstack deploy services on IPv6.
|
||||
This role is invoked before tests are run so that
|
||||
if any missing IPv6 setting or deployments can fail
|
||||
runs tests. This role verifies the IPv6 settings on the
|
||||
devstack side and that devstack deploys with all addresses
|
||||
being IPv6. This role is invoked before tests are run so that
|
||||
if there is any missing IPv6 setting, deployments can fail
|
||||
the job early.
|
||||
|
||||
|
||||
|
||||
@@ -2,6 +2,7 @@
|
||||
# This uses hard links to avoid using extra space.
|
||||
command: "find {{ devstack_cache_dir }}/files -mindepth 1 -maxdepth 1 -exec cp -l {} {{ devstack_base_dir }}/devstack/files/ ;"
|
||||
become: true
|
||||
ignore_errors: yes
|
||||
|
||||
- name: Set ownership of cached files
|
||||
file:
|
||||
|
||||
+1
-1
@@ -49,7 +49,7 @@ SERVICE_PASSWORD=$ADMIN_PASSWORD
|
||||
# path of the destination log file. A timestamp will be appended to the given name.
|
||||
LOGFILE=$DEST/logs/stack.sh.log
|
||||
|
||||
# Old log files are automatically removed after 7 days to keep things neat. Change
|
||||
# Old log files are automatically removed after 2 days to keep things neat. Change
|
||||
# the number of days by setting ``LOGDAYS``.
|
||||
LOGDAYS=2
|
||||
|
||||
|
||||
@@ -1,12 +0,0 @@
|
||||
[metadata]
|
||||
name = DevStack
|
||||
summary = OpenStack DevStack
|
||||
description_file =
|
||||
README.rst
|
||||
author = OpenStack
|
||||
author_email = openstack-discuss@lists.openstack.org
|
||||
home_page = https://docs.openstack.org/devstack/latest
|
||||
classifier =
|
||||
Intended Audience :: Developers
|
||||
License :: OSI Approved :: Apache Software License
|
||||
Operating System :: POSIX :: Linux
|
||||
@@ -1,22 +0,0 @@
|
||||
#!/usr/bin/env python
|
||||
# Copyright (c) 2013 Hewlett-Packard Development Company, L.P.
|
||||
#
|
||||
# Licensed under the Apache License, Version 2.0 (the "License");
|
||||
# you may not use this file except in compliance with the License.
|
||||
# You may obtain a copy of the License at
|
||||
#
|
||||
# http://www.apache.org/licenses/LICENSE-2.0
|
||||
#
|
||||
# Unless required by applicable law or agreed to in writing, software
|
||||
# distributed under the License is distributed on an "AS IS" BASIS,
|
||||
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
|
||||
# implied.
|
||||
# See the License for the specific language governing permissions and
|
||||
# limitations under the License.
|
||||
|
||||
# THIS FILE IS MANAGED BY THE GLOBAL REQUIREMENTS REPO - DO NOT EDIT
|
||||
import setuptools
|
||||
|
||||
setuptools.setup(
|
||||
setup_requires=['pbr'],
|
||||
pbr=True)
|
||||
@@ -67,7 +67,9 @@ unset `env | grep -E '^OS_' | cut -d = -f 1`
|
||||
umask 022
|
||||
|
||||
# Not all distros have sbin in PATH for regular users.
|
||||
PATH=$PATH:/usr/local/sbin:/usr/sbin:/sbin
|
||||
# osc will normally be installed at /usr/local/bin/openstack so ensure
|
||||
# /usr/local/bin is also in the path
|
||||
PATH=$PATH:/usr/local/bin:/usr/local/sbin:/usr/sbin:/sbin
|
||||
|
||||
# Keep track of the DevStack directory
|
||||
TOP_DIR=$(cd $(dirname "$0") && pwd)
|
||||
@@ -227,7 +229,7 @@ write_devstack_version
|
||||
|
||||
# Warn users who aren't on an explicitly supported distro, but allow them to
|
||||
# override check and attempt installation with ``FORCE=yes ./stack``
|
||||
SUPPORTED_DISTROS="bullseye|focal|f35|opensuse-15.2|opensuse-tumbleweed|rhel8|rhel9|openEuler-20.03"
|
||||
SUPPORTED_DISTROS="bullseye|focal|jammy|f35|opensuse-15.2|opensuse-tumbleweed|rhel8|rhel9"
|
||||
|
||||
if [[ ! ${DISTRO} =~ $SUPPORTED_DISTROS ]]; then
|
||||
echo "WARNING: this script has not been tested on $DISTRO"
|
||||
@@ -278,13 +280,6 @@ chmod 0440 $TEMPFILE
|
||||
sudo chown root:root $TEMPFILE
|
||||
sudo mv $TEMPFILE /etc/sudoers.d/50_stack_sh
|
||||
|
||||
# TODO(wxy): Currently some base packages are not installed by default in
|
||||
# openEuler. Remove the code below once the packaged are installed by default
|
||||
# in the future.
|
||||
if [[ $DISTRO == "openEuler-20.03" ]]; then
|
||||
install_package hostname
|
||||
fi
|
||||
|
||||
# Configure Distro Repositories
|
||||
# -----------------------------
|
||||
|
||||
@@ -316,7 +311,22 @@ function _install_rdo {
|
||||
sudo dnf -y install https://rdoproject.org/repos/openstack-${rdo_release}/rdo-release-${rdo_release}.el8.rpm
|
||||
fi
|
||||
elif [[ $DISTRO == "rhel9" ]]; then
|
||||
sudo curl -L -o /etc/yum.repos.d/delorean-deps.repo http://trunk.rdoproject.org/centos9-master/delorean-deps.repo
|
||||
install_package wget
|
||||
# We need to download rdo-release package using wget as installing with dnf from repo.fedoraproject.org fails in
|
||||
# FIPS enabled systems after https://bugzilla.redhat.com/show_bug.cgi?id=2157951
|
||||
# Until we can pull rdo-release from a server which supports EMS, this workaround is doing wget, which does
|
||||
# not relies on openssl but on gnutls, and then install it locally using rpm
|
||||
TEMPRDODIR=$(mktemp -d)
|
||||
if [[ "$TARGET_BRANCH" == "master" ]]; then
|
||||
# rdo-release.el9.rpm points to latest RDO release, use that for master
|
||||
wget -P $TEMPRDODIR https://rdoproject.org/repos/rdo-release.el9.rpm
|
||||
else
|
||||
# For stable branches use corresponding release rpm
|
||||
rdo_release=$(echo $TARGET_BRANCH | sed "s|stable/||g")
|
||||
wget -P $TEMPRDODIR https://rdoproject.org/repos/openstack-${rdo_release}/rdo-release-${rdo_release}.el9.rpm
|
||||
fi
|
||||
sudo rpm -ivh $TEMPRDODIR/rdo-release*rpm
|
||||
rm -rf $TEMPRDODIR
|
||||
fi
|
||||
sudo dnf -y update
|
||||
}
|
||||
@@ -1157,7 +1167,8 @@ fi
|
||||
# ----
|
||||
|
||||
if is_service_enabled q-dhcp; then
|
||||
# Delete traces of nova networks from prior runs
|
||||
# TODO(frickler): These are remnants from n-net, check which parts are really
|
||||
# still needed for Neutron.
|
||||
# Do not kill any dnsmasq instance spawned by NetworkManager
|
||||
netman_pid=$(pidof NetworkManager || true)
|
||||
if [ -z "$netman_pid" ]; then
|
||||
@@ -1217,12 +1228,7 @@ if is_service_enabled nova; then
|
||||
echo_summary "Configuring Nova"
|
||||
init_nova
|
||||
|
||||
# Additional Nova configuration that is dependent on other services
|
||||
# TODO(stephenfin): Is it possible for neutron to *not* be enabled now? If
|
||||
# not, remove the if here
|
||||
if is_service_enabled neutron; then
|
||||
async_runfunc configure_neutron_nova
|
||||
fi
|
||||
async_runfunc configure_neutron_nova
|
||||
fi
|
||||
|
||||
|
||||
@@ -1510,6 +1516,19 @@ async_cleanup
|
||||
time_totals
|
||||
async_print_timing
|
||||
|
||||
if is_service_enabled mysql; then
|
||||
if [[ "$MYSQL_GATHER_PERFORMANCE" == "True" && "$MYSQL_HOST" ]]; then
|
||||
echo ""
|
||||
echo ""
|
||||
echo "Post-stack database query stats:"
|
||||
mysql -u $DATABASE_USER -p$DATABASE_PASSWORD -h $MYSQL_HOST stats -e \
|
||||
'SELECT * FROM queries' -t 2>/dev/null
|
||||
mysql -u $DATABASE_USER -p$DATABASE_PASSWORD -h $MYSQL_HOST stats -e \
|
||||
'DELETE FROM queries' 2>/dev/null
|
||||
fi
|
||||
fi
|
||||
|
||||
|
||||
# Using the cloud
|
||||
# ===============
|
||||
|
||||
|
||||
@@ -15,7 +15,7 @@ source $RC_DIR/functions
|
||||
|
||||
# Set the target branch. This is used so that stable branching
|
||||
# does not need to update each repo below.
|
||||
TARGET_BRANCH=master
|
||||
TARGET_BRANCH=stable/zed
|
||||
|
||||
# Cycle trailing projects need to branch later than the others.
|
||||
TRAILING_TARGET_BRANCH=master
|
||||
@@ -179,6 +179,10 @@ fi
|
||||
# TODO(frickler): Drop this when plugins no longer need it
|
||||
IDENTITY_API_VERSION=3
|
||||
|
||||
# Global option for enforcing scope. If enabled, ENFORCE_SCOPE overrides
|
||||
# each services ${SERVICE}_ENFORCE_SCOPE variables
|
||||
ENFORCE_SCOPE=$(trueorfalse False ENFORCE_SCOPE)
|
||||
|
||||
# Enable use of Python virtual environments. Individual project use of
|
||||
# venvs are controlled by the PROJECT_VENV array; every project with
|
||||
# an entry in the array will be installed into the named venv.
|
||||
@@ -193,6 +197,15 @@ ADDITIONAL_VENV_PACKAGES=${ADITIONAL_VENV_PACKAGES:-""}
|
||||
# (currently only implemented for MySQL backend)
|
||||
DATABASE_QUERY_LOGGING=$(trueorfalse False DATABASE_QUERY_LOGGING)
|
||||
|
||||
# This can be used to turn on various non-default items in the
|
||||
# performance_schema that are of interest to us
|
||||
MYSQL_GATHER_PERFORMANCE=$(trueorfalse True MYSQL_GATHER_PERFORMANCE)
|
||||
|
||||
# This can be used to reduce the amount of memory mysqld uses while running.
|
||||
# These are unscientifically determined, and could reduce performance or
|
||||
# cause other issues.
|
||||
MYSQL_REDUCE_MEMORY=$(trueorfalse False MYSQL_REDUCE_MEMORY)
|
||||
|
||||
# Set a timeout for git operations. If git is still running when the
|
||||
# timeout expires, the command will be retried up to 3 times. This is
|
||||
# in the format for timeout(1);
|
||||
@@ -235,7 +248,7 @@ REQUIREMENTS_DIR=${REQUIREMENTS_DIR:-$DEST/requirements}
|
||||
# Setting the variable to 'ALL' will activate the download for all
|
||||
# libraries.
|
||||
|
||||
DEVSTACK_SERIES="yoga"
|
||||
DEVSTACK_SERIES="zed"
|
||||
|
||||
##############
|
||||
#
|
||||
@@ -869,7 +882,31 @@ SERVICE_HOST=${SERVICE_HOST:-${DEF_SERVICE_HOST}}
|
||||
# This is either 127.0.0.1 for IPv4 or ::1 for IPv6
|
||||
SERVICE_LOCAL_HOST=${SERVICE_LOCAL_HOST:-${DEF_SERVICE_LOCAL_HOST}}
|
||||
|
||||
REGION_NAME=${REGION_NAME:-RegionOne}
|
||||
# TUNNEL IP version
|
||||
# This is the IP version to use for tunnel endpoints
|
||||
TUNNEL_IP_VERSION=${TUNNEL_IP_VERSION:-4}
|
||||
|
||||
# Validate TUNNEL_IP_VERSION
|
||||
if [[ $TUNNEL_IP_VERSION != "4" ]] && [[ $TUNNEL_IP_VERSION != "6" ]]; then
|
||||
die $LINENO "TUNNEL_IP_VERSION must be either 4 or 6"
|
||||
fi
|
||||
|
||||
if [[ "$TUNNEL_IP_VERSION" == 4 ]]; then
|
||||
DEF_TUNNEL_ENDPOINT_IP=$HOST_IP
|
||||
fi
|
||||
|
||||
if [[ "$TUNNEL_IP_VERSION" == 6 ]]; then
|
||||
# Only die if the user has not over-ridden the endpoint IP
|
||||
if [[ "$HOST_IPV6" == "" ]] && [[ "$TUNNEL_ENDPOINT_IP" == "" ]]; then
|
||||
die $LINENO "Could not determine host IPv6 address. See local.conf for suggestions on setting HOST_IPV6."
|
||||
fi
|
||||
|
||||
DEF_TUNNEL_ENDPOINT_IP=$HOST_IPV6
|
||||
fi
|
||||
|
||||
# Allow the use of an alternate address for tunnel endpoints.
|
||||
# Default is dependent on TUNNEL_IP_VERSION above.
|
||||
TUNNEL_ENDPOINT_IP=${TUNNEL_ENDPOINT_IP:-${DEF_TUNNEL_ENDPOINT_IP}}
|
||||
|
||||
# Configure services to use syslog instead of writing to individual log files
|
||||
SYSLOG=$(trueorfalse False SYSLOG)
|
||||
|
||||
@@ -44,6 +44,9 @@ empty =
|
||||
multi = foo1
|
||||
multi = foo2
|
||||
|
||||
[fff]
|
||||
ampersand =
|
||||
|
||||
[key_with_spaces]
|
||||
rgw special key = something
|
||||
|
||||
@@ -85,7 +88,7 @@ fi
|
||||
|
||||
# test iniget_sections
|
||||
VAL=$(iniget_sections "${TEST_INI}")
|
||||
assert_equal "$VAL" "default aaa bbb ccc ddd eee key_with_spaces \
|
||||
assert_equal "$VAL" "default aaa bbb ccc ddd eee fff key_with_spaces \
|
||||
del_separate_options del_same_option del_missing_option \
|
||||
del_missing_option_multi del_no_options"
|
||||
|
||||
@@ -124,6 +127,13 @@ iniset ${SUDO_ARG} ${TEST_INI} bbb handlers "33,44"
|
||||
VAL=$(iniget ${TEST_INI} bbb handlers)
|
||||
assert_equal "$VAL" "33,44" "inset at EOF"
|
||||
|
||||
# Test with ampersand in values
|
||||
for i in `seq 3`; do
|
||||
iniset ${TEST_INI} fff ampersand '&y'
|
||||
done
|
||||
VAL=$(iniget ${TEST_INI} fff ampersand)
|
||||
assert_equal "$VAL" "&y" "iniset ampersands in option"
|
||||
|
||||
# test empty option
|
||||
if ini_has_option ${SUDO_ARG} ${TEST_INI} ddd empty; then
|
||||
passed "ini_has_option: ddd.empty present"
|
||||
|
||||
@@ -96,19 +96,7 @@ function test_libs_exist {
|
||||
echo "test_libs_exist PASSED"
|
||||
}
|
||||
|
||||
function test_branch_master {
|
||||
for lib in $ALL_LIBS; do
|
||||
if [[ ${GITBRANCH[$lib]} != "master" ]]; then
|
||||
echo "GITBRANCH for $lib not master (${GITBRANCH[$lib]})"
|
||||
exit 1
|
||||
fi
|
||||
done
|
||||
|
||||
echo "test_branch_master PASSED"
|
||||
}
|
||||
|
||||
set -o errexit
|
||||
|
||||
test_libs_exist
|
||||
test_branch_master
|
||||
test_all_libs_upto_date
|
||||
|
||||
@@ -44,6 +44,15 @@ fi
|
||||
if ! getent passwd $STACK_USER >/dev/null; then
|
||||
echo "Creating a user called $STACK_USER"
|
||||
useradd -g $STACK_USER -s /bin/bash -d $DEST -m $STACK_USER
|
||||
# RHEL based distros create home dir with 700 permissions,
|
||||
# And Ubuntu 21.04+ with 750, i.e missing executable
|
||||
# permission for either group or others
|
||||
# Devstack deploy will have issues with this, fix it by
|
||||
# adding executable permission
|
||||
if [[ $(stat -c '%A' $DEST|grep -o x|wc -l) -lt 3 ]]; then
|
||||
echo "Executable permission missing for $DEST, adding it"
|
||||
chmod +x $DEST
|
||||
fi
|
||||
fi
|
||||
|
||||
echo "Giving stack user passwordless sudo privileges"
|
||||
|
||||
@@ -0,0 +1,120 @@
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import threading
|
||||
import time
|
||||
import queue
|
||||
|
||||
import sqlalchemy
|
||||
from sqlalchemy.engine import CreateEnginePlugin
|
||||
from sqlalchemy import event
|
||||
|
||||
# https://docs.sqlalchemy.org/en/14/core/connections.html?
|
||||
# highlight=createengineplugin#sqlalchemy.engine.CreateEnginePlugin
|
||||
|
||||
LOG = logging.getLogger(__name__)
|
||||
|
||||
# The theory of operation here is that we register this plugin with
|
||||
# sqlalchemy via an entry_point. It gets loaded by virtue of plugin=
|
||||
# being in the database connection URL, which gives us an opportunity
|
||||
# to hook the engines that get created.
|
||||
#
|
||||
# We opportunistically spawn a thread, which we feed "hits" to over a
|
||||
# queue, and which occasionally writes those hits to a special
|
||||
# database called 'stats'. We access that database with the same user,
|
||||
# pass, and host as the main connection URL for simplicity.
|
||||
|
||||
|
||||
class LogCursorEventsPlugin(CreateEnginePlugin):
|
||||
def __init__(self, url, kwargs):
|
||||
self.db_name = url.database
|
||||
LOG.info('Registered counter for database %s' % self.db_name)
|
||||
new_url = sqlalchemy.engine.URL.create(url.drivername,
|
||||
url.username,
|
||||
url.password,
|
||||
url.host,
|
||||
url.port,
|
||||
'stats')
|
||||
|
||||
self.engine = sqlalchemy.create_engine(new_url)
|
||||
self.queue = queue.Queue()
|
||||
self.thread = None
|
||||
|
||||
def engine_created(self, engine):
|
||||
"""Hook the engine creation process.
|
||||
|
||||
This is the plug point for the sqlalchemy plugin. Using
|
||||
plugin=$this in the URL causes this method to be called when
|
||||
the engine is created, giving us a chance to hook it below.
|
||||
"""
|
||||
event.listen(engine, "before_cursor_execute", self._log_event)
|
||||
|
||||
def ensure_writer_thread(self):
|
||||
self.thread = threading.Thread(target=self.stat_writer, daemon=True)
|
||||
self.thread.start()
|
||||
|
||||
def _log_event(self, conn, cursor, statement, parameters, context,
|
||||
executemany):
|
||||
"""Queue a "hit" for this operation to be recorded.
|
||||
|
||||
Attepts to determine the operation by the first word of the
|
||||
statement, or 'OTHER' if it cannot be determined.
|
||||
"""
|
||||
|
||||
# Start our thread if not running. If we were forked after the
|
||||
# engine was created and this plugin was associated, our
|
||||
# writer thread is gone, so respawn.
|
||||
if not self.thread or not self.thread.is_alive():
|
||||
self.ensure_writer_thread()
|
||||
|
||||
try:
|
||||
op = statement.strip().split(' ', 1)[0] or 'OTHER'
|
||||
except Exception:
|
||||
op = 'OTHER'
|
||||
|
||||
self.queue.put((self.db_name, op))
|
||||
|
||||
def do_incr(self, db, op, count):
|
||||
"""Increment the counter for (db,op) by count."""
|
||||
|
||||
query = ('INSERT INTO queries (db, op, count) '
|
||||
' VALUES (%s, %s, %s) '
|
||||
' ON DUPLICATE KEY UPDATE count=count+%s')
|
||||
try:
|
||||
with self.engine.begin() as conn:
|
||||
r = conn.execute(query, (db, op, count, count))
|
||||
except Exception as e:
|
||||
LOG.error('Failed to account for access to database %r: %s',
|
||||
db, e)
|
||||
|
||||
def stat_writer(self):
|
||||
"""Consume messages from the queue and write them in batches.
|
||||
|
||||
This reads "hists" from from a queue fed by _log_event() and
|
||||
writes (db,op)+=count stats to the database after ten seconds
|
||||
of no activity to avoid triggering a write for every SELECT
|
||||
call. Write no less often than every thirty seconds and/or 100
|
||||
pending hits to avoid being starved by constant activity.
|
||||
"""
|
||||
LOG.debug('[%i] Writer thread running' % os.getpid())
|
||||
while True:
|
||||
to_write = {}
|
||||
total = 0
|
||||
last = time.time()
|
||||
while time.time() - last < 30 and total < 100:
|
||||
try:
|
||||
item = self.queue.get(timeout=10)
|
||||
to_write.setdefault(item, 0)
|
||||
to_write[item] += 1
|
||||
total += 1
|
||||
except queue.Empty:
|
||||
break
|
||||
|
||||
if to_write:
|
||||
LOG.debug('[%i] Writing DB stats %s' % (
|
||||
os.getpid(),
|
||||
','.join(['%s:%s=%i' % (db, op, count)
|
||||
for (db, op), count in to_write.items()])))
|
||||
|
||||
for (db, op), count in to_write.items():
|
||||
self.do_incr(db, op, count)
|
||||
@@ -0,0 +1,3 @@
|
||||
[build-system]
|
||||
requires = ["sqlalchemy", "setuptools>=42"]
|
||||
build-backend = "setuptools.build_meta"
|
||||
@@ -0,0 +1,14 @@
|
||||
[metadata]
|
||||
name = dbcounter
|
||||
author = Dan Smith
|
||||
author_email = dms@danplanet.com
|
||||
version = 0.1
|
||||
description = A teeny tiny dbcounter plugin for use with devstack
|
||||
url = http://github.com/openstack/devstack
|
||||
license = Apache
|
||||
|
||||
[options]
|
||||
py_modules = dbcounter
|
||||
entry_points =
|
||||
[sqlalchemy.plugins]
|
||||
dbcounter = dbcounter:LogCursorEventsPlugin
|
||||
@@ -153,32 +153,8 @@ function fixup_ubuntu {
|
||||
sudo rm -rf /usr/lib/python3/dist-packages/simplejson-*.egg-info
|
||||
}
|
||||
|
||||
function fixup_openeuler {
|
||||
if ! is_openeuler; then
|
||||
return
|
||||
fi
|
||||
|
||||
if is_arch "x86_64"; then
|
||||
arch="x86_64"
|
||||
elif is_arch "aarch64"; then
|
||||
arch="aarch64"
|
||||
fi
|
||||
|
||||
# Some packages' version in openEuler are too old, use the newer ones we
|
||||
# provide in oepkg. (oepkg is an openEuler third part yum repo which is
|
||||
# endorsed by openEuler community)
|
||||
(echo '[openstack-ci]'
|
||||
echo 'name=openstack'
|
||||
echo 'baseurl=https://repo.oepkgs.net/openEuler/rpm/openEuler-20.03-LTS-SP2/budding-openeuler/openstack-master-ci/'$arch'/'
|
||||
echo 'enabled=1'
|
||||
echo 'gpgcheck=0') | sudo tee -a /etc/yum.repos.d/openstack-master.repo > /dev/null
|
||||
|
||||
yum_install liberasurecode-devel
|
||||
}
|
||||
|
||||
function fixup_all {
|
||||
fixup_ubuntu
|
||||
fixup_fedora
|
||||
fixup_suse
|
||||
fixup_openeuler
|
||||
}
|
||||
|
||||
Executable
+220
@@ -0,0 +1,220 @@
|
||||
#!/usr/bin/python3
|
||||
|
||||
import argparse
|
||||
import csv
|
||||
import datetime
|
||||
import glob
|
||||
import itertools
|
||||
import json
|
||||
import logging
|
||||
import os
|
||||
import re
|
||||
import socket
|
||||
import subprocess
|
||||
import sys
|
||||
|
||||
try:
|
||||
import psutil
|
||||
except ImportError:
|
||||
psutil = None
|
||||
print('No psutil, process information will not be included',
|
||||
file=sys.stderr)
|
||||
|
||||
try:
|
||||
import pymysql
|
||||
except ImportError:
|
||||
pymysql = None
|
||||
print('No pymysql, database information will not be included',
|
||||
file=sys.stderr)
|
||||
|
||||
LOG = logging.getLogger('perf')
|
||||
|
||||
# https://www.elastic.co/blog/found-crash-elasticsearch#mapping-explosion
|
||||
|
||||
|
||||
def tryint(value):
|
||||
try:
|
||||
return int(value)
|
||||
except (ValueError, TypeError):
|
||||
return value
|
||||
|
||||
|
||||
def get_service_stats(service):
|
||||
stats = {'MemoryCurrent': 0}
|
||||
output = subprocess.check_output(['/usr/bin/systemctl', 'show', service] +
|
||||
['-p%s' % stat for stat in stats])
|
||||
for line in output.decode().split('\n'):
|
||||
if not line:
|
||||
continue
|
||||
stat, val = line.split('=')
|
||||
stats[stat] = tryint(val)
|
||||
|
||||
return stats
|
||||
|
||||
|
||||
def get_services_stats():
|
||||
services = [os.path.basename(s) for s in
|
||||
glob.glob('/etc/systemd/system/devstack@*.service')] + \
|
||||
['apache2.service']
|
||||
return [dict(service=service, **get_service_stats(service))
|
||||
for service in services]
|
||||
|
||||
|
||||
def get_process_stats(proc):
|
||||
cmdline = proc.cmdline()
|
||||
if 'python' in cmdline[0]:
|
||||
cmdline = cmdline[1:]
|
||||
return {'cmd': cmdline[0],
|
||||
'pid': proc.pid,
|
||||
'args': ' '.join(cmdline[1:]),
|
||||
'rss': proc.memory_info().rss}
|
||||
|
||||
|
||||
def get_processes_stats(matches):
|
||||
me = os.getpid()
|
||||
procs = psutil.process_iter()
|
||||
|
||||
def proc_matches(proc):
|
||||
return me != proc.pid and any(
|
||||
re.search(match, ' '.join(proc.cmdline()))
|
||||
for match in matches)
|
||||
|
||||
return [
|
||||
get_process_stats(proc)
|
||||
for proc in procs
|
||||
if proc_matches(proc)]
|
||||
|
||||
|
||||
def get_db_stats(host, user, passwd):
|
||||
dbs = []
|
||||
try:
|
||||
db = pymysql.connect(host=host, user=user, password=passwd,
|
||||
database='stats',
|
||||
cursorclass=pymysql.cursors.DictCursor)
|
||||
except pymysql.err.OperationalError as e:
|
||||
if 'Unknown database' in str(e):
|
||||
print('No stats database; assuming devstack failed',
|
||||
file=sys.stderr)
|
||||
return []
|
||||
raise
|
||||
|
||||
with db:
|
||||
with db.cursor() as cur:
|
||||
cur.execute('SELECT db,op,count FROM queries')
|
||||
for row in cur:
|
||||
dbs.append({k: tryint(v) for k, v in row.items()})
|
||||
return dbs
|
||||
|
||||
|
||||
def get_http_stats_for_log(logfile):
|
||||
stats = {}
|
||||
apache_fields = ('host', 'a', 'b', 'date', 'tz', 'request', 'status',
|
||||
'length', 'c', 'agent')
|
||||
ignore_agents = ('curl', 'uwsgi', 'nova-status')
|
||||
ignored_services = set()
|
||||
for line in csv.reader(open(logfile), delimiter=' '):
|
||||
fields = dict(zip(apache_fields, line))
|
||||
if len(fields) != len(apache_fields):
|
||||
# Not a combined access log, so we can bail completely
|
||||
return []
|
||||
try:
|
||||
method, url, http = fields['request'].split(' ')
|
||||
except ValueError:
|
||||
method = url = http = ''
|
||||
if 'HTTP' not in http:
|
||||
# Not a combined access log, so we can bail completely
|
||||
return []
|
||||
|
||||
# Tempest's User-Agent is unchanged, but client libraries and
|
||||
# inter-service API calls use proper strings. So assume
|
||||
# 'python-urllib' is tempest so we can tell it apart.
|
||||
if 'python-urllib' in fields['agent'].lower():
|
||||
agent = 'tempest'
|
||||
else:
|
||||
agent = fields['agent'].split(' ')[0]
|
||||
if agent.startswith('python-'):
|
||||
agent = agent.replace('python-', '')
|
||||
if '/' in agent:
|
||||
agent = agent.split('/')[0]
|
||||
|
||||
if agent in ignore_agents:
|
||||
continue
|
||||
|
||||
try:
|
||||
service, rest = url.strip('/').split('/', 1)
|
||||
except ValueError:
|
||||
# Root calls like "GET /identity"
|
||||
service = url.strip('/')
|
||||
rest = ''
|
||||
|
||||
if not service.isalpha():
|
||||
ignored_services.add(service)
|
||||
continue
|
||||
|
||||
method_key = '%s-%s' % (agent, method)
|
||||
try:
|
||||
length = int(fields['length'])
|
||||
except ValueError:
|
||||
LOG.warning('[%s] Failed to parse length %r from line %r' % (
|
||||
logfile, fields['length'], line))
|
||||
length = 0
|
||||
stats.setdefault(service, {'largest': 0})
|
||||
stats[service].setdefault(method_key, 0)
|
||||
stats[service][method_key] += 1
|
||||
stats[service]['largest'] = max(stats[service]['largest'],
|
||||
length)
|
||||
|
||||
if ignored_services:
|
||||
LOG.warning('Ignored services: %s' % ','.join(
|
||||
sorted(ignored_services)))
|
||||
|
||||
# Flatten this for ES
|
||||
return [{'service': service, 'log': os.path.basename(logfile),
|
||||
**vals}
|
||||
for service, vals in stats.items()]
|
||||
|
||||
|
||||
def get_http_stats(logfiles):
|
||||
return list(itertools.chain.from_iterable(get_http_stats_for_log(log)
|
||||
for log in logfiles))
|
||||
|
||||
|
||||
def get_report_info():
|
||||
return {
|
||||
'timestamp': datetime.datetime.now().isoformat(),
|
||||
'hostname': socket.gethostname(),
|
||||
'version': 2,
|
||||
}
|
||||
|
||||
|
||||
if __name__ == '__main__':
|
||||
process_defaults = ['privsep', 'mysqld', 'erlang', 'etcd']
|
||||
parser = argparse.ArgumentParser()
|
||||
parser.add_argument('--db-user', default='root',
|
||||
help=('MySQL user for collecting stats '
|
||||
'(default: "root")'))
|
||||
parser.add_argument('--db-pass', default=None,
|
||||
help='MySQL password for db-user')
|
||||
parser.add_argument('--db-host', default='localhost',
|
||||
help='MySQL hostname')
|
||||
parser.add_argument('--apache-log', action='append', default=[],
|
||||
help='Collect API call stats from this apache log')
|
||||
parser.add_argument('--process', action='append',
|
||||
default=process_defaults,
|
||||
help=('Include process stats for this cmdline regex '
|
||||
'(default is %s)' % ','.join(process_defaults)))
|
||||
args = parser.parse_args()
|
||||
|
||||
logging.basicConfig(level=logging.WARNING)
|
||||
|
||||
data = {
|
||||
'services': get_services_stats(),
|
||||
'db': pymysql and args.db_pass and get_db_stats(args.db_host,
|
||||
args.db_user,
|
||||
args.db_pass) or [],
|
||||
'processes': psutil and get_processes_stats(args.process) or [],
|
||||
'api': get_http_stats(args.apache_log),
|
||||
'report': get_report_info(),
|
||||
}
|
||||
|
||||
print(json.dumps(data, indent=2))
|
||||
@@ -139,15 +139,18 @@ if is_fedora && [[ ${DISTRO} == f* || ${DISTRO} == rhel9 ]]; then
|
||||
# recent enough anyway. This is included via rpms/general
|
||||
: # Simply fall through
|
||||
elif is_ubuntu; then
|
||||
: # pip on Ubuntu 20.04 is new enough, too
|
||||
# pip on Ubuntu 20.04 is new enough, too
|
||||
# drop setuptools from u-c
|
||||
sed -i -e '/setuptools/d' $REQUIREMENTS_DIR/upper-constraints.txt
|
||||
else
|
||||
install_get_pip
|
||||
|
||||
# Note setuptools is part of requirements.txt and we want to make sure
|
||||
# we obey any versioning as described there.
|
||||
pip_install_gr setuptools
|
||||
fi
|
||||
|
||||
set -x
|
||||
|
||||
# Note setuptools is part of requirements.txt and we want to make sure
|
||||
# we obey any versioning as described there.
|
||||
pip_install_gr setuptools
|
||||
|
||||
get_versions
|
||||
|
||||
@@ -23,32 +23,43 @@ function verify_devstack_ipv6_setting {
|
||||
_service_listen_address=$(echo $SERVICE_LISTEN_ADDRESS | tr -d [])
|
||||
local _service_local_host=''
|
||||
_service_local_host=$(echo $SERVICE_LOCAL_HOST | tr -d [])
|
||||
local _tunnel_endpoint_ip=''
|
||||
_tunnel_endpoint_ip=$(echo $TUNNEL_ENDPOINT_IP | tr -d [])
|
||||
if [[ "$SERVICE_IP_VERSION" != 6 ]]; then
|
||||
echo $SERVICE_IP_VERSION "SERVICE_IP_VERSION is not set to 6 which is must for devstack to deploy services with IPv6 address."
|
||||
exit 1
|
||||
fi
|
||||
if [[ "$TUNNEL_IP_VERSION" != 6 ]]; then
|
||||
echo $TUNNEL_IP_VERSION "TUNNEL_IP_VERSION is not set to 6 so TUNNEL_ENDPOINT_IP cannot be an IPv6 address."
|
||||
exit 1
|
||||
fi
|
||||
is_service_host_ipv6=$(python3 -c 'import oslo_utils.netutils as nutils; print(nutils.is_valid_ipv6("'$_service_host'"))')
|
||||
if [[ "$is_service_host_ipv6" != "True" ]]; then
|
||||
echo $SERVICE_HOST "SERVICE_HOST is not ipv6 which means devstack cannot deploy services on IPv6 address."
|
||||
echo $SERVICE_HOST "SERVICE_HOST is not IPv6 which means devstack cannot deploy services on IPv6 addresses."
|
||||
exit 1
|
||||
fi
|
||||
is_host_ipv6=$(python3 -c 'import oslo_utils.netutils as nutils; print(nutils.is_valid_ipv6("'$_host_ipv6'"))')
|
||||
if [[ "$is_host_ipv6" != "True" ]]; then
|
||||
echo $HOST_IPV6 "HOST_IPV6 is not ipv6 which means devstack cannot deploy services on IPv6 address."
|
||||
echo $HOST_IPV6 "HOST_IPV6 is not IPv6 which means devstack cannot deploy services on IPv6 addresses."
|
||||
exit 1
|
||||
fi
|
||||
is_service_listen_address=$(python3 -c 'import oslo_utils.netutils as nutils; print(nutils.is_valid_ipv6("'$_service_listen_address'"))')
|
||||
if [[ "$is_service_listen_address" != "True" ]]; then
|
||||
echo $SERVICE_LISTEN_ADDRESS "SERVICE_LISTEN_ADDRESS is not ipv6 which means devstack cannot deploy services on IPv6 address."
|
||||
echo $SERVICE_LISTEN_ADDRESS "SERVICE_LISTEN_ADDRESS is not IPv6 which means devstack cannot deploy services on IPv6 addresses."
|
||||
exit 1
|
||||
fi
|
||||
is_service_local_host=$(python3 -c 'import oslo_utils.netutils as nutils; print(nutils.is_valid_ipv6("'$_service_local_host'"))')
|
||||
if [[ "$is_service_local_host" != "True" ]]; then
|
||||
echo $SERVICE_LOCAL_HOST "SERVICE_LOCAL_HOST is not ipv6 which means devstack cannot deploy services on IPv6 address."
|
||||
echo $SERVICE_LOCAL_HOST "SERVICE_LOCAL_HOST is not IPv6 which means devstack cannot deploy services on IPv6 addresses."
|
||||
exit 1
|
||||
fi
|
||||
is_tunnel_endpoint_ip=$(python3 -c 'import oslo_utils.netutils as nutils; print(nutils.is_valid_ipv6("'$_tunnel_endpoint_ip'"))')
|
||||
if [[ "$is_tunnel_endpoint_ip" != "True" ]]; then
|
||||
echo $TUNNEL_ENDPOINT_IP "TUNNEL_ENDPOINT_IP is not IPv6 which means devstack will not deploy with an IPv6 endpoint address."
|
||||
exit 1
|
||||
fi
|
||||
echo "Devstack is properly configured with IPv6"
|
||||
echo "SERVICE_IP_VERSION: " $SERVICE_IP_VERSION "HOST_IPV6: " $HOST_IPV6 "SERVICE_HOST: " $SERVICE_HOST "SERVICE_LISTEN_ADDRESS: " $SERVICE_LISTEN_ADDRESS "SERVICE_LOCAL_HOST: " $SERVICE_LOCAL_HOST
|
||||
echo "SERVICE_IP_VERSION:" $SERVICE_IP_VERSION "HOST_IPV6:" $HOST_IPV6 "SERVICE_HOST:" $SERVICE_HOST "SERVICE_LISTEN_ADDRESS:" $SERVICE_LISTEN_ADDRESS "SERVICE_LOCAL_HOST:" $SERVICE_LOCAL_HOST "TUNNEL_IP_VERSION:" $TUNNEL_IP_VERSION "TUNNEL_ENDPOINT_IP:" $TUNNEL_ENDPOINT_IP
|
||||
}
|
||||
|
||||
function sanity_check_system_ipv6_enabled {
|
||||
@@ -72,7 +83,7 @@ function verify_service_listen_address_is_ipv6 {
|
||||
is_endpoint_ipv6=$(python3 -c 'import oslo_utils.netutils as nutils; print(nutils.is_valid_ipv6("'$endpoint_address'"))')
|
||||
if [[ "$is_endpoint_ipv6" != "True" ]]; then
|
||||
all_ipv6=False
|
||||
echo $endpoint ": This is not ipv6 endpoint which means corresponding service is not listening on IPv6 address."
|
||||
echo $endpoint ": This is not an IPv6 endpoint which means corresponding service is not listening on an IPv6 address."
|
||||
continue
|
||||
fi
|
||||
endpoints_verified=True
|
||||
@@ -80,7 +91,7 @@ function verify_service_listen_address_is_ipv6 {
|
||||
if [[ "$all_ipv6" == "False" ]] || [[ "$endpoints_verified" == "False" ]]; then
|
||||
exit 1
|
||||
fi
|
||||
echo "All services deployed by devstack is on IPv6 endpoints"
|
||||
echo "All services deployed by devstack are on IPv6 endpoints"
|
||||
echo $endpoints
|
||||
}
|
||||
|
||||
|
||||
@@ -35,7 +35,7 @@ commands = bash -c "find {toxinidir} \
|
||||
|
||||
[testenv:docs]
|
||||
deps =
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/master}
|
||||
-c{env:TOX_CONSTRAINTS_FILE:https://releases.openstack.org/constraints/upper/zed}
|
||||
-r{toxinidir}/doc/requirements.txt
|
||||
allowlist_externals = bash
|
||||
setenv =
|
||||
|
||||
@@ -181,3 +181,8 @@ fi
|
||||
|
||||
clean_pyc_files
|
||||
rm -Rf $DEST/async
|
||||
|
||||
# Clean any safe.directory items we wrote into the global
|
||||
# gitconfig. We can identify the relevant ones by checking that they
|
||||
# point to somewhere in our $DEST directory.
|
||||
sudo sed -i "\+directory = ${DEST}+ d" /etc/gitconfig
|
||||
|
||||
Reference in New Issue
Block a user