Compare commits

..

31 Commits

Author SHA1 Message Date
Rodolfo Alonso Hernandez 6127ced12e [stable-only] Update system locale before PostgreSQL initialization
In Fedora/CentOS9, the PostgreSQL initialization fails with the
following message:
  initdb: invalid locale settings; check LANG and LC_* environment
  variables

This patch installs the required packages and configure the system
locale before calling the initialization process.

Closes-Bug: #2083482
Change-Id: I2c83e896819b20cd7a1ee8d8ee33354fb047a6d9
(cherry picked from commit e42e6f31a6)
2024-10-03 14:54:34 +00:00
elajkat c755ca9219 Handle_tags and branches for unmaintained also
Related-Bug: #2056276
Change-Id: Iaa34624d1d85cadf1b45bec780ef8d97dd054041
(cherry picked from commit 92b65a84cc)
(cherry picked from commit 0c1e594e45)
(cherry picked from commit d59e528c74)
(cherry picked from commit c52f50ee8c)
2024-09-12 12:05:05 +00:00
karolinku 0f18f54cef Replacing usage of rdo-release rpm
with centos-release-openstack rpms follwing [1].

[1] https://issues.redhat.com/browse/RDO-311

Change-Id: I50951e077e73297d10b075677a440992d1e2fa91
(cherry picked from commit 8784a3027f)
(cherry picked from commit a75091d4f3)
Conflicts:
	stack.sh
(cherry picked from commit d0e89946b3)
2024-08-06 16:05:47 +05:30
Rodolfo Alonso Hernandez f77a4c199f [stable only] Unset the default value of MYSQL_GATHER_PERFORMANCE
This patch unsets the default value of MYSQL_GATHER_PERFORMANCE.
That will avoid the installation of ``dbcounter``. In older releases,
this installation is triggering an issue with the version of
"setuptools", that requires a newer version of "packaging" that is
being installed.

Depends-On: https://review.opendev.org/c/zuul/zuul-jobs/+/924815
Change-Id: I765d87c9c6899b19c2df84796bf92c0656a72d7a
Closes-Bug: #2073585
(cherry picked from commit 123ac1b8e8)
2024-07-24 15:49:22 +00:00
yatinkarel 38ce28b420 Fix rdo_release for unmaintained branches
Only branches with stable/ as prefix were considered
but now we have branches even with different
prefix like unmaintained/, fix it to consider
such cases by using a generic filter instead of
assuming branch name starts with stable.

Change-Id: I967de13094ff6df46737a22d4e1758f9900dfbc9
(cherry picked from commit 4d69238383)
Conflicts:
	stack.sh
2024-06-21 18:35:12 +05:30
Zuul 94b54879c2 Merge "Update .gitreview for unmaintained/zed" into unmaintained/zed 2024-06-12 13:39:58 +00:00
Pham Le Gia Dai b00eb4a3d0 Update TARGET_BRANCH to unmaintained/zed
Change-Id: I6ccdc01b39ff40be6e2e271fb620bc8bfb0d1ba5
2024-05-31 09:19:49 +07:00
Clark Boylan d487302e60 Drop devstack-gate roles from devstack zuul jobs
Devstack-gate has been retired and relying on a retired repo for roles
in zuul produces errors (because the roles are no longer in the HEAD of
the repo). It doesn't look like devstack actually relies on these roles
in d-g (if it does they can be ported into devstack instead) so we just
drop the roles specifier for d-g in the devstack job.

NOTE(elod.illes): nova-ceph-multistore job is broken in this branch, so
it is set as non-voting in check queue and removed from gate queue
until it gets fixed.

Change-Id: I28a39b31f71153a602d41cefe621a216d09a290f
2024-05-15 21:46:54 +02:00
OpenStack Release Bot de086027da Update .gitreview for unmaintained/zed
Change-Id: Ice38102cd0b53294d240d93c885036845c0f59ef
2024-04-26 16:18:49 +00:00
Jeremy Stanley 1183167f19 Drop the devstack-single-node-centos-7 nodeset
OpenDev is preparing to remove centos-7 nodes on March 15[*]. This
change drops one nodeset definition which is the last remaining
reference on DevStack's master branch.

[*] https://lists.openstack.org/archives/list/openstack-discuss@lists.openstack.org/message/A2YIY5L7MVYSQMTVZU3L3OM7GLVVZPLK/

Change-Id: Icd487e1012263a9b0bc13b529d31ff2025108adf
(cherry picked from commit 73da7dfb93)
2024-03-04 18:53:45 +00:00
Sean Mooney 2bb18a4caa The AZ filter is deprecated and planned for removal this cycle
To facilitate that this change removes it form the default filter
list. By default nova has used placement for AZs so this filter
has not been requried since xena.

Change-Id: Ie5e216dd8c2a7ecf43cc6954ec4f73d4d67b5b3b
(cherry picked from commit ad029c0e8b)
(cherry picked from commit 0726a4f919)
2023-08-25 20:11:58 +00:00
Zuul 461089b238 Merge "git: git checkout for a commit hash combinated with depth argument" into stable/zed 2023-08-13 21:52:17 +00:00
jskunda 722465ec97 git: git checkout for a commit hash combinated with depth argument
This patch: https://review.opendev.org/c/openstack/devstack/+/882299
provides functionality, that commit hash can be passed as last arugment,
however when GIT_DEPTH is set, it fails, as in:

timeout -s SIGINT 0 git clone https://github.com/ovn-org/ovn.git ./ovn
--depth 1 --branch 03b95a4566a15f7544f4cdf35629dacede4dcf55
fatal: Remote branch 03b95a4566a15f7544f4cdf35629dacede4dcf55
not found in upstream origin

Closes-Bug: #2023020
Change-Id: I748354964a133e028e12458cc9014d6d014cbdb9
2023-08-02 15:42:57 +02:00
Alfredo Moralejo e62f4f25f3 Use RDO official CloudSIG mirrors for C9S deployments
Instead of using RDO Trunk repo server, CentOS official mirrors provide
a most reliable infrastructure and supports EMS which is required when
enabling FIPS in C9S.

In order to install the rdo-release rpm from repo.fedoraproject.org,
which does not support EMS, I'm using a workaround to wget, which works
with non-EMS servers because it uses gnutls instead of openssl, and
install it locally with rpm.

This is also consistent to CentOS 8 implementatioin.

Closes-Bug: #2020661
Closes-Bug: #2020434
Change-Id: Icd99f467d47aaafaaf3ee8f2a3c4da08842cb672
(cherry picked from commit b2ad00cb66)
2023-08-01 15:35:41 +00:00
Dan Smith b31d70a576 nova: Bump timeout-per-gb for BFV rebuild ops
This increases the timeout we use to wait for cinder to perform a
volume reimage. Since devstack is often running on a single machine
with non-production IO performance, we should bump this limit to avoid
hitting it before the rebuild completes.

Change-Id: Ie2663b951acb0c1a65597a39e032948764e6ae6a
(cherry picked from commit 58c80b2424)
(cherry picked from commit 6767465bc5)
2023-07-18 10:19:27 +02:00
Ihar Hrachyshka 94b49698a8 git: support git checkout for a commit hash
git_clone assumes a branch or a tag is passed as the last argument, and
it fails when a commit hash is passed, as in:

timeout -s SIGINT 0 git clone https://github.com/ovn-org/ovn.git
/opt/stack/ovn --branch 36e3ab9b47e93af0599a818e9d6b2930e49473f0
Cloning into '/opt/stack/ovn'...
fatal: Remote branch 36e3ab9b47e93af0599a818e9d6b2930e49473f0 not found
in upstream origin

Change-Id: Id1328d7cba418fa7c227ae9db4fe83c09fd06035
(cherry picked from commit e8915786e1)
2023-05-04 20:07:55 +00:00
yatinkarel 4181791e06 [ovs] Reload ovs kernel module always
Irrespective of build_modules is True
or False reload ovs modules always.

If ovs is installed from package before(like
with multi-node-bridge role), then installing
ovs from source requires openvswitch kernel
module to be reloaded.

The issue was not seen before jammy as there
module was reloaded when build_modules was set
to True.

Closes-Bug: #2015364
Change-Id: I1785b49b2ef72ca1f817f504d5ea56021410c052
(cherry picked from commit 42517968ff)
(cherry picked from commit f1d555d1e7)
2023-04-14 14:39:04 +00:00
Dan Smith b12cc4181c Try to reduce mysql memory usage
These are a few tweaks I applied to my own memory-constrained cloud
instances that seemed to help. I have lower performance requirements
so this may make things worse and not better, but it's worth seeing
what the impact is. I'll admit to not knowing the full impact of these
as they're mostly collected from various tutorials on lowering memory
usage.

Enable this for now on devstack-multinode

Change-Id: I7b223391d3de01e3e81b02076debd01d9d2f097c
(cherry picked from commit 7567359755)
2023-03-21 17:39:26 +01:00
Rajat Dhasmana 977b591ee1 Create multiattach volume type for tempest
Creating multiattach volume is a non-admin operation but creating
multiattach volume type is an admin operation.
Previously cinder allowed creating multiattach volumes without a
volume type but that support is being removed with[1].
The change requires updating tempest tests[2] but some tempest
tests are non-admin, which require admin priviledges to create the
multiattach volume type.
Based on the last discussion with tempest team[3], the proposed
solution is to create a multiattach volume type in devstack,
if ENABLE_VOLUME_MULTIATTACH is True, and use it in tempest
tests. Similar to how admins create multiattach volume types
for non-admin users.

This patch creates a multiattach volume type if
ENABLE_VOLUME_MULTIATTACH is True. Also we set the multiattach
type name as a tempest config option 'volume_type_multiattach'.

[1] https://review.opendev.org/c/openstack/cinder/+/874865
[2] https://review.opendev.org/c/openstack/tempest/+/875372
[3] https://meetings.opendev.org/irclogs/%23openstack-cinder/%23openstack-cinder.2023-03-13.log.html#t2023-03-13T18:47:56

Change-Id: Icd3690565bf7b27898cd206641e612da3993703d
(cherry picked from commit 1898a683be)
(cherry picked from commit 16594b7b2a)
Conflicts: lib/cinder
    conflicts due to nvme support being added in 2023.1
    https://review.opendev.org/c/openstack/devstack/+/814193
2023-03-15 19:30:33 +00:00
Ghanshyam Mann 30a7d790b6 Fix setting the tempest virtual env constraints env var
Devstack set the env var TOX_CONSTRAINTS_FILE/UPPER_CONSTRAINTS_FILE
which are used to use the constraints during Tempest virtual env installation.
Those env var are set to non-master constraint when we need to use non-master
constraints but when we need to use the master constraints we do not set/reset
them point to master constraints. This create the issue when running the grenade
job where we run Tempest on the old devstack as well as in the new devstack.
When tempest is installed on old devstack then old tempest is used and it sets
these env var to stable/<branch> constraints (this is the case when old devstack
(the stable branch is in EM phase) uses the old tempest not the master tempest),
all good till now. But the problem comes when in the same grenade script run
upgrade-tempest install the master tempest (when new devstack branches are in
the 'supported' phase and use the master tempest means) and are supposed to use
the master constraints. But the TOX_CONSTRAINTS_FILE/UPPER_CONSTRAINTS_FILE env
var set by old tempest is used by the tempest and due to a mismatch in constraints
it fails.

This happened when we tried to pin the stable/wallaby with Tempest 29.0.0
- https://review.opendev.org/c/openstack/devstack/+/871782

and table/xena grenade job failed (stable/xena use master tempest and supposed
to use master constraints)
- https://zuul.opendev.org/t/openstack/build/fb7b2a8b562c42bab4c741819f5e9732/log/controller/logs/grenade.sh_log.txt#16641

We should set/reset those constraint env var to master constraints if configuration
tell devstack to use the master constraints.

[1] https://github.com/openstack/devstack/blob/71c3c40c269a50303247855319d1d3a5d30f6773/lib/tempest#L124

Closes-Bug: #2003993
Change-Id: I5e938139b47f443a4c358415d0d4dcf6549cd085
(cherry picked from commit 7fe998109b)
2023-01-26 22:38:37 -06:00
yatinkarel 74dbd6ee8d [OVN] Ensure socket files are absent in init_ovn
Just like we remove db files let's also remove
socket files when initializing ovn. Those will
reappear once service fully restarts along with
db files. Without it we see random issue as
described in the below bug.

Closes-Bug: #2002629
Change-Id: I726a9cac9c805d017273aa79e844724f0d00cdf0
(cherry picked from commit 7fecba2f13)
2023-01-17 05:47:46 +00:00
Ghanshyam Mann 44c3ea4f1b [stable-only] Pin tox<4 in run-both.yaml playbook also
We pinned tox<4 in ensure-tox pre.yaml playbook
- https://review.opendev.org/q/I9a138af94dedc0d8ce5a0d519d75779415d3c30b

but did not realize that it is used in run-both.yaml playbook
also where we should pin too.

Depends-On: https://review.opendev.org/c/openstack/swift/+/869519

Change-Id: I4407f7036e3fd51ac79f68791151c3f9cd03bd01
2023-01-07 02:56:35 +00:00
Ghanshyam Mann 211cc4c036 Pin tox<4.0.0 for <=stable/zed branch testing
Tox 4.0.0 has some incompatible changes, epecially more
strict on allowlist_externals. Tempest recently changed
allowlist_externals not to be *[1] causing the failure
on jobs where lib/tempest failing to run the tempest
as command in virtual env.

----------
venv: commands[0]> tempest verify-config -uro /tmp/tmp.qH5KgJHTF4
venv: failed with tempest is not allowed, use allowlist_externals to allow it
------

We do not need to test/fix the <=stable/zed branches with tox 4.0.0
and pinning them with the compatible tox version of the time stable
brnaches were releaased is better way.

This commit proposes:
1. Pinning the tox<4.0.0 for <=stable/ze branches testing
2. Workaround to unblock the master gate by pinning it <4.0.0 but
we should make our testing compatible with tox 4.0.0 soon.

Depends-On: https://review.opendev.org/c/openstack/devstack/+/867067

Related-Bug: #1999183

[1] https://review.opendev.org/c/openstack/tempest/+/865314 devstack based job started failing to run tempest command on venv.

Change-Id: I9a138af94dedc0d8ce5a0d519d75779415d3c30b
(cherry picked from commit ba54baa425)
2022-12-09 02:54:44 +00:00
Martin Kopec e6bb5c9959 Stop running devstack-no-tls-proxy on stable branch
Let's run devstack-no-tls-proxy job only on master periodic.

Change-Id: I4c0a5144da2549fe988bbabe8536e9a9873e1cf7
2022-11-29 17:06:39 +01:00
Dr. Jens Harbott 49c1a34e7a Remove Fedora platform jobs from Zed branch
These jobs are not intended to run on stable branches; remove them
to avoid issues with updating the nodeset on the master branch:

- devstack-platform-fedora-latest
- devstack-platform-fedora-latest-virt-preview

Change-Id: I4044c20765ad96fb5304d145b2c18be9736de7f3
2022-10-07 08:12:45 +02:00
Martin Kopec aeae198c17 Stop installing Tempest at system wide for stable branch
As added in notes for INSTALL_TEMPEST variable, we need to set
this to False for a stable branch so that devstack does not
install Tempest system wide.

Change-Id: I8a79feedb676514dfe9c3125c9d8e66417547d52
2022-09-30 14:05:04 +02:00
Martin Kopec 88b9edf921 Cap stable/zed network, swift, volume api_extensions for tempest
This commit caps the network, volume and swift extensions on
Tempest's config option api_extensions.

Change-Id: I33d17c81a40861284087de337bc33b3d9e60f076
2022-09-29 17:42:58 +02:00
Martin Kopec 12752ea219 Cap max microversions for stable/zed
This commit cap the max microversions for compute, volume
and placement API for stable/zed.

Compute - https://opendev.org/openstack/nova/src/branch/stable/zed/nova/api/openstack/compute/rest_api_version_history.rst#microversion%202.93

Volume - https://opendev.org/openstack/cinder/src/branch/stable/zed/cinder/api/openstack/rest_api_version_history.rst#section-58

Placement - https://opendev.org/openstack/placement/src/branch/master/placement/rest_api_version_history.rst#support-for-the-any-traits-syntax-in-the-required-parameter

Change-Id: I43361fdf1a7e1da8dade305470c1c17fe0ce6454
2022-09-28 02:22:43 +02:00
Martin Kopec 100946429a Update branches for stable/zed
Step 4 of the Devstack release:
https://wiki.openstack.org/wiki/QA/releases

Change-Id: I8af6e1ca1bdfb0718b0bda83142fb2a91e61f9d5
2022-09-28 02:11:28 +02:00
OpenStack Release Bot 0e95a7221a Update TOX_CONSTRAINTS_FILE for stable/zed
Update the URL to the upper-constraints file to point to the redirect
rule on releases.openstack.org so that anyone working on this branch
will switch to the correct upper-constraints list automatically when
the requirements repository branches.

Until the requirements repository has as stable/zed branch, tests will
continue to use the upper-constraints list on master.

Change-Id: I7089a04cff68145388f12dab18c6cdd1a5a96336
2022-09-27 08:30:36 +00:00
OpenStack Release Bot ce2962ab48 Update .gitreview for stable/zed
Change-Id: I4fd09e5412f4e3b51a20f6d83271b3870d6f572e
2022-09-27 08:30:34 +00:00
121 changed files with 2912 additions and 3040 deletions
-2
View File
@@ -38,5 +38,3 @@ stack-screenrc
userrc_early
AUTHORS
ChangeLog
tools/dbcounter/build/
tools/dbcounter/dbcounter.egg-info/
+1
View File
@@ -2,3 +2,4 @@
host=review.opendev.org
port=29418
project=openstack/devstack.git
defaultbranch=unmaintained/zed
+120 -195
View File
@@ -1,18 +1,18 @@
- nodeset:
name: openstack-single-node-jammy
name: openstack-single-node
nodes:
- name: controller
label: ubuntu-jammy
label: ubuntu-xenial
groups:
- name: tempest
nodes:
- controller
- nodeset:
name: openstack-single-node-noble
name: openstack-single-node-jammy
nodes:
- name: controller
label: ubuntu-noble
label: ubuntu-jammy
groups:
- name: tempest
nodes:
@@ -38,6 +38,16 @@
nodes:
- controller
- nodeset:
name: openstack-single-node-xenial
nodes:
- name: controller
label: ubuntu-xenial
groups:
- name: tempest
nodes:
- controller
- nodeset:
name: devstack-single-node-centos-9-stream
nodes:
@@ -58,19 +68,6 @@
nodes:
- controller
- nodeset:
name: devstack-single-node-debian-bookworm
nodes:
- name: controller
label: debian-bookworm
groups:
- name: tempest
nodes:
- controller
# Note(sean-k-mooney): this is still used by horizon for
# horizon-integration-tests, horizon-integration-pytest and
# horizon-ui-pytest, remove when horizon is updated.
- nodeset:
name: devstack-single-node-debian-bullseye
nodes:
@@ -82,14 +79,34 @@
- controller
- nodeset:
name: devstack-single-node-rockylinux-9
name: openstack-two-node
nodes:
- name: controller
label: rockylinux-9
label: ubuntu-xenial
- name: compute1
label: ubuntu-xenial
groups:
# Node where tests are executed and test results collected
- name: tempest
nodes:
- controller
# Nodes running the compute service
- name: compute
nodes:
- controller
- compute1
# Nodes that are not the controller
- name: subnode
nodes:
- compute1
# Switch node for multinode networking setup
- name: switch
nodes:
- controller
# Peer nodes for multinode networking setup
- name: peers
nodes:
- compute1
- nodeset:
name: openstack-two-node-centos-9-stream
@@ -121,66 +138,6 @@
nodes:
- compute1
- nodeset:
name: openstack-two-node-jammy
nodes:
- name: controller
label: ubuntu-jammy
- name: compute1
label: ubuntu-jammy
groups:
# Node where tests are executed and test results collected
- name: tempest
nodes:
- controller
# Nodes running the compute service
- name: compute
nodes:
- controller
- compute1
# Nodes that are not the controller
- name: subnode
nodes:
- compute1
# Switch node for multinode networking setup
- name: switch
nodes:
- controller
# Peer nodes for multinode networking setup
- name: peers
nodes:
- compute1
- nodeset:
name: openstack-two-node-noble
nodes:
- name: controller
label: ubuntu-noble
- name: compute1
label: ubuntu-noble
groups:
# Node where tests are executed and test results collected
- name: tempest
nodes:
- controller
# Nodes running the compute service
- name: compute
nodes:
- controller
- compute1
# Nodes that are not the controller
- name: subnode
nodes:
- compute1
# Switch node for multinode networking setup
- name: switch
nodes:
- controller
# Peer nodes for multinode networking setup
- name: peers
nodes:
- compute1
- nodeset:
name: openstack-two-node-focal
nodes:
@@ -241,6 +198,36 @@
nodes:
- compute1
- nodeset:
name: openstack-two-node-xenial
nodes:
- name: controller
label: ubuntu-xenial
- name: compute1
label: ubuntu-xenial
groups:
# Node where tests are executed and test results collected
- name: tempest
nodes:
- controller
# Nodes running the compute service
- name: compute
nodes:
- controller
- compute1
# Nodes that are not the controller
- name: subnode
nodes:
- compute1
# Switch node for multinode networking setup
- name: switch
nodes:
- controller
# Peer nodes for multinode networking setup
- name: peers
nodes:
- compute1
- nodeset:
name: openstack-three-node-focal
nodes:
@@ -313,7 +300,7 @@
- job:
name: devstack-base
parent: openstack-multinode-fips
parent: multinode
abstract: true
description: |
Base abstract Devstack job.
@@ -373,7 +360,6 @@
/var/log/mysql: logs
/var/log/libvirt: logs
/etc/libvirt: logs
/etc/lvm: logs
/etc/sudoers: logs
/etc/sudoers.d: logs
'{{ stage_dir }}/iptables.txt': logs
@@ -432,8 +418,6 @@
- ^releasenotes/.*$
# Translations
- ^.*/locale/.*po$
# pre-commit config
- ^.pre-commit-config.yaml$
- job:
name: devstack-minimal
@@ -441,7 +425,7 @@
description: |
Minimal devstack base job, intended for use by jobs that need
less than the normal minimum set of required-projects.
nodeset: openstack-single-node-jammy
nodeset: openstack-single-node-focal
required-projects:
- opendev.org/openstack/requirements
vars:
@@ -455,18 +439,14 @@
dstat: false
etcd3: true
memory_tracker: true
file_tracker: true
mysql: true
rabbit: true
openstack-cli-server: true
group-vars:
subnode:
devstack_services:
# Shared services
dstat: false
memory_tracker: true
file_tracker: true
openstack-cli-server: true
devstack_localrc:
# Multinode specific settings
HOST_IP: "{{ hostvars[inventory_hostname]['nodepool']['private_ipv4'] }}"
@@ -512,17 +492,8 @@
- opendev.org/openstack/nova
- opendev.org/openstack/placement
- opendev.org/openstack/swift
- opendev.org/openstack/os-test-images
timeout: 7200
vars:
# based on observation of the integrated gate
# tempest-integrated-compute was only using ~1.7GB of swap
# when zswap and the host turning are enabled that increase
# slightly to ~2GB. we are setting the swap size to 8GB to
# be safe and account for more complex scenarios.
# we should revisit this value after some time to see if we
# can reduce it.
configure_swap_size: 8192
devstack_localrc:
# Common OpenStack services settings
SWIFT_REPLICAS: 1
@@ -531,26 +502,6 @@
DEBUG_LIBVIRT_COREDUMPS: true
NOVA_VNC_ENABLED: true
OVN_DBS_LOG_LEVEL: dbg
# tune the host to optimize memory usage and hide io latency
# these setting will configure the kernel to treat the host page
# cache and swap with equal priority, and prefer deferring writes
# changing the default swappiness, dirty_ratio and
# the vfs_cache_pressure
ENABLE_SYSCTL_MEM_TUNING: true
# the net tuning optimizes ipv4 tcp fast open and config the default
# qdisk policy to pfifo_fast which effectively disable all qos.
# this minimizes the cpu load of the host network stack
ENABLE_SYSCTL_NET_TUNING: true
# zswap allows the kernel to compress pages in memory before swapping
# them to disk. this can reduce the amount of swap used and improve
# performance. effectively this trades a small amount of cpu for an
# increase in swap performance by reducing the amount of data
# written to disk. the overall speedup is proportional to the
# compression ratio and the speed of the swap device.
# NOTE: this option is ignored when not using nova with the libvirt
# virt driver.
NOVA_LIBVIRT_TB_CACHE_SIZE: 128
ENABLE_ZSWAP: true
devstack_local_conf:
post-config:
$NEUTRON_CONF:
@@ -563,7 +514,6 @@
dstat: false
etcd3: true
memory_tracker: true
file_tracker: true
mysql: true
rabbit: true
tls-proxy: true
@@ -613,7 +563,6 @@
# Shared services
dstat: false
memory_tracker: true
file_tracker: true
tls-proxy: true
# Nova services
n-cpu: true
@@ -643,26 +592,6 @@
Q_HOST: "{{ hostvars['controller']['nodepool']['private_ipv4'] }}"
NOVA_VNC_ENABLED: true
ENABLE_CHASSIS_AS_GW: false
# tune the host to optimize memory usage and hide io latency
# these setting will configure the kernel to treat the host page
# cache and swap with equal priority, and prefer deferring writes
# changing the default swappiness, dirty_ratio and
# the vfs_cache_pressure
ENABLE_SYSCTL_MEM_TUNING: true
# the net tuning optimizes ipv4 tcp fast open and config the default
# qdisk policy to pfifo_fast which effectively disable all qos.
# this minimizes the cpu load of the host network stack
ENABLE_SYSCTL_NET_TUNING: true
# zswap allows the kernel to compress pages in memory before swapping
# them to disk. this can reduce the amount of swap used and improve
# performance. effectivly this trades a small amount of cpu for an
# increase in swap performance by reducing the amount of data
# written to disk. the overall speedup is porportional to the
# compression ratio and the speed of the swap device.
ENABLE_ZSWAP: true
# NOTE: this option is ignored when not using nova with the libvirt
# virt driver.
NOVA_LIBVIRT_TB_CACHE_SIZE: 128
- job:
name: devstack-ipv6
@@ -688,10 +617,13 @@
- job:
name: devstack-multinode
parent: devstack
nodeset: openstack-two-node-jammy
nodeset: openstack-two-node-focal
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,
@@ -703,39 +635,32 @@
description: CentOS 9 Stream platform test
nodeset: devstack-single-node-centos-9-stream
timeout: 9000
voting: false
- job:
name: devstack-platform-debian-bookworm
parent: tempest-full-py3
description: Debian Bookworm platform test
nodeset: devstack-single-node-debian-bookworm
timeout: 9000
vars:
configure_swap_size: 4096
- job:
name: devstack-platform-rocky-blue-onyx
parent: tempest-full-py3
description: Rocky Linux 9 Blue Onyx platform test
nodeset: devstack-single-node-rockylinux-9
timeout: 9000
# NOTE(danms): This has been failing lately with some repository metadata
# errors. We're marking this as non-voting until it appears to have
# stabilized:
# https://zuul.openstack.org/builds?job_name=devstack-platform-rocky-blue-onyx&skip=0
# TODO(kopecmartin) n-v until the following is resolved:
# https://bugs.launchpad.net/neutron/+bug/1979047
voting: false
vars:
configure_swap_size: 4096
- job:
name: devstack-platform-ubuntu-noble
name: devstack-platform-debian-bullseye
parent: tempest-full-py3
description: Ubuntu 24.04 LTS (noble) platform test
nodeset: openstack-single-node-noble
description: Debian Bullseye platform test
nodeset: devstack-single-node-debian-bullseye
timeout: 9000
vars:
configure_swap_size: 8192
configure_swap_size: 4096
- 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
@@ -763,6 +688,8 @@
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
@@ -855,7 +782,7 @@
- job:
name: devstack-unit-tests
nodeset: ubuntu-jammy
nodeset: ubuntu-focal
description: |
Runs unit tests on devstack project.
@@ -873,11 +800,10 @@
- devstack-ipv6
- devstack-enforce-scope
- devstack-platform-centos-9-stream
- devstack-platform-debian-bookworm
- devstack-platform-rocky-blue-onyx
- devstack-platform-debian-bullseye
- devstack-platform-ubuntu-jammy
- devstack-platform-ubuntu-jammy-ovn-source
- devstack-platform-ubuntu-jammy-ovs
- devstack-platform-ubuntu-noble
- devstack-multinode
- devstack-unit-tests
- openstack-tox-bashate
@@ -891,6 +817,10 @@
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- neutron-linuxbridge-tempest:
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- neutron-ovn-tempest-ovs-release:
voting: false
irrelevant-files:
@@ -910,6 +840,7 @@
- ^.*\.rst$
- ^doc/.*$
- nova-ceph-multistore:
voting: false
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
@@ -917,11 +848,11 @@
jobs:
- devstack
- devstack-ipv6
- devstack-platform-debian-bookworm
- devstack-platform-ubuntu-noble
# NOTE(danms): Disabled due to instability, see comment in the job
# definition above.
# - devstack-platform-rocky-blue-onyx
# 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
@@ -930,6 +861,10 @@
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- neutron-linuxbridge-tempest:
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- ironic-tempest-bios-ipmi-direct-tinyipa
- swift-dsvm-functional
- grenade:
@@ -944,18 +879,19 @@
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
- nova-ceph-multistore:
irrelevant-files:
- ^.*\.rst$
- ^doc/.*$
# TODO(elod.illes): nova-ceph-multistore is broken in this branch,
# so it is set as non-voting in check queue and commented out here
# in gate queue until the job gets fixed.
# - nova-ceph-multistore:
# irrelevant-files:
# - ^.*\.rst$
# - ^doc/.*$
# Please add a note on each job and conditions for the job not
# being experimental any more, so we can keep this list somewhat
# pruned.
#
# * nova-next: maintained by nova for unreleased/undefaulted
# things, this job is not experimental but often is used to test
# things that are not yet production ready or to test what will be
# the new default after a deprecation period has ended.
# things
# * neutron-fullstack-with-uwsgi: maintained by neutron for fullstack test
# when neutron-api is served by uwsgi, it's in exprimental for testing.
# the next cycle we can remove this job if things turn out to be
@@ -963,9 +899,9 @@
# * neutron-functional-with-uwsgi: maintained by neutron for functional
# test. Next cycle we can remove this one if things turn out to be
# stable engouh with uwsgi.
# * neutron-ovn-tempest-with-uwsgi: maintained by neutron for tempest test.
# * neutron-tempest-with-uwsgi: maintained by neutron for tempest test.
# Next cycle we can remove this if everything run out stable enough.
# * nova-multi-cell: maintained by nova and now is voting in the
# * nova-multi-cell: maintained by nova and currently non-voting in the
# check queue for nova changes but relies on devstack configuration
experimental:
@@ -974,7 +910,7 @@
- nova-next
- neutron-fullstack-with-uwsgi
- neutron-functional-with-uwsgi
- neutron-ovn-tempest-with-uwsgi
- neutron-tempest-with-uwsgi
- devstack-plugin-ceph-tempest-py3:
irrelevant-files:
- ^.*\.rst$
@@ -996,14 +932,3 @@
- ^.*\.rst$
- ^doc/.*$
- devstack-no-tls-proxy
periodic:
jobs:
- devstack-no-tls-proxy
periodic-weekly:
jobs:
- devstack-platform-centos-9-stream
- devstack-platform-debian-bookworm
- devstack-platform-rocky-blue-onyx
- devstack-platform-ubuntu-jammy-ovn-source
- devstack-platform-ubuntu-jammy-ovs
- devstack-platform-ubuntu-noble
+4 -4
View File
@@ -4,7 +4,7 @@ from git source trees.
Goals
=====
* To quickly build dev OpenStack environments in a clean Ubuntu or RockyLinux
* To quickly build dev OpenStack environments in a clean Ubuntu or Fedora
environment
* To describe working configurations of OpenStack (which code branches
work together? what do config files look like for those branches?)
@@ -28,9 +28,9 @@ Versions
The DevStack master branch generally points to trunk versions of OpenStack
components. For older, stable versions, look for branches named
stable/[release] in the DevStack repo. For example, you can do the
following to create a Zed OpenStack cloud::
following to create a Pike OpenStack cloud::
git checkout stable/zed
git checkout stable/pike
./stack.sh
You can also pick specific OpenStack project releases by setting the appropriate
@@ -55,7 +55,7 @@ When the script finishes executing, you should be able to access OpenStack
endpoints, like so:
* Horizon: http://myhost/
* Keystone: http://myhost/identity/v3/
* Keystone: http://myhost/identity/v2.0/
We also provide an environment file that you can use to interact with your
cloud via CLI::
+1
View File
@@ -50,6 +50,7 @@ source $TOP_DIR/lib/placement
source $TOP_DIR/lib/cinder
source $TOP_DIR/lib/swift
source $TOP_DIR/lib/neutron
source $TOP_DIR/lib/neutron-legacy
set -o xtrace
+4
View File
@@ -4,4 +4,8 @@ Pygments
docutils
sphinx>=2.0.0,!=2.1.0 # BSD
openstackdocstheme>=2.2.1 # Apache-2.0
nwdiag
blockdiag
sphinxcontrib-blockdiag
sphinxcontrib-nwdiag
zuul-sphinx>=0.2.0
Binary file not shown.

Before

Width:  |  Height:  |  Size: 10 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 11 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 13 KiB

+6 -6
View File
@@ -23,14 +23,14 @@
# Add any Sphinx extension module names here, as strings. They can be extensions
# coming with Sphinx (named 'sphinx.ext.*') or your custom ones.
extensions = [
'sphinx.ext.autodoc',
'zuul_sphinx',
'openstackdocstheme',
]
extensions = [ 'sphinx.ext.autodoc',
'zuul_sphinx',
'openstackdocstheme',
'sphinxcontrib.blockdiag',
'sphinxcontrib.nwdiag' ]
# openstackdocstheme options
openstackdocs_repo_name = 'openstack/devstack'
openstackdocs_repo_name = 'openstack-dev/devstack'
openstackdocs_pdf_link = True
openstackdocs_bug_project = 'devstack'
openstackdocs_bug_tag = ''
+2 -34
View File
@@ -181,9 +181,6 @@ values that most often need to be set.
If the ``*_PASSWORD`` variables are not set here you will be prompted to
enter values for them by ``stack.sh``.
.. warning:: Only use alphanumeric characters in your passwords, as some
services fail to work when using special characters.
The network ranges must not overlap with any networks in use on the
host. Overlap is not uncommon as RFC-1918 'private' ranges are commonly
used for both the local networking and Nova's fixed and floating ranges.
@@ -639,7 +636,7 @@ tests can be run as follows:
::
$ cd /opt/stack/tempest
$ tox -e smoke
$ tox -efull tempest.scenario.test_network_basic_ops
By default tempest is downloaded and the config file is generated, but the
tempest package is not installed in the system's global site-packages (the
@@ -672,35 +669,6 @@ adjusted by setting ``CINDER_QUOTA_VOLUMES``, ``CINDER_QUOTA_BACKUPS``,
or ``CINDER_QUOTA_SNAPSHOTS`` to the desired value. (The default for
each is 10.)
DevStack's Cinder LVM configuration module currently supports both iSCSI and
NVMe connections, and we can choose which one to use with options
``CINDER_TARGET_HELPER``, ``CINDER_TARGET_PROTOCOL``, ``CINDER_TARGET_PREFIX``,
and ``CINDER_TARGET_PORT``.
Defaults use iSCSI with the LIO target manager::
CINDER_TARGET_HELPER="lioadm"
CINDER_TARGET_PROTOCOL="iscsi"
CINDER_TARGET_PREFIX="iqn.2010-10.org.openstack:"
CINDER_TARGET_PORT=3260
Additionally there are 3 supported transport protocols for NVMe,
``nvmet_rdma``, ``nvmet_tcp``, and ``nvmet_fc``, and when the ``nvmet`` target
is selected the protocol, prefix, and port defaults will change to more
sensible defaults for NVMe::
CINDER_TARGET_HELPER="nvmet"
CINDER_TARGET_PROTOCOL="nvmet_rdma"
CINDER_TARGET_PREFIX="nvme-subsystem-1"
CINDER_TARGET_PORT=4420
When selecting the RDMA transport protocol DevStack will create on Cinder nodes
a Software RoCE device on top of the ``HOST_IP_IFACE`` and if it is not defined
then on top of the interface with IP address ``HOST_IP`` or ``HOST_IPV6``.
This Soft-RoCE device will always be created on the Nova compute side since we
cannot tell beforehand whether there will be an RDMA connection or not.
Keystone
~~~~~~~~
@@ -751,7 +719,7 @@ or at runtime via:
::
openstack --os-cloud devstack-system-admin registered limit set \
openstack --os-cloud devstack-system-admin registered limit update \
--service glance --default-limit 5000 --region RegionOne image_size_total
.. _arch-configuration:
+2 -3
View File
@@ -42,9 +42,8 @@ Getting Your Patch Merged
~~~~~~~~~~~~~~~~~~~~~~~~~
All changes proposed to the Devstack require two ``Code-Review +2`` votes from
Devstack core reviewers before one of the core reviewers can approve the patch
by giving ``Workflow +1`` vote. There are 2 exceptions, approving patches to
unblock the gate and patches that do not relate to the Devstack's core logic,
like for example old job cleanups, can be approved by single core reviewers.
by giving ``Workflow +1`` vote. One exception is for patches to unblock the gate
which can be approved by single core reviewers.
Project Team Lead Duties
~~~~~~~~~~~~~~~~~~~~~~~~
-6
View File
@@ -20,12 +20,6 @@ provides consumption output when available memory is seen to be
falling (i.e. processes are consuming memory). It also provides
output showing locked (unswappable) memory.
file_tracker
------------
The ``file_tracker`` service periodically monitors the number of
open files in the system.
tcpdump
-------
+4 -4
View File
@@ -20,7 +20,7 @@ Walk through various setups used by stackers
guides/neutron
guides/devstack-with-nested-kvm
guides/nova
guides/devstack-with-octavia
guides/devstack-with-lbaas-v2
guides/devstack-with-ldap
All-In-One Single VM
@@ -69,10 +69,10 @@ Nova and devstack
Guide to working with nova features :doc:`Nova and devstack <guides/nova>`.
Configure Octavia
-----------------
Configure Load-Balancer Version 2
-----------------------------------
Guide on :doc:`Configure Octavia <guides/devstack-with-octavia>`.
Guide on :doc:`Configure Load-Balancer Version 2 <guides/devstack-with-lbaas-v2>`.
Deploying DevStack with LDAP
----------------------------
@@ -0,0 +1,145 @@
Devstack with Octavia Load Balancing
====================================
Starting with the OpenStack Pike release, Octavia is now a standalone service
providing load balancing services for OpenStack.
This guide will show you how to create a devstack with `Octavia API`_ enabled.
.. _Octavia API: https://docs.openstack.org/api-ref/load-balancer/v2/index.html
Phase 1: Create DevStack + 2 nova instances
--------------------------------------------
First, set up a vm of your choice with at least 8 GB RAM and 16 GB disk space,
make sure it is updated. Install git and any other developer tools you find
useful.
Install devstack
::
git clone https://opendev.org/openstack/devstack
cd devstack/tools
sudo ./create-stack-user.sh
cd ../..
sudo mv devstack /opt/stack
sudo chown -R stack.stack /opt/stack/devstack
This will clone the current devstack code locally, then setup the "stack"
account that devstack services will run under. Finally, it will move devstack
into its default location in /opt/stack/devstack.
Edit your ``/opt/stack/devstack/local.conf`` to look like
::
[[local|localrc]]
enable_plugin octavia https://opendev.org/openstack/octavia
# If you are enabling horizon, include the octavia dashboard
# enable_plugin octavia-dashboard https://opendev.org/openstack/octavia-dashboard.git
# If you are enabling barbican for TLS offload in Octavia, include it here.
# enable_plugin barbican https://opendev.org/openstack/barbican
# ===== BEGIN localrc =====
DATABASE_PASSWORD=password
ADMIN_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=password
RABBIT_PASSWORD=password
# Enable Logging
LOGFILE=$DEST/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
# Pre-requisite
ENABLED_SERVICES=rabbit,mysql,key
# Horizon - enable for the OpenStack web GUI
# ENABLED_SERVICES+=,horizon
# Nova
ENABLED_SERVICES+=,n-api,n-crt,n-cpu,n-cond,n-sch,n-api-meta,n-sproxy
ENABLED_SERVICES+=,placement-api,placement-client
# Glance
ENABLED_SERVICES+=,g-api
# Neutron
ENABLED_SERVICES+=,q-svc,q-agt,q-dhcp,q-l3,q-meta,neutron
ENABLED_SERVICES+=,octavia,o-cw,o-hk,o-hm,o-api
# Cinder
ENABLED_SERVICES+=,c-api,c-vol,c-sch
# Tempest
ENABLED_SERVICES+=,tempest
# Barbican - Optionally used for TLS offload in Octavia
# ENABLED_SERVICES+=,barbican
# ===== END localrc =====
Run stack.sh and do some sanity checks
::
sudo su - stack
cd /opt/stack/devstack
./stack.sh
. ./openrc
openstack network list # should show public and private networks
Create two nova instances that we can use as test http servers:
::
#create nova instances on private network
openstack server create --image $(openstack image list | awk '/ cirros-.*-x86_64-.* / {print $2}') --flavor 1 --nic net-id=$(openstack network list | awk '/ private / {print $2}') node1
openstack server create --image $(openstack image list | awk '/ cirros-.*-x86_64-.* / {print $2}') --flavor 1 --nic net-id=$(openstack network list | awk '/ private / {print $2}') node2
openstack server list # should show the nova instances just created
#add secgroup rules to allow ssh etc..
openstack security group rule create default --protocol icmp
openstack security group rule create default --protocol tcp --dst-port 22:22
openstack security group rule create default --protocol tcp --dst-port 80:80
Set up a simple web server on each of these instances. ssh into each instance (username 'cirros', password 'cubswin:)' or 'gocubsgo') and run
::
MYIP=$(ifconfig eth0|grep 'inet addr'|awk -F: '{print $2}'| awk '{print $1}')
while true; do echo -e "HTTP/1.0 200 OK\r\n\r\nWelcome to $MYIP" | sudo nc -l -p 80 ; done&
Phase 2: Create your load balancer
----------------------------------
Make sure you have the 'openstack loadbalancer' commands:
::
pip install python-octaviaclient
Create your load balancer:
::
openstack loadbalancer create --name lb1 --vip-subnet-id private-subnet
openstack loadbalancer show lb1 # Wait for the provisioning_status to be ACTIVE.
openstack loadbalancer listener create --protocol HTTP --protocol-port 80 --name listener1 lb1
openstack loadbalancer show lb1 # Wait for the provisioning_status to be ACTIVE.
openstack loadbalancer pool create --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP --name pool1
openstack loadbalancer show lb1 # Wait for the provisioning_status to be ACTIVE.
openstack loadbalancer healthmonitor create --delay 5 --timeout 2 --max-retries 1 --type HTTP pool1
openstack loadbalancer show lb1 # Wait for the provisioning_status to be ACTIVE.
openstack loadbalancer member create --subnet-id private-subnet --address <web server 1 address> --protocol-port 80 pool1
openstack loadbalancer show lb1 # Wait for the provisioning_status to be ACTIVE.
openstack loadbalancer member create --subnet-id private-subnet --address <web server 2 address> --protocol-port 80 pool1
Please note: The <web server # address> fields are the IP addresses of the nova
servers created in Phase 1.
Also note, using the API directly you can do all of the above commands in one
API call.
Phase 3: Test your load balancer
--------------------------------
::
openstack loadbalancer show lb1 # Note the vip_address
curl http://<vip_address>
curl http://<vip_address>
This should show the "Welcome to <IP>" message from each member server.
@@ -1,5 +1,3 @@
.. _kvm_nested_virt:
=======================================================
Configure DevStack with KVM-based Nested Virtualization
=======================================================
-144
View File
@@ -1,144 +0,0 @@
Devstack with Octavia Load Balancing
====================================
Starting with the OpenStack Pike release, Octavia is now a standalone service
providing load balancing services for OpenStack.
This guide will show you how to create a devstack with `Octavia API`_ enabled.
.. _Octavia API: https://docs.openstack.org/api-ref/load-balancer/v2/index.html
Phase 1: Create DevStack + 2 nova instances
--------------------------------------------
First, set up a VM of your choice with at least 8 GB RAM and 16 GB disk space,
make sure it is updated. Install git and any other developer tools you find
useful.
Install devstack::
git clone https://opendev.org/openstack/devstack
cd devstack/tools
sudo ./create-stack-user.sh
cd ../..
sudo mv devstack /opt/stack
sudo chown -R stack.stack /opt/stack/devstack
This will clone the current devstack code locally, then setup the "stack"
account that devstack services will run under. Finally, it will move devstack
into its default location in /opt/stack/devstack.
Edit your ``/opt/stack/devstack/local.conf`` to look like::
[[local|localrc]]
# ===== BEGIN localrc =====
DATABASE_PASSWORD=password
ADMIN_PASSWORD=password
SERVICE_PASSWORD=password
SERVICE_TOKEN=password
RABBIT_PASSWORD=password
GIT_BASE=https://opendev.org
# Optional settings:
# OCTAVIA_AMP_BASE_OS=centos
# OCTAVIA_AMP_DISTRIBUTION_RELEASE_ID=9-stream
# OCTAVIA_AMP_IMAGE_SIZE=3
# OCTAVIA_LB_TOPOLOGY=ACTIVE_STANDBY
# OCTAVIA_ENABLE_AMPHORAV2_JOBBOARD=True
# LIBS_FROM_GIT+=octavia-lib,
# Enable Logging
LOGFILE=$DEST/logs/stack.sh.log
VERBOSE=True
LOG_COLOR=True
enable_service rabbit
enable_plugin neutron $GIT_BASE/openstack/neutron
# Octavia supports using QoS policies on the VIP port:
enable_service q-qos
enable_service placement-api placement-client
# Octavia services
enable_plugin octavia $GIT_BASE/openstack/octavia master
enable_plugin octavia-dashboard $GIT_BASE/openstack/octavia-dashboard
enable_plugin ovn-octavia-provider $GIT_BASE/openstack/ovn-octavia-provider
enable_plugin octavia-tempest-plugin $GIT_BASE/openstack/octavia-tempest-plugin
enable_service octavia o-api o-cw o-hm o-hk o-da
# If you are enabling barbican for TLS offload in Octavia, include it here.
# enable_plugin barbican $GIT_BASE/openstack/barbican
# enable_service barbican
# Cinder (optional)
disable_service c-api c-vol c-sch
# Tempest
enable_service tempest
# ===== END localrc =====
.. note::
For best performance it is highly recommended to use KVM
virtualization instead of QEMU.
Also make sure nested virtualization is enabled as documented in
:ref:`the respective guide <kvm_nested_virt>`.
By adding ``LIBVIRT_CPU_MODE="host-passthrough"`` to your
``local.conf`` you enable the guest VMs to make use of all features your
host's CPU provides.
Run stack.sh and do some sanity checks::
sudo su - stack
cd /opt/stack/devstack
./stack.sh
. ./openrc
openstack network list # should show public and private networks
Create two nova instances that we can use as test http servers::
# create nova instances on private network
openstack server create --image $(openstack image list | awk '/ cirros-.*-x86_64-.* / {print $2}') --flavor 1 --nic net-id=$(openstack network list | awk '/ private / {print $2}') node1
openstack server create --image $(openstack image list | awk '/ cirros-.*-x86_64-.* / {print $2}') --flavor 1 --nic net-id=$(openstack network list | awk '/ private / {print $2}') node2
openstack server list # should show the nova instances just created
# add secgroup rules to allow ssh etc..
openstack security group rule create default --protocol icmp
openstack security group rule create default --protocol tcp --dst-port 22:22
openstack security group rule create default --protocol tcp --dst-port 80:80
Set up a simple web server on each of these instances. One possibility is to use
the `Golang test server`_ that is used by the Octavia project for CI testing
as well.
Copy the binary to your instances and start it as shown below
(username 'cirros', password 'gocubsgo')::
INST_IP=<instance IP>
scp -O test_server.bin cirros@${INST_IP}:
ssh -f cirros@${INST_IP} ./test_server.bin -id ${INST_IP}
When started this way the test server will respond to HTTP requests with
its own IP.
Phase 2: Create your load balancer
----------------------------------
Create your load balancer::
openstack loadbalancer create --wait --name lb1 --vip-subnet-id private-subnet
openstack loadbalancer listener create --wait --protocol HTTP --protocol-port 80 --name listener1 lb1
openstack loadbalancer pool create --wait --lb-algorithm ROUND_ROBIN --listener listener1 --protocol HTTP --name pool1
openstack loadbalancer healthmonitor create --wait --delay 5 --timeout 2 --max-retries 1 --type HTTP pool1
openstack loadbalancer member create --wait --subnet-id private-subnet --address <web server 1 address> --protocol-port 80 pool1
openstack loadbalancer member create --wait --subnet-id private-subnet --address <web server 2 address> --protocol-port 80 pool1
Please note: The <web server # address> fields are the IP addresses of the nova
servers created in Phase 1.
Also note, using the API directly you can do all of the above commands in one
API call.
Phase 3: Test your load balancer
--------------------------------
::
openstack loadbalancer show lb1 # Note the vip_address
curl http://<vip_address>
curl http://<vip_address>
This should show the "Welcome to <IP>" message from each member server.
.. _Golang test server: https://opendev.org/openstack/octavia-tempest-plugin/src/branch/master/octavia_tempest_plugin/contrib/test_server
+54 -6
View File
@@ -41,8 +41,19 @@ network and is on a shared subnet with other machines. The
`local.conf` exhibited here assumes that 1500 is a reasonable MTU to
use on that network.
.. image:: /assets/images/neutron-network-1.png
:alt: Network configuration for a single DevStack node
.. nwdiag::
nwdiag {
inet [ shape = cloud ];
router;
inet -- router;
network hardware_network {
address = "172.18.161.0/24"
router [ address = "172.18.161.1" ];
devstack-1 [ address = "172.18.161.6" ];
}
}
DevStack Configuration
@@ -89,8 +100,21 @@ also want to do multinode testing and networking.
Physical Network Setup
~~~~~~~~~~~~~~~~~~~~~~
.. image:: /assets/images/neutron-network-2.png
:alt: Network configuration for multiple DevStack nodes
.. nwdiag::
nwdiag {
inet [ shape = cloud ];
router;
inet -- router;
network hardware_network {
address = "172.18.161.0/24"
router [ address = "172.18.161.1" ];
devstack-1 [ address = "172.18.161.6" ];
devstack-2 [ address = "172.18.161.7" ];
}
}
After DevStack installs and configures Neutron, traffic from guest VMs
flows out of `devstack-2` (the compute node) and is encapsulated in a
@@ -198,6 +222,8 @@ connect OpenStack nodes (like `devstack-2`) together. This bridge is
used so that project network traffic, using the VXLAN tunneling
protocol, flows between each compute node where project instances run.
DevStack Compute Configuration
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
@@ -242,8 +268,30 @@ to the neutron L3 service.
Physical Network Setup
----------------------
.. image:: /assets/images/neutron-network-3.png
:alt: Network configuration for provider networks
.. nwdiag::
nwdiag {
inet [ shape = cloud ];
router;
inet -- router;
network provider_net {
address = "203.0.113.0/24"
router [ address = "203.0.113.1" ];
controller;
compute1;
compute2;
}
network control_plane {
router [ address = "10.0.0.1" ]
address = "10.0.0.0/24"
controller [ address = "10.0.0.2" ]
compute1 [ address = "10.0.0.3" ]
compute2 [ address = "10.0.0.4" ]
}
}
On a compute node, the first interface, eth0 is used for the OpenStack
management (API, message bus, etc) as well as for ssh for an
+1 -1
View File
@@ -122,7 +122,7 @@ when creating the server, for example:
.. code-block:: shell
$ openstack --os-compute-api-version 2.37 server create --flavor cirros256 \
--image cirros-0.6.3-x86_64-disk --nic none --wait test-server
--image cirros-0.3.5-x86_64-disk --nic none --wait test-server
.. note:: ``--os-compute-api-version`` greater than or equal to 2.37 is
required to use ``--nic=none``.
-3
View File
@@ -106,9 +106,6 @@ do the following:
- Set the service password. This is used by the OpenStack services
(Nova, Glance, etc) to authenticate with Keystone.
.. warning:: Only use alphanumeric characters in your passwords, as some
services fail to work when using special characters.
``local.conf`` should look something like this:
.. code-block:: ini
+5 -10
View File
@@ -37,10 +37,10 @@ Install Linux
-------------
Start with a clean and minimal install of a Linux system. DevStack
attempts to support the two latest LTS releases of Ubuntu,
Rocky Linux 9 and openEuler.
attempts to support the two latest LTS releases of Ubuntu, the
latest/current Fedora version, CentOS/RHEL 8 and OpenSUSE.
If you do not have a preference, Ubuntu 22.04 (Jammy) is the
If you do not have a preference, Ubuntu 20.04 (Focal Fossa) is the
most tested, and will probably go the smoothest.
Add Stack User (optional)
@@ -101,10 +101,7 @@ devstack git repo.
This is the minimum required config to get started with DevStack.
.. note:: There is a sample :download:`local.conf </assets/local.conf>` file
under the *samples* directory in the devstack repository.
.. warning:: Only use alphanumeric characters in your passwords, as some
services fail to work when using special characters.
under the *samples* directory in the devstack repository.
Start the install
-----------------
@@ -113,7 +110,7 @@ Start the install
$ ./stack.sh
This will take 15 - 30 minutes, largely depending on the speed of
This will take a 15 - 20 minutes, largely depending on the speed of
your internet connection. Many git trees and packages will be
installed during this process.
@@ -133,8 +130,6 @@ there.
You can ``source openrc`` in your shell, and then use the
``openstack`` command line tool to manage your devstack.
You can :ref:`create a VM and SSH into it <ssh>`.
You can ``cd /opt/stack/tempest`` and run tempest tests that have
been configured to work with your devstack.
+1 -123
View File
@@ -68,7 +68,7 @@ Shared Guest Interface
.. warning::
This is not a recommended configuration. Because of interactions
between OVS and bridging, if you reboot your box with active
between ovs and bridging, if you reboot your box with active
networking you may lose network connectivity to your system.
If you need your guests accessible on the network, but only have 1
@@ -114,125 +114,3 @@ For IPv6, ``FIXED_RANGE_V6`` will default to the first /64 of the value of
``FIXED_RANGE_V6`` will just use the value of that directly.
``SUBNETPOOL_PREFIX_V6`` will just default to the value of
``IPV6_ADDRS_SAFE_TO_USE`` directly.
.. _ssh:
SSH access to instances
=======================
To validate connectivity, you can create an instance using the
``$PRIVATE_NETWORK_NAME`` network (default: ``private``), create a floating IP
using the ``$PUBLIC_NETWORK_NAME`` network (default: ``public``), and attach
this floating IP to the instance:
.. code-block:: shell
openstack keypair create --public-key ~/.ssh/id_rsa.pub test-keypair
openstack server create --network private --key-name test-keypair ... test-server
fip_id=$(openstack floating ip create public -f value -c id)
openstack server add floating ip test-server ${fip_id}
Once done, ensure you have enabled SSH and ICMP (ping) access for the security
group used for the instance. You can either create a custom security group and
specify it when creating the instance or add it after creation, or you can
modify the ``default`` security group created by default for each project.
Let's do the latter:
.. code-block:: shell
openstack security group rule create --proto icmp --dst-port 0 default
openstack security group rule create --proto tcp --dst-port 22 default
Finally, SSH into the instance. If you used the Cirros instance uploaded by
default, then you can run the following:
.. code-block:: shell
openstack server ssh test-server -- -l cirros
This will connect using the ``cirros`` user and the keypair you configured when
creating the instance.
Remote SSH access to instances
==============================
You can also SSH to created instances on your DevStack host from other hosts.
This can be helpful if you are e.g. deploying DevStack in a VM on an existing
cloud and wish to do development on your local machine. There are a few ways to
do this.
.. rubric:: Configure instances to be locally accessible
The most obvious way is to configure guests to be locally accessible, as
described `above <Locally Accessible Guests>`__. This has the advantage of
requiring no further effort on the client. However, it is more involved and
requires either support from your cloud or some inadvisable workarounds.
.. rubric:: Use your DevStack host as a jump host
You can choose to use your DevStack host as a jump host. To SSH to a instance
this way, pass the standard ``-J`` option to the ``openstack ssh`` / ``ssh``
command. For example:
.. code-block::
openstack server ssh test-server -- -l cirros -J username@devstack-host
(where ``test-server`` is name of an existing instance, as described
:ref:`previously <ssh>`, and ``username`` and ``devstack-host`` are the
username and hostname of your DevStack host).
This can also be configured via your ``~/.ssh/config`` file, making it rather
effortless. However, it only allows SSH access. If you want to access e.g. a
web application on the instance, you will need to configure an SSH tunnel and
forward select ports using the ``-L`` option. For example, to forward HTTP
traffic:
.. code-block::
openstack server ssh test-server -- -l cirros -L 8080:username@devstack-host:80
(where ``test-server`` is name of an existing instance, as described
:ref:`previously <ssh>`, and ``username`` and ``devstack-host`` are the
username and hostname of your DevStack host).
As you can imagine, this can quickly get out of hand, particularly for more
complex guest applications with multiple ports.
.. rubric:: Use a proxy or VPN tool
You can use a proxy or VPN tool to enable tunneling for the floating IP
address range of the ``$PUBLIC_NETWORK_NAME`` network (default: ``public``)
defined by ``$FLOATING_RANGE`` (default: ``172.24.4.0/24``). There are many
such tools available to do this. For example, we could use a useful utility
called `shuttle`__. To enable tunneling using ``shuttle``, first ensure you
have allowed SSH and HTTP(S) traffic to your DevStack host. Allowing HTTP(S)
traffic is necessary so you can use the OpenStack APIs remotely. How you do
this will depend on where your DevStack host is running. Once this is done,
install ``sshuttle`` on your localhost:
.. code-block:: bash
sudo apt-get install sshuttle || yum install sshuttle
Finally, start ``sshuttle`` on your localhost using the floating IP address
range. For example, assuming you are using the default value for
``$FLOATING_RANGE``, you can do:
.. code-block:: bash
sshuttle -r username@devstack-host 172.24.4.0/24
(where ``username`` and ``devstack-host`` are the username and hostname of your
DevStack host).
You should now be able to create an instance and SSH into it:
.. code-block:: bash
openstack server ssh test-server -- -l cirros
(where ``test-server`` is name of an existing instance, as described
:ref:`previously <ssh>`)
.. __: https://github.com/sshuttle/sshuttle
+3 -2
View File
@@ -23,12 +23,13 @@ strategy to include the latest Ubuntu release and the latest RHEL
release.*
- Ubuntu: current LTS release plus current development release
- RHEL/CentOS/RockyLinux: current major release
- Fedora: current release plus previous release
- RHEL/CentOS: current major release
- Other OS platforms may continue to be included but the maintenance of
those platforms shall not be assumed simply due to their presence.
Having a listed point-of-contact for each additional OS will greatly
increase its chance of being well-maintained.
- Patches for Ubuntu and/or RockyLinux will not be held up due to
- Patches for Ubuntu and/or Fedora will not be held up due to
side-effects on other OS platforms.
Databases
+16 -3
View File
@@ -28,6 +28,8 @@ openstack/aodh `https://opendev.org/openstack/aodh <ht
openstack/barbican `https://opendev.org/openstack/barbican <https://opendev.org/openstack/barbican>`__
openstack/blazar `https://opendev.org/openstack/blazar <https://opendev.org/openstack/blazar>`__
openstack/ceilometer `https://opendev.org/openstack/ceilometer <https://opendev.org/openstack/ceilometer>`__
openstack/ceilometer-powervm `https://opendev.org/openstack/ceilometer-powervm <https://opendev.org/openstack/ceilometer-powervm>`__
openstack/cinderlib `https://opendev.org/openstack/cinderlib <https://opendev.org/openstack/cinderlib>`__
openstack/cloudkitty `https://opendev.org/openstack/cloudkitty <https://opendev.org/openstack/cloudkitty>`__
openstack/cyborg `https://opendev.org/openstack/cyborg <https://opendev.org/openstack/cyborg>`__
openstack/designate `https://opendev.org/openstack/designate <https://opendev.org/openstack/designate>`__
@@ -37,6 +39,7 @@ openstack/devstack-plugin-container `https://opendev.org/openstack/devstack
openstack/devstack-plugin-kafka `https://opendev.org/openstack/devstack-plugin-kafka <https://opendev.org/openstack/devstack-plugin-kafka>`__
openstack/devstack-plugin-nfs `https://opendev.org/openstack/devstack-plugin-nfs <https://opendev.org/openstack/devstack-plugin-nfs>`__
openstack/devstack-plugin-open-cas `https://opendev.org/openstack/devstack-plugin-open-cas <https://opendev.org/openstack/devstack-plugin-open-cas>`__
openstack/ec2-api `https://opendev.org/openstack/ec2-api <https://opendev.org/openstack/ec2-api>`__
openstack/freezer `https://opendev.org/openstack/freezer <https://opendev.org/openstack/freezer>`__
openstack/freezer-api `https://opendev.org/openstack/freezer-api <https://opendev.org/openstack/freezer-api>`__
openstack/freezer-tempest-plugin `https://opendev.org/openstack/freezer-tempest-plugin <https://opendev.org/openstack/freezer-tempest-plugin>`__
@@ -48,7 +51,9 @@ openstack/ironic-inspector `https://opendev.org/openstack/ironic-i
openstack/ironic-prometheus-exporter `https://opendev.org/openstack/ironic-prometheus-exporter <https://opendev.org/openstack/ironic-prometheus-exporter>`__
openstack/ironic-ui `https://opendev.org/openstack/ironic-ui <https://opendev.org/openstack/ironic-ui>`__
openstack/keystone `https://opendev.org/openstack/keystone <https://opendev.org/openstack/keystone>`__
openstack/kuryr-kubernetes `https://opendev.org/openstack/kuryr-kubernetes <https://opendev.org/openstack/kuryr-kubernetes>`__
openstack/kuryr-libnetwork `https://opendev.org/openstack/kuryr-libnetwork <https://opendev.org/openstack/kuryr-libnetwork>`__
openstack/kuryr-tempest-plugin `https://opendev.org/openstack/kuryr-tempest-plugin <https://opendev.org/openstack/kuryr-tempest-plugin>`__
openstack/magnum `https://opendev.org/openstack/magnum <https://opendev.org/openstack/magnum>`__
openstack/magnum-ui `https://opendev.org/openstack/magnum-ui <https://opendev.org/openstack/magnum-ui>`__
openstack/manila `https://opendev.org/openstack/manila <https://opendev.org/openstack/manila>`__
@@ -59,10 +64,14 @@ openstack/mistral `https://opendev.org/openstack/mistral
openstack/monasca-api `https://opendev.org/openstack/monasca-api <https://opendev.org/openstack/monasca-api>`__
openstack/monasca-events-api `https://opendev.org/openstack/monasca-events-api <https://opendev.org/openstack/monasca-events-api>`__
openstack/monasca-tempest-plugin `https://opendev.org/openstack/monasca-tempest-plugin <https://opendev.org/openstack/monasca-tempest-plugin>`__
openstack/murano `https://opendev.org/openstack/murano <https://opendev.org/openstack/murano>`__
openstack/networking-bagpipe `https://opendev.org/openstack/networking-bagpipe <https://opendev.org/openstack/networking-bagpipe>`__
openstack/networking-baremetal `https://opendev.org/openstack/networking-baremetal <https://opendev.org/openstack/networking-baremetal>`__
openstack/networking-bgpvpn `https://opendev.org/openstack/networking-bgpvpn <https://opendev.org/openstack/networking-bgpvpn>`__
openstack/networking-generic-switch `https://opendev.org/openstack/networking-generic-switch <https://opendev.org/openstack/networking-generic-switch>`__
openstack/networking-hyperv `https://opendev.org/openstack/networking-hyperv <https://opendev.org/openstack/networking-hyperv>`__
openstack/networking-odl `https://opendev.org/openstack/networking-odl <https://opendev.org/openstack/networking-odl>`__
openstack/networking-powervm `https://opendev.org/openstack/networking-powervm <https://opendev.org/openstack/networking-powervm>`__
openstack/networking-sfc `https://opendev.org/openstack/networking-sfc <https://opendev.org/openstack/networking-sfc>`__
openstack/neutron `https://opendev.org/openstack/neutron <https://opendev.org/openstack/neutron>`__
openstack/neutron-dynamic-routing `https://opendev.org/openstack/neutron-dynamic-routing <https://opendev.org/openstack/neutron-dynamic-routing>`__
@@ -71,17 +80,22 @@ openstack/neutron-fwaas-dashboard `https://opendev.org/openstack/neutron-
openstack/neutron-tempest-plugin `https://opendev.org/openstack/neutron-tempest-plugin <https://opendev.org/openstack/neutron-tempest-plugin>`__
openstack/neutron-vpnaas `https://opendev.org/openstack/neutron-vpnaas <https://opendev.org/openstack/neutron-vpnaas>`__
openstack/neutron-vpnaas-dashboard `https://opendev.org/openstack/neutron-vpnaas-dashboard <https://opendev.org/openstack/neutron-vpnaas-dashboard>`__
openstack/nova `https://opendev.org/openstack/nova <https://opendev.org/openstack/nova>`__
openstack/nova-powervm `https://opendev.org/openstack/nova-powervm <https://opendev.org/openstack/nova-powervm>`__
openstack/octavia `https://opendev.org/openstack/octavia <https://opendev.org/openstack/octavia>`__
openstack/octavia-dashboard `https://opendev.org/openstack/octavia-dashboard <https://opendev.org/openstack/octavia-dashboard>`__
openstack/octavia-tempest-plugin `https://opendev.org/openstack/octavia-tempest-plugin <https://opendev.org/openstack/octavia-tempest-plugin>`__
openstack/openstacksdk `https://opendev.org/openstack/openstacksdk <https://opendev.org/openstack/openstacksdk>`__
openstack/osprofiler `https://opendev.org/openstack/osprofiler <https://opendev.org/openstack/osprofiler>`__
openstack/ovn-bgp-agent `https://opendev.org/openstack/ovn-bgp-agent <https://opendev.org/openstack/ovn-bgp-agent>`__
openstack/oswin-tempest-plugin `https://opendev.org/openstack/oswin-tempest-plugin <https://opendev.org/openstack/oswin-tempest-plugin>`__
openstack/ovn-octavia-provider `https://opendev.org/openstack/ovn-octavia-provider <https://opendev.org/openstack/ovn-octavia-provider>`__
openstack/patrole `https://opendev.org/openstack/patrole <https://opendev.org/openstack/patrole>`__
openstack/rally-openstack `https://opendev.org/openstack/rally-openstack <https://opendev.org/openstack/rally-openstack>`__
openstack/sahara `https://opendev.org/openstack/sahara <https://opendev.org/openstack/sahara>`__
openstack/sahara-dashboard `https://opendev.org/openstack/sahara-dashboard <https://opendev.org/openstack/sahara-dashboard>`__
openstack/senlin `https://opendev.org/openstack/senlin <https://opendev.org/openstack/senlin>`__
openstack/shade `https://opendev.org/openstack/shade <https://opendev.org/openstack/shade>`__
openstack/skyline-apiserver `https://opendev.org/openstack/skyline-apiserver <https://opendev.org/openstack/skyline-apiserver>`__
openstack/solum `https://opendev.org/openstack/solum <https://opendev.org/openstack/solum>`__
openstack/storlets `https://opendev.org/openstack/storlets <https://opendev.org/openstack/storlets>`__
openstack/tacker `https://opendev.org/openstack/tacker <https://opendev.org/openstack/tacker>`__
openstack/tap-as-a-service `https://opendev.org/openstack/tap-as-a-service <https://opendev.org/openstack/tap-as-a-service>`__
@@ -174,7 +188,6 @@ x/trio2o `https://opendev.org/x/trio2o <https://
x/valet `https://opendev.org/x/valet <https://opendev.org/x/valet>`__
x/vmware-nsx `https://opendev.org/x/vmware-nsx <https://opendev.org/x/vmware-nsx>`__
x/vmware-vspc `https://opendev.org/x/vmware-vspc <https://opendev.org/x/vmware-vspc>`__
x/whitebox-neutron-tempest-plugin `https://opendev.org/x/whitebox-neutron-tempest-plugin <https://opendev.org/x/whitebox-neutron-tempest-plugin>`__
======================================== ===
+3
View File
@@ -243,6 +243,9 @@ locations in the top-level of the plugin repository:
- ``./devstack/files/rpms/$plugin_name`` - Packages to install when running
on Red Hat, Fedora, or CentOS.
- ``./devstack/files/rpms-suse/$plugin_name`` - Packages to install when
running on SUSE Linux or openSUSE.
Although there a no plans to remove this method of installing
packages, plugins should consider it deprecated for ``bindep`` support
described below.
-25
View File
@@ -1,25 +0,0 @@
=======
Tempest
=======
`Tempest`_ is the OpenStack Integration test suite. It is installed by default
and is used to provide integration testing for many of the OpenStack services.
Just like DevStack itself, it is possible to extend Tempest with plugins. In
fact, many Tempest plugin packages also include DevStack plugin to do things
like pre-create required static resources.
The `Tempest documentation <Tempest>`_ provides a thorough guide to using
Tempest. However, if you simply wish to run the standard set of Tempest tests
against an existing deployment, you can do the following:
.. code-block:: shell
cd /opt/stack/tempest
/opt/stack/data/venv/bin/tempest run ...
The above assumes you have installed DevStack in the default location
(configured via the ``DEST`` configuration variable) and have enabled
virtualenv-based installation in the standard location (configured via the
``USE_VENV`` and ``VENV_DEST`` configuration variables, respectively).
.. _Tempest: https://docs.openstack.org/tempest/latest/
-1
View File
@@ -39,5 +39,4 @@
CustomLog /var/log/%APACHE_NAME%/horizon_access.log combined
</VirtualHost>
%WSGIPYTHONHOME%
WSGISocketPrefix /var/run/%APACHE_NAME%
-1
View File
@@ -23,7 +23,6 @@ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D(us)"
%SSLLISTEN% %SSLENGINE%
%SSLLISTEN% %SSLCERTFILE%
%SSLLISTEN% %SSLKEYFILE%
%SSLLISTEN% SSLProtocol -all +TLSv1.3 +TLSv1.2
%SSLLISTEN%</VirtualHost>
Alias /identity %KEYSTONE_BIN%/keystone-wsgi-public
-1
View File
@@ -24,7 +24,6 @@ LogFormat "%h %l %u %t \"%r\" %>s %b \"%{Referer}i\" \"%{User-agent}i\" %D(us)"
%SSLLISTEN% %SSLENGINE%
%SSLLISTEN% %SSLCERTFILE%
%SSLLISTEN% %SSLKEYFILE%
%SSLLISTEN% SSLProtocol -all +TLSv1.3 +TLSv1.2
%SSLLISTEN%</VirtualHost>
Alias /networking %NEUTRON_BIN%/neutron-api
@@ -0,0 +1,3 @@
enable-tftp
tftp-root=/tftpboot
dhcp-boot=pxelinux.0
-118
View File
@@ -1,118 +0,0 @@
#!/usr/bin/env python3
# Copyright 2016 Red Hat, Inc.
#
# 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.
import socket
import sys
import os
import os.path
import json
server_address = "/tmp/openstack.sock"
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
try:
sock.connect(server_address)
except socket.error as msg:
print(msg, file=sys.stderr)
sys.exit(1)
def send(sock, doc):
jdoc = json.dumps(doc)
sock.send(b'%d\n' % len(jdoc))
sock.sendall(jdoc.encode('utf-8'))
def recv(sock):
length_str = b''
char = sock.recv(1)
if len(char) == 0:
print("Unexpected end of file", file=sys.stderr)
sys.exit(1)
while char != b'\n':
length_str += char
char = sock.recv(1)
if len(char) == 0:
print("Unexpected end of file", file=sys.stderr)
sys.exit(1)
total = int(length_str)
# use a memoryview to receive the data chunk by chunk efficiently
jdoc = memoryview(bytearray(total))
next_offset = 0
while total - next_offset > 0:
recv_size = sock.recv_into(jdoc[next_offset:], total - next_offset)
next_offset += recv_size
try:
doc = json.loads(jdoc.tobytes())
except (TypeError, ValueError) as e:
raise Exception('Data received was not in JSON format')
return doc
try:
env = {}
passenv = ["CINDER_VERSION",
"OS_AUTH_URL",
"OS_NO_CACHE",
"OS_PASSWORD",
"OS_PROJECT_NAME",
"OS_REGION_NAME",
"OS_TENANT_NAME",
"OS_USERNAME",
"OS_VOLUME_API_VERSION",
"OS_CLOUD"]
for name in passenv:
if name in os.environ:
env[name] = os.environ[name]
cmd = {
"app": os.path.basename(sys.argv[0]),
"env": env,
"argv": sys.argv[1:]
}
try:
image_idx = sys.argv.index('image')
create_idx = sys.argv.index('create')
missing_file = image_idx < create_idx and \
not any(x.startswith('--file') for x in sys.argv)
except ValueError:
missing_file = False
if missing_file:
# This means we were called with an image create command, but were
# not provided a --file option. That likely means we're being passed
# the image data to stdin, which won't work because we do not proxy
# stdin to the server. So, we just reject the operation and ask the
# caller to provide the file with --file instead.
# We've already connected to the server, we need to send it some dummy
# data so it doesn't wait forever.
send(sock, {})
print('Image create without --file is not allowed in server mode',
file=sys.stderr)
sys.exit(1)
else:
send(sock, cmd)
doc = recv(sock)
if doc["stdout"] != b'':
print(doc["stdout"], end='')
if doc["stderr"] != b'':
print(doc["stderr"], file=sys.stderr)
sys.exit(doc["status"])
finally:
sock.close()
@@ -1,118 +0,0 @@
#!/usr/bin/env python3
# Copyright 2016 Red Hat, Inc.
#
# 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.
import socket
import sys
import os
import json
from openstackclient import shell as osc_shell
from io import StringIO
server_address = "/tmp/openstack.sock"
try:
os.unlink(server_address)
except OSError:
if os.path.exists(server_address):
raise
sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
print('starting up on %s' % server_address, file=sys.stderr)
sock.bind(server_address)
# Listen for incoming connections
sock.listen(1)
def send(sock, doc):
jdoc = json.dumps(doc)
sock.send(b'%d\n' % len(jdoc))
sock.sendall(jdoc.encode('utf-8'))
def recv(sock):
length_str = b''
char = sock.recv(1)
while char != b'\n':
length_str += char
char = sock.recv(1)
total = int(length_str)
# use a memoryview to receive the data chunk by chunk efficiently
jdoc = memoryview(bytearray(total))
next_offset = 0
while total - next_offset > 0:
recv_size = sock.recv_into(jdoc[next_offset:], total - next_offset)
next_offset += recv_size
try:
doc = json.loads(jdoc.tobytes())
except (TypeError, ValueError) as e:
raise Exception('Data received was not in JSON format')
return doc
while True:
csock, client_address = sock.accept()
try:
doc = recv(csock)
print("%s %s" % (doc["app"], doc["argv"]), file=sys.stderr)
oldenv = {}
for name in doc["env"].keys():
oldenv[name] = os.environ.get(name, None)
os.environ[name] = doc["env"][name]
try:
old_stdout = sys.stdout
old_stderr = sys.stderr
my_stdout = sys.stdout = StringIO()
my_stderr = sys.stderr = StringIO()
class Exit(BaseException):
def __init__(self, status):
self.status = status
def noexit(stat):
raise Exit(stat)
sys.exit = noexit
if doc["app"] == "openstack":
sh = osc_shell.OpenStackShell()
ret = sh.run(doc["argv"])
else:
print("Unknown application %s" % doc["app"], file=sys.stderr)
ret = 1
except Exit as e:
ret = e.status
finally:
sys.stdout = old_stdout
sys.stderr = old_stderr
for name in oldenv.keys():
if oldenv[name] is None:
del os.environ[name]
else:
os.environ[name] = oldenv[name]
send(csock, {
"stdout": my_stdout.getvalue(),
"stderr": my_stderr.getvalue(),
"status": ret,
})
except BaseException as e:
print(e, file=sys.stderr)
finally:
csock.close()
+1
View File
@@ -0,0 +1 @@
dnsmasq
+3
View File
@@ -0,0 +1,3 @@
ceph # NOPRIME
lsb
xfsprogs
+3
View File
@@ -0,0 +1,3 @@
lvm2
qemu-tools
tgt # NOPRIME
+1
View File
@@ -0,0 +1 @@
dstat
+34
View File
@@ -0,0 +1,34 @@
apache2
apache2-devel
bc
ca-certificates-mozilla
curl
gawk
gcc
gcc-c++
git-core
graphviz # docs
iputils
libffi-devel # pyOpenSSL
libjpeg8-devel # Pillow 3.0.0
libopenssl-devel # to rebuild pyOpenSSL if needed
libxslt-devel # lxml
lsof # useful when debugging
make
net-tools
openssh
openssl
pcre-devel # python-pcre
postgresql-devel # psycopg2
psmisc
python3-systemd
python-cmd2 # dist:opensuse-12.3
python-devel # pyOpenSSL
python-xml
tar
tcpdump
unzip
util-linux
wget
which
zlib-devel
+2
View File
@@ -0,0 +1,2 @@
apache2-mod_wsgi # NOPRIME
apache2 # NOPRIME
+4
View File
@@ -0,0 +1,4 @@
cyrus-sasl-devel
memcached
openldap2-devel
sqlite3
+3
View File
@@ -0,0 +1,3 @@
openldap2
openldap2-client
python-ldap
+1
View File
@@ -0,0 +1 @@
python-dateutil
+10
View File
@@ -0,0 +1,10 @@
cdrkit-cdrtools-compat # dist:sle12
cryptsetup
dosfstools
libosinfo
lvm2
mkisofs # not:sle12
open-iscsi
sg3_utils
# Stuff for diablo volumes
sysfsutils
+1
View File
@@ -0,0 +1 @@
ipset
+12
View File
@@ -0,0 +1,12 @@
acl
dnsmasq
dnsmasq-utils # dist:opensuse-12.3,opensuse-13.1
ebtables
haproxy # to serve as metadata proxy inside router/dhcp namespaces
iptables
iputils
rabbitmq-server # NOPRIME
radvd # NOPRIME
sqlite3
sudo
vlan
+2
View File
@@ -0,0 +1,2 @@
conntrack-tools
keepalived
+21
View File
@@ -0,0 +1,21 @@
cdrkit-cdrtools-compat # dist:sle12
conntrack-tools
curl
ebtables
iptables
iputils
kpartx
kvm # NOPRIME
libvirt # NOPRIME
libvirt-python # NOPRIME
# mkisofs is required for config_drive
mkisofs # not:sle12
parted
polkit
# qemu as fallback if kvm cannot be used
qemu # NOPRIME
rabbitmq-server # NOPRIME
socat
sqlite3
sudo
vlan
+3
View File
@@ -0,0 +1,3 @@
openvswitch
openvswitch-switch
+2
View File
@@ -0,0 +1,2 @@
lsscsi
open-iscsi
+1
View File
@@ -0,0 +1 @@
neutron-agent
+1
View File
@@ -0,0 +1 @@
neutron-l3
+6
View File
@@ -0,0 +1,6 @@
curl
liberasurecode-devel
memcached
sqlite3
xfsprogs
xinetd
+1 -1
View File
@@ -1,3 +1,3 @@
ceph # NOPRIME
redhat-lsb-core # not:rhel9,openEuler-22.03
redhat-lsb-core # not:rhel9
xfsprogs
+2 -4
View File
@@ -6,11 +6,9 @@ gcc
gcc-c++
gettext # used for compiling message catalogs
git-core
glibc-langpack-en # dist:rhel9
graphviz # needed only for docs
httpd
httpd-devel
iptables-nft # dist:rhel9
iptables-services
java-1.8.0-openjdk-headless
libffi-devel
@@ -28,9 +26,9 @@ pkgconfig
postgresql-devel # psycopg2
psmisc
python3-devel
python3-pip # not:openEuler-22.03
python3-pip
python3-systemd
redhat-rpm-config # not:openEuler-22.03 missing dep for gcc hardening flags, see rhbz#1217376
redhat-rpm-config # missing dep for gcc hardening flags, see rhbz#1217376
tar
tcpdump
unzip
+1 -1
View File
@@ -4,7 +4,7 @@ ebtables
genisoimage # not:rhel9 required for config_drive
iptables
iputils
kernel-modules # not:openEuler-22.03
kernel-modules
kpartx
parted
polkit
+1 -1
View File
@@ -4,4 +4,4 @@ memcached
rsync-daemon
sqlite
xfsprogs
xinetd # not:f36,rhel9
xinetd # not:f35,rhel9
+8 -24
View File
@@ -118,7 +118,7 @@ function _upload_image {
useimport="--import"
fi
openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name" --public --container-format "$container" --disk-format "$disk" $useimport $properties --file $(readlink -f "${image}")
openstack --os-cloud=devstack-admin --os-region-name="$REGION_NAME" image create "$image_name" --public --container-format "$container" --disk-format "$disk" $useimport $properties < "${image}"
}
# Retrieve an image from a URL and upload into Glance.
@@ -133,28 +133,17 @@ function upload_image {
local image image_fname image_name
local max_attempts=5
# Create a directory for the downloaded image tarballs.
mkdir -p $FILES/images
image_fname=`basename "$image_url"`
if [[ $image_url != file* ]]; then
# Downloads the image (uec ami+akistyle), then extracts it.
if [[ ! -f $FILES/$image_fname || "$(stat -c "%s" $FILES/$image_fname)" = "0" ]]; then
for attempt in `seq $max_attempts`; do
local rc=0
wget --progress=dot:giga -c $image_url -O $FILES/$image_fname || rc=$?
if [[ $rc -ne 0 ]]; then
if [[ "$attempt" -eq "$max_attempts" ]]; then
echo "Not found: $image_url"
return
fi
echo "Download failed, retrying in $attempt second, attempt: $attempt"
sleep $attempt
else
break
fi
done
wget --progress=dot:giga -c $image_url -O $FILES/$image_fname
if [[ $? -ne 0 ]]; then
echo "Not found: $image_url"
return
fi
fi
image="$FILES/${image_fname}"
else
@@ -425,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 --file $(readlink -f "$kernel") -f value -c id)
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 --file $(readlink -f "$ramdisk") -f value -c id)
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
@@ -694,8 +683,6 @@ function setup_colorized_logging {
iniset $conf_file DEFAULT logging_default_format_string "%(asctime)s.%(msecs)03d %(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s"
iniset $conf_file DEFAULT logging_debug_format_suffix "from (pid=%(process)d) %(funcName)s %(pathname)s:%(lineno)d"
iniset $conf_file DEFAULT logging_exception_prefix "%(color)s%(asctime)s.%(msecs)03d TRACE %(name)s %(instance)s"
# Enable or disable color for oslo.log
iniset $conf_file DEFAULT log_color $LOG_COLOR
}
function setup_systemd_logging {
@@ -717,9 +704,6 @@ function setup_systemd_logging {
iniset $conf_file DEFAULT logging_context_format_string "%(color)s%(levelname)s %(name)s [%(global_request_id)s %(request_id)s %(project_name)s %(user_name)s%(color)s] %(instance)s%(color)s%(message)s"
iniset $conf_file DEFAULT logging_default_format_string "%(color)s%(levelname)s %(name)s [-%(color)s] %(instance)s%(color)s%(message)s"
iniset $conf_file DEFAULT logging_exception_prefix "ERROR %(name)s %(instance)s"
# Enable or disable color for oslo.log
iniset $conf_file DEFAULT log_color $LOG_COLOR
}
function setup_standard_logging_identity {
+101 -91
View File
@@ -236,27 +236,6 @@ function trueorfalse {
$xtrace
}
# bool_to_int <True|False>
#
# Convert True|False to int 1 or 0
# This function can be used to convert the output of trueorfalse
# to an int follow c conventions where false is 0 and 1 it true.
function bool_to_int {
local xtrace
xtrace=$(set +o | grep xtrace)
set +o xtrace
if [ -z $1 ]; then
die $LINENO "Bool value required"
fi
if [[ $1 == "True" ]] ; then
echo '1'
else
echo '0'
fi
$xtrace
}
function isset {
[[ -v "$1" ]]
}
@@ -401,9 +380,9 @@ function warn {
# such as "install_package" further abstract things in better ways.
#
# ``os_VENDOR`` - vendor name: ``Ubuntu``, ``Fedora``, etc
# ``os_RELEASE`` - major release: ``22.04`` (Ubuntu), ``23`` (Fedora)
# ``os_RELEASE`` - major release: ``16.04`` (Ubuntu), ``23`` (Fedora)
# ``os_PACKAGE`` - package type: ``deb`` or ``rpm``
# ``os_CODENAME`` - vendor's codename for release: ``jammy``
# ``os_CODENAME`` - vendor's codename for release: ``xenial``
declare -g os_VENDOR os_RELEASE os_PACKAGE os_CODENAME
@@ -420,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
@@ -433,15 +412,12 @@ function _ensure_lsb_release {
# - os_VENDOR
# - os_PACKAGE
function GetOSVersion {
# CentOS Stream 9 and RHEL 9 do not provide lsb_release
# CentOS Stream 9 does not provide lsb_release
source /etc/os-release
if [[ "${ID}${VERSION}" == "centos9" ]] || [[ "${ID}${VERSION}" =~ "rhel9" ]]; then
if [[ "${ID}${VERSION}" == "centos9" ]]; then
os_RELEASE=${VERSION_ID}
os_CODENAME="n/a"
os_VENDOR=$(echo $NAME | tr -d '[:space:]')
elif [[ "${ID}${VERSION}" =~ "rocky9" ]]; then
os_VENDOR="Rocky"
os_RELEASE=${VERSION_ID}
else
_ensure_lsb_release
@@ -475,18 +451,25 @@ function GetDistro {
elif [[ "$os_VENDOR" =~ (Fedora) ]]; then
# For Fedora, just use 'f' and the release
DISTRO="f$os_RELEASE"
elif is_opensuse; then
DISTRO="opensuse-$os_RELEASE"
# Tumbleweed uses "n/a" as a codename, and the release is a datestring
# like 20180218, so not very useful. Leap however uses a release
# with a "dot", so for example 15.0
[ "$os_CODENAME" = "n/a" -a "$os_RELEASE" = "${os_RELEASE/\./}" ] && \
DISTRO="opensuse-tumbleweed"
elif is_suse_linux_enterprise; then
# just use major release
DISTRO="sle${os_RELEASE%.*}"
elif [[ "$os_VENDOR" =~ (Red.*Hat) || \
"$os_VENDOR" =~ (CentOS) || \
"$os_VENDOR" =~ (AlmaLinux) || \
"$os_VENDOR" =~ (Scientific) || \
"$os_VENDOR" =~ (OracleServer) || \
"$os_VENDOR" =~ (Rocky) || \
"$os_VENDOR" =~ (Virtuozzo) ]]; then
# 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
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
@@ -530,7 +513,7 @@ function is_oraclelinux {
# Determine if current distribution is a Fedora-based distribution
# (Fedora, RHEL, CentOS, Rocky, etc).
# (Fedora, RHEL, CentOS, etc).
# is_fedora
function is_fedora {
if [[ -z "$os_VENDOR" ]]; then
@@ -538,17 +521,45 @@ function is_fedora {
fi
[ "$os_VENDOR" = "Fedora" ] || [ "$os_VENDOR" = "Red Hat" ] || \
[ "$os_VENDOR" = "openEuler" ] || \
[ "$os_VENDOR" = "RedHatEnterpriseServer" ] || \
[ "$os_VENDOR" = "RedHatEnterprise" ] || \
[ "$os_VENDOR" = "RedHatEnterpriseLinux" ] || \
[ "$os_VENDOR" = "Rocky" ] || \
[ "$os_VENDOR" = "CentOS" ] || [ "$os_VENDOR" = "CentOSStream" ] || \
[ "$os_VENDOR" = "AlmaLinux" ] || \
[ "$os_VENDOR" = "OracleServer" ] || [ "$os_VENDOR" = "Virtuozzo" ]
}
# Determine if current distribution is a SUSE-based distribution
# (openSUSE, SLE).
# is_suse
function is_suse {
is_opensuse || is_suse_linux_enterprise
}
# Determine if current distribution is an openSUSE distribution
# is_opensuse
function is_opensuse {
if [[ -z "$os_VENDOR" ]]; then
GetOSVersion
fi
[[ "$os_VENDOR" =~ (openSUSE) ]]
}
# Determine if current distribution is a SUSE Linux Enterprise (SLE)
# distribution
# is_suse_linux_enterprise
function is_suse_linux_enterprise {
if [[ -z "$os_VENDOR" ]]; then
GetOSVersion
fi
[[ "$os_VENDOR" =~ (^SUSE) ]]
}
# Determine if current distribution is an Ubuntu-based distribution
# It will also detect non-Ubuntu but Debian-based distros
# is_ubuntu
@@ -559,14 +570,6 @@ function is_ubuntu {
[ "$os_PACKAGE" = "deb" ]
}
# Determine if current distribution is an openEuler distribution
# is_openeuler
function is_openeuler {
if [[ -z "$os_PACKAGE" ]]; then
GetOSVersion
fi
[ "$os_VENDOR" = "openEuler" ]
}
# Git Functions
# =============
@@ -771,7 +774,7 @@ function get_default_host_ip {
if [ -z "$host_ip" -o "$host_ip" == "dhcp" ]; then
host_ip=""
# Find the interface used for the default route
host_ip_iface=${host_ip_iface:-$(ip -f $af route list match default table all | grep via | awk '/default/ {print $5}' | head -1)}
host_ip_iface=${host_ip_iface:-$(ip -f $af route | awk '/default/ {print $5}' | head -1)}
local host_ips
host_ips=$(LC_ALL=C ip -f $af addr show ${host_ip_iface} | sed /temporary/d |awk /$af'/ {split($2,parts,"/"); print parts[1]}')
local ip
@@ -874,9 +877,14 @@ function policy_add {
# Usage: get_or_create_domain <name> <description>
function get_or_create_domain {
local domain_id
# Gets domain id
domain_id=$(
# Gets domain id
openstack --os-cloud devstack-system-admin domain show $1 \
-f value -c id 2>/dev/null ||
# Creates new domain
openstack --os-cloud devstack-system-admin domain create $1 \
--description "$2" --or-show \
--description "$2" \
-f value -c id
)
echo $domain_id
@@ -965,22 +973,29 @@ function _get_domain_args {
# Usage: get_or_add_user_project_role <role> <user> <project> [<user_domain> <project_domain>]
function get_or_add_user_project_role {
local user_role_id
local domain_args
domain_args=$(_get_domain_args $4 $5)
# Note this is idempotent so we are safe across multiple
# duplicate calls.
openstack --os-cloud devstack-system-admin role add $1 \
--user $2 \
--project $3 \
$domain_args
# Gets user role id
user_role_id=$(openstack --os-cloud devstack-system-admin role assignment list \
--role $1 \
--user $2 \
--project $3 \
$domain_args \
-c Role -f value)
| grep '^|\s[a-f0-9]\+' | get_field 1)
if [[ -z "$user_role_id" ]]; then
# Adds role to user and get it
openstack --os-cloud devstack-system-admin role add $1 \
--user $2 \
--project $3 \
$domain_args
user_role_id=$(openstack --os-cloud devstack-system-admin role assignment list \
--role $1 \
--user $2 \
--project $3 \
$domain_args \
| grep '^|\s[a-f0-9]\+' | get_field 1)
fi
echo $user_role_id
}
@@ -988,18 +1003,23 @@ function get_or_add_user_project_role {
# Usage: get_or_add_user_domain_role <role> <user> <domain>
function get_or_add_user_domain_role {
local user_role_id
# Note this is idempotent so we are safe across multiple
# duplicate calls.
openstack --os-cloud devstack-system-admin role add $1 \
--user $2 \
--domain $3
# Gets user role id
user_role_id=$(openstack --os-cloud devstack-system-admin role assignment list \
--role $1 \
--user $2 \
--domain $3 \
-c Role -f value)
| grep '^|\s[a-f0-9]\+' | get_field 1)
if [[ -z "$user_role_id" ]]; then
# Adds role to user and get it
openstack --os-cloud devstack-system-admin role add $1 \
--user $2 \
--domain $3
user_role_id=$(openstack --os-cloud devstack-system-admin role assignment list \
--role $1 \
--user $2 \
--domain $3 \
| grep '^|\s[a-f0-9]\+' | get_field 1)
fi
echo $user_role_id
}
@@ -1038,18 +1058,23 @@ function get_or_add_user_system_role {
# Usage: get_or_add_group_project_role <role> <group> <project>
function get_or_add_group_project_role {
local group_role_id
# Note this is idempotent so we are safe across multiple
# duplicate calls.
openstack role add $1 \
--group $2 \
--project $3
# Gets group role id
group_role_id=$(openstack --os-cloud devstack-system-admin role assignment list \
--role $1 \
--group $2 \
--project $3 \
-f value -c Role)
-f value)
if [[ -z "$group_role_id" ]]; then
# Adds role to group and get it
openstack --os-cloud devstack-system-admin role add $1 \
--group $2 \
--project $3
group_role_id=$(openstack --os-cloud devstack-system-admin role assignment list \
--role $1 \
--group $2 \
--project $3 \
-f value)
fi
echo $group_role_id
}
@@ -1135,12 +1160,6 @@ function is_ironic_enforce_scope {
return 1
}
function is_ironic_sharded {
# todo(JayF): Support >1 shard with multiple n-cpu instances for each
is_service_enabled ironic && [[ "$IRONIC_SHARDS" == "1" ]] && return 0
return 1
}
# Package Functions
# =================
@@ -1157,6 +1176,8 @@ function _get_package_dir {
pkg_dir=$base_dir/debs
elif is_fedora; then
pkg_dir=$base_dir/rpms
elif is_suse; then
pkg_dir=$base_dir/rpms-suse
else
exit_distro_not_supported "list of packages"
fi
@@ -1431,6 +1452,8 @@ function real_install_package {
apt_get install "$@"
elif is_fedora; then
yum_install "$@"
elif is_suse; then
zypper_install "$@"
else
exit_distro_not_supported "installing packages"
fi
@@ -1472,6 +1495,8 @@ function uninstall_package {
apt_get purge "$@"
elif is_fedora; then
sudo dnf remove -y "$@" ||:
elif is_suse; then
sudo zypper remove -y "$@" ||:
else
exit_distro_not_supported "uninstalling packages"
fi
@@ -1549,7 +1574,6 @@ function write_user_unit_file {
mkdir -p $SYSTEMD_DIR
iniset -sudo $unitfile "Unit" "Description" "Devstack $service"
iniset -sudo $unitfile "Service" "Environment" "\"PATH=$PATH\""
iniset -sudo $unitfile "Service" "User" "$user"
iniset -sudo $unitfile "Service" "ExecStart" "$command"
iniset -sudo $unitfile "Service" "KillMode" "process"
@@ -1577,7 +1601,6 @@ function write_uwsgi_user_unit_file {
mkdir -p $SYSTEMD_DIR
iniset -sudo $unitfile "Unit" "Description" "Devstack $service"
iniset -sudo $unitfile "Service" "Environment" "\"PATH=$PATH\""
iniset -sudo $unitfile "Service" "SyslogIdentifier" "$service"
iniset -sudo $unitfile "Service" "User" "$user"
iniset -sudo $unitfile "Service" "ExecStart" "$command"
@@ -1643,9 +1666,6 @@ function _run_under_systemd {
fi
local env_vars="$5"
if [[ "$command" =~ "uwsgi" ]] ; then
if [[ "$GLOBAL_VENV" == "True" ]] ; then
cmd="$cmd --venv $DEVSTACK_VENV"
fi
write_uwsgi_user_unit_file $systemd_service "$cmd" "$group" "$user" "$env_vars"
else
write_user_unit_file $systemd_service "$cmd" "$group" "$user" "$env_vars"
@@ -2438,11 +2458,6 @@ function time_stop {
_TIME_TOTAL[$name]=$(($total + $elapsed_time))
}
function install_openstack_cli_server {
export PATH=$TOP_DIR/files/openstack-cli-server:$PATH
run_process openstack-cli-server "$PYTHON $TOP_DIR/files/openstack-cli-server/openstack-cli-server"
}
function oscwrap {
local xtrace
xtrace=$(set +o | grep xtrace)
@@ -2538,11 +2553,6 @@ function clean_pyc_files {
fi
}
function is_fips_enabled {
fips=`cat /proc/sys/crypto/fips_enabled`
[ "$fips" == "1" ]
}
# Restore xtrace
$_XTRACE_FUNCTIONS_COMMON
+8 -41
View File
@@ -7,6 +7,7 @@
# External functions used:
# - GetOSVersion
# - is_fedora
# - is_suse
# - safe_chown
# Save trace setting
@@ -32,26 +33,6 @@ function join_extras {
# Python Functions
# ================
# Setup the global devstack virtualenvs and the associated environment
# updates.
function setup_devstack_virtualenv {
# We run devstack out of a global virtualenv.
if [[ ! -d $DEVSTACK_VENV ]] ; then
# Using system site packages to enable nova to use libguestfs.
# This package is currently installed via the distro and not
# available on pypi.
python$PYTHON3_VERSION -m venv --system-site-packages $DEVSTACK_VENV
pip_install -U pip setuptools
#NOTE(rpittau): workaround for simplejson removal in osc
# https://review.opendev.org/c/openstack/python-openstackclient/+/920001
pip_install -U simplejson
fi
if [[ ":$PATH:" != *":$DEVSTACK_VENV/bin:"* ]] ; then
export PATH="$DEVSTACK_VENV/bin:$PATH"
export PYTHON="$DEVSTACK_VENV/bin/python3"
fi
}
# Get the path to the pip command.
# get_pip_command
function get_pip_command {
@@ -80,11 +61,9 @@ function get_python_exec_prefix {
fi
$xtrace
if [[ "$GLOBAL_VENV" == "True" ]] ; then
echo "$DEVSTACK_VENV/bin"
else
echo "/usr/local/bin"
fi
local PYTHON_PATH=/usr/local/bin
is_suse && PYTHON_PATH=/usr/bin
echo $PYTHON_PATH
}
# Wrapper for ``pip install`` that only installs versions of libraries
@@ -189,14 +168,6 @@ function pip_install {
if [[ -n ${PIP_VIRTUAL_ENV:=} && -d ${PIP_VIRTUAL_ENV} ]]; then
local cmd_pip=$PIP_VIRTUAL_ENV/bin/pip
local sudo_pip="env"
elif [[ "${GLOBAL_VENV}" == "True" && -d ${DEVSTACK_VENV} ]] ; then
# We have to check that the DEVSTACK_VENV exists because early
# devstack boostrapping needs to operate in a system context
# too bootstrap pip. Once pip is bootstrapped we create the
# global venv and can start to use it.
local cmd_pip=$DEVSTACK_VENV/bin/pip
local sudo_pip="env"
echo "Using python $PYTHON3_VERSION to install $package_dir"
else
local cmd_pip="python$PYTHON3_VERSION -m pip"
# See
@@ -408,9 +379,6 @@ function _setup_package_with_constraints_edit {
# source we are about to do.
local name
name=$(awk '/^name.*=/ {print $3}' $project_dir/setup.cfg)
if [ -z $name ]; then
name=$(awk '/^name =/ {gsub(/"/, "", $3); print $3}' $project_dir/pyproject.toml)
fi
$REQUIREMENTS_DIR/.venv/bin/edit-constraints \
$REQUIREMENTS_DIR/upper-constraints.txt -- $name
fi
@@ -473,11 +441,8 @@ function setup_package {
pip_install $flags "$project_dir$extras"
# ensure that further actions can do things like setup.py sdist
if [[ "$flags" == "-e" && "$GLOBAL_VENV" == "False" ]]; then
# egg-info is not created when project have pyproject.toml
if [ -d $1/*.egg-info ]; then
safe_chown -R $STACK_USER $1/*.egg-info
fi
if [[ "$flags" == "-e" ]]; then
safe_chown -R $STACK_USER $1/*.egg-info
fi
}
@@ -497,6 +462,8 @@ function install_python {
function install_python3 {
if is_ubuntu; then
apt_get install python${PYTHON3_VERSION} python${PYTHON3_VERSION}-dev
elif is_suse; then
install_package python3-devel python3-dbm
elif is_fedora; then
if [ "$os_VENDOR" = "Fedora" ]; then
install_package python${PYTHON3_VERSION//.}
-5
View File
@@ -60,11 +60,6 @@ function configure_rootwrap {
sudo install -o root -g root -m 644 $rootwrap_conf_src_dir/rootwrap.conf /etc/${project}/rootwrap.conf
sudo sed -e "s:^filters_path=.*$:filters_path=/etc/${project}/rootwrap.d:" -i /etc/${project}/rootwrap.conf
# Rely on $PATH set by devstack to determine what is safe to execute
# by rootwrap rather than use explicit whitelist of paths in
# rootwrap.conf
sudo sed -e 's/^exec_dirs=.*/#&/' -i /etc/${project}/rootwrap.conf
# Set up the rootwrap sudoers
local tempfile
tempfile=$(mktemp)
+71 -87
View File
@@ -44,6 +44,10 @@ elif is_fedora; then
APACHE_NAME=httpd
APACHE_CONF_DIR=${APACHE_CONF_DIR:-/etc/$APACHE_NAME/conf.d}
APACHE_SETTINGS_DIR=${APACHE_SETTINGS_DIR:-/etc/$APACHE_NAME/conf.d}
elif is_suse; then
APACHE_NAME=apache2
APACHE_CONF_DIR=${APACHE_CONF_DIR:-/etc/$APACHE_NAME/vhosts.d}
APACHE_SETTINGS_DIR=${APACHE_SETTINGS_DIR:-/etc/$APACHE_NAME/conf.d}
fi
APACHE_LOG_DIR="/var/log/${APACHE_NAME}"
@@ -61,6 +65,11 @@ function enable_apache_mod {
sudo a2enmod $mod
restart_apache_server
fi
elif is_suse; then
if ! a2enmod -q $mod ; then
sudo a2enmod $mod
restart_apache_server
fi
elif is_fedora; then
# pass
true
@@ -86,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 =~ f36 ]]; 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:
@@ -95,6 +104,10 @@ function install_apache_uwsgi {
# Thus there is nothing else to do after this install
install_package uwsgi \
uwsgi-plugin-python3
elif [[ $os_VENDOR =~ openSUSE ]]; then
install_package uwsgi \
uwsgi-python3 \
apache2-mod_uwsgi
else
# Compile uwsgi from source.
local dir
@@ -112,7 +125,7 @@ function install_apache_uwsgi {
sudo rm -rf $dir
fi
if is_ubuntu; then
if is_ubuntu || is_suse ; then
# we've got to enable proxy and proxy_uwsgi for this to work
sudo a2enmod proxy
sudo a2enmod proxy_uwsgi
@@ -137,13 +150,13 @@ function install_apache_wsgi {
elif is_fedora; then
sudo rm -f /etc/httpd/conf.d/000-*
install_package httpd python3-mod_wsgi
# rpm distros dont enable httpd by default so enable it to support reboots.
sudo systemctl enable httpd
# For consistency with Ubuntu, switch to the worker mpm, as
# the default is event
sudo sed -i '/mod_mpm_prefork.so/s/^/#/g' /etc/httpd/conf.modules.d/00-mpm.conf
sudo sed -i '/mod_mpm_event.so/s/^/#/g' /etc/httpd/conf.modules.d/00-mpm.conf
sudo sed -i '/mod_mpm_worker.so/s/^#//g' /etc/httpd/conf.modules.d/00-mpm.conf
elif is_suse; then
install_package apache2 apache2-mod_wsgi
else
exit_distro_not_supported "apache wsgi installation"
fi
@@ -158,7 +171,7 @@ function install_apache_wsgi {
# recognise it. a2ensite and a2dissite ignore the .conf suffix used as parameter. The default sites'
# files are 000-default.conf and default-ssl.conf.
#
# On Fedora, any file in /etc/httpd/conf.d/ whose name ends with .conf is enabled.
# On Fedora and openSUSE, any file in /etc/httpd/conf.d/ whose name ends with .conf is enabled.
#
# On RHEL and CentOS, things should hopefully work as in Fedora.
#
@@ -174,7 +187,7 @@ function apache_site_config_for {
if is_ubuntu; then
# Ubuntu 14.04 - Apache 2.4
echo $APACHE_CONF_DIR/${site}.conf
elif is_fedora; then
elif is_fedora || is_suse; then
# fedora conf.d is only imported if it ends with .conf so this is approx the same
local enabled_site_file="$APACHE_CONF_DIR/${site}.conf"
if [ -f $enabled_site_file ]; then
@@ -192,7 +205,7 @@ function enable_apache_site {
enable_apache_mod version
if is_ubuntu; then
sudo a2ensite ${site}
elif is_fedora; then
elif is_fedora || is_suse; then
local enabled_site_file="$APACHE_CONF_DIR/${site}.conf"
# Do nothing if site already enabled or no site config exists
if [[ -f ${enabled_site_file}.disabled ]] && [[ ! -f ${enabled_site_file} ]]; then
@@ -206,7 +219,7 @@ function disable_apache_site {
local site=$@
if is_ubuntu; then
sudo a2dissite ${site} || true
elif is_fedora; then
elif is_fedora || is_suse; then
local enabled_site_file="$APACHE_CONF_DIR/${site}.conf"
# Do nothing if no site config exists
if [[ -f ${enabled_site_file} ]]; then
@@ -237,17 +250,13 @@ function restart_apache_server {
restart_service $APACHE_NAME
}
# write_uwsgi_config() - Create a new uWSGI config file
function write_uwsgi_config {
local conf=$1
local file=$1
local wsgi=$2
local url=$3
local http=$4
local name=$5
if [ -z "$name" ]; then
name=$(basename $wsgi)
fi
local name=""
name=$(basename $wsgi)
# create a home for the sockets; note don't use /tmp -- apache has
# a private view of it on some platforms.
@@ -262,47 +271,39 @@ function write_uwsgi_config {
local socket="$socket_dir/${name}.socket"
# always cleanup given that we are using iniset here
rm -rf $conf
# Set either the module path or wsgi script path depending on what we've
# been given. Note that the regex isn't exhaustive - neither Python modules
# nor Python variables can start with a number - but it's "good enough"
if [[ "$wsgi" =~ ^[a-zA-Z0-9_.]+:[a-zA-Z0-9_]+$ ]]; then
iniset "$conf" uwsgi module "$wsgi"
else
deprecated 'Configuring uWSGI with a WSGI file is deprecated, use module paths instead'
iniset "$conf" uwsgi wsgi-file "$wsgi"
fi
iniset "$conf" uwsgi processes $API_WORKERS
rm -rf $file
iniset "$file" uwsgi wsgi-file "$wsgi"
iniset "$file" uwsgi processes $API_WORKERS
# This is running standalone
iniset "$conf" uwsgi master true
iniset "$file" uwsgi master true
# Set die-on-term & exit-on-reload so that uwsgi shuts down
iniset "$conf" uwsgi die-on-term true
iniset "$conf" uwsgi exit-on-reload false
iniset "$file" uwsgi die-on-term true
iniset "$file" uwsgi exit-on-reload false
# Set worker-reload-mercy so that worker will not exit till the time
# configured after graceful shutdown
iniset "$conf" uwsgi worker-reload-mercy $WORKER_TIMEOUT
iniset "$conf" uwsgi enable-threads true
iniset "$conf" uwsgi plugins http,python3
iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT
iniset "$file" uwsgi enable-threads true
iniset "$file" uwsgi plugins http,python3
# uwsgi recommends this to prevent thundering herd on accept.
iniset "$conf" uwsgi thunder-lock true
iniset "$file" uwsgi thunder-lock true
# Set hook to trigger graceful shutdown on SIGTERM
iniset "$conf" uwsgi hook-master-start "unix_signal:15 gracefully_kill_them_all"
iniset "$file" uwsgi hook-master-start "unix_signal:15 gracefully_kill_them_all"
# Override the default size for headers from the 4k default.
iniset "$conf" uwsgi buffer-size 65535
iniset "$file" uwsgi buffer-size 65535
# Make sure the client doesn't try to re-use the connection.
iniset "$conf" uwsgi add-header "Connection: close"
iniset "$file" uwsgi add-header "Connection: close"
# This ensures that file descriptors aren't shared between processes.
iniset "$conf" uwsgi lazy-apps true
iniset "$file" uwsgi lazy-apps true
# If we said bind directly to http, then do that and don't start the apache proxy
if [[ -n "$http" ]]; then
iniset "$conf" uwsgi http $http
iniset "$file" uwsgi http $http
else
local apache_conf=""
apache_conf=$(apache_site_config_for $name)
iniset "$conf" uwsgi socket "$socket"
iniset "$conf" uwsgi chmod-socket 666
echo "ProxyPass \"${url}\" \"unix:${socket}|uwsgi://uwsgi-uds-${name}\" retry=0 acquire=1 " | sudo tee -a $apache_conf
iniset "$file" uwsgi socket "$socket"
iniset "$file" uwsgi chmod-socket 666
echo "ProxyPass \"${url}\" \"unix:${socket}|uwsgi://uwsgi-uds-${name}\" retry=0 " | sudo tee -a $apache_conf
enable_apache_site $name
restart_apache_server
fi
@@ -315,58 +316,47 @@ function write_uwsgi_config {
# but that involves having apache buffer the request before sending it to
# uwsgi.
function write_local_uwsgi_http_config {
local conf=$1
local file=$1
local wsgi=$2
local url=$3
local name=$4
if [ -z "$name" ]; then
name=$(basename $wsgi)
fi
name=$(basename $wsgi)
# create a home for the sockets; note don't use /tmp -- apache has
# a private view of it on some platforms.
# always cleanup given that we are using iniset here
rm -rf $conf
# Set either the module path or wsgi script path depending on what we've
# been given
if [[ "$wsgi" =~ ^[a-zA-Z0-9_.]+:[a-zA-Z0-9_]+$ ]]; then
iniset "$conf" uwsgi module "$wsgi"
else
deprecated 'Configuring uWSGI with a WSGI file is deprecated, use module paths instead'
iniset "$conf" uwsgi wsgi-file "$wsgi"
fi
rm -rf $file
iniset "$file" uwsgi wsgi-file "$wsgi"
port=$(get_random_port)
iniset "$conf" uwsgi http-socket "$APACHE_LOCAL_HOST:$port"
iniset "$conf" uwsgi processes $API_WORKERS
iniset "$file" uwsgi http-socket "$APACHE_LOCAL_HOST:$port"
iniset "$file" uwsgi processes $API_WORKERS
# This is running standalone
iniset "$conf" uwsgi master true
iniset "$file" uwsgi master true
# Set die-on-term & exit-on-reload so that uwsgi shuts down
iniset "$conf" uwsgi die-on-term true
iniset "$conf" uwsgi exit-on-reload false
iniset "$file" uwsgi die-on-term true
iniset "$file" uwsgi exit-on-reload false
iniset "$file" uwsgi enable-threads true
iniset "$file" uwsgi plugins http,python3
# uwsgi recommends this to prevent thundering herd on accept.
iniset "$file" uwsgi thunder-lock true
# Set hook to trigger graceful shutdown on SIGTERM
iniset "$file" uwsgi hook-master-start "unix_signal:15 gracefully_kill_them_all"
# Set worker-reload-mercy so that worker will not exit till the time
# configured after graceful shutdown
iniset "$conf" uwsgi worker-reload-mercy $WORKER_TIMEOUT
iniset "$conf" uwsgi enable-threads true
iniset "$conf" uwsgi plugins http,python3
# uwsgi recommends this to prevent thundering herd on accept.
iniset "$conf" uwsgi thunder-lock true
# Set hook to trigger graceful shutdown on SIGTERM
iniset "$conf" uwsgi hook-master-start "unix_signal:15 gracefully_kill_them_all"
iniset "$file" uwsgi worker-reload-mercy $WORKER_TIMEOUT
# Override the default size for headers from the 4k default.
iniset "$conf" uwsgi buffer-size 65535
iniset "$file" uwsgi buffer-size 65535
# Make sure the client doesn't try to re-use the connection.
iniset "$conf" uwsgi add-header "Connection: close"
iniset "$file" uwsgi add-header "Connection: close"
# This ensures that file descriptors aren't shared between processes.
iniset "$conf" uwsgi lazy-apps true
iniset "$conf" uwsgi chmod-socket 666
iniset "$conf" uwsgi http-raw-body true
iniset "$conf" uwsgi http-chunked-input true
iniset "$conf" uwsgi http-auto-chunked true
iniset "$conf" uwsgi http-keepalive false
iniset "$file" uwsgi lazy-apps true
iniset "$file" uwsgi chmod-socket 666
iniset "$file" uwsgi http-raw-body true
iniset "$file" uwsgi http-chunked-input true
iniset "$file" uwsgi http-auto-chunked true
iniset "$file" uwsgi http-keepalive false
# Increase socket timeout for slow chunked uploads
iniset "$conf" uwsgi socket-timeout 30
iniset "$file" uwsgi socket-timeout 30
enable_apache_mod proxy
enable_apache_mod proxy_http
@@ -374,7 +364,7 @@ function write_local_uwsgi_http_config {
apache_conf=$(apache_site_config_for $name)
echo "KeepAlive Off" | sudo tee $apache_conf
echo "SetEnv proxy-sendchunked 1" | sudo tee -a $apache_conf
echo "ProxyPass \"${url}\" \"http://$APACHE_LOCAL_HOST:$port\" retry=0 acquire=1 " | sudo tee -a $apache_conf
echo "ProxyPass \"${url}\" \"http://$APACHE_LOCAL_HOST:$port\" retry=0 " | sudo tee -a $apache_conf
enable_apache_site $name
restart_apache_server
}
@@ -393,24 +383,18 @@ function write_local_proxy_http_config {
echo "KeepAlive Off" | sudo tee $apache_conf
echo "SetEnv proxy-sendchunked 1" | sudo tee -a $apache_conf
echo "ProxyPass \"${loc}\" \"$url\" retry=0 acquire=1 " | sudo tee -a $apache_conf
echo "ProxyPass \"${loc}\" \"$url\" retry=0 " | sudo tee -a $apache_conf
enable_apache_site $name
restart_apache_server
}
function remove_uwsgi_config {
local conf=$1
local file=$1
local wsgi=$2
local name=""
# TODO(stephenfin): Remove this call when everyone is using module path
# configuration instead of file path configuration
name=$(basename $wsgi)
if [[ "$wsgi" = /* ]]; then
deprecated "Passing a wsgi script to remove_uwsgi_config is deprecated, pass an application name instead"
fi
rm -rf $conf
rm -rf $file
disable_apache_site $name
}
+49 -153
View File
@@ -43,13 +43,6 @@ GITDIR["python-cinderclient"]=$DEST/python-cinderclient
GITDIR["python-brick-cinderclient-ext"]=$DEST/python-brick-cinderclient-ext
CINDER_DIR=$DEST/cinder
if [[ $SERVICE_IP_VERSION == 6 ]]; then
CINDER_MY_IP="$HOST_IPV6"
else
CINDER_MY_IP="$HOST_IP"
fi
# Cinder virtual environment
if [[ ${USE_VENV} = True ]]; then
PROJECT_VENV["cinder"]=${CINDER_DIR}.venv
@@ -76,11 +69,6 @@ CINDER_SERVICE_PORT_INT=${CINDER_SERVICE_PORT_INT:-18776}
CINDER_SERVICE_PROTOCOL=${CINDER_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
CINDER_SERVICE_LISTEN_ADDRESS=${CINDER_SERVICE_LISTEN_ADDRESS:-$(ipv6_unquote $SERVICE_LISTEN_ADDRESS)}
# We do not need to report service status every 10s for devstack-like
# deployments. In the gate this generates extra work for the services and the
# database which are already taxed.
CINDER_SERVICE_REPORT_INTERVAL=${CINDER_SERVICE_REPORT_INTERVAL:-120}
# What type of LVM device should Cinder use for LVM backend
# Defaults to auto, which will do thin provisioning if it's a fresh
# volume group, otherwise it will do thick. The other valid choices are
@@ -88,10 +76,6 @@ CINDER_SERVICE_REPORT_INTERVAL=${CINDER_SERVICE_REPORT_INTERVAL:-120}
# thin provisioning.
CINDER_LVM_TYPE=${CINDER_LVM_TYPE:-auto}
# ``CINDER_USE_SERVICE_TOKEN`` is a mode where service token is passed along with
# user token while communicating to external REST APIs like Glance.
CINDER_USE_SERVICE_TOKEN=$(trueorfalse True CINDER_USE_SERVICE_TOKEN)
# Default backends
# The backend format is type:name where type is one of the supported backend
# types (lvm, nfs, etc) and name is the identifier used in the Cinder
@@ -104,33 +88,15 @@ CINDER_ENABLED_BACKENDS=${CINDER_ENABLED_BACKENDS:-lvm:lvmdriver-1}
CINDER_VOLUME_CLEAR=${CINDER_VOLUME_CLEAR:-${CINDER_VOLUME_CLEAR_DEFAULT:-zero}}
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}
if [[ -n "$CINDER_ISCSI_HELPER" ]]; then
if [[ -z "$CINDER_TARGET_HELPER" ]]; then
deprecated 'Using CINDER_ISCSI_HELPER is deprecated, use CINDER_TARGET_HELPER instead'
CINDER_TARGET_HELPER="$CINDER_ISCSI_HELPER"
else
deprecated 'Deprecated CINDER_ISCSI_HELPER is set, but is being overwritten by CINDER_TARGET_HELPER'
fi
fi
CINDER_TARGET_HELPER=${CINDER_TARGET_HELPER:-lioadm}
if [[ $CINDER_TARGET_HELPER == 'nvmet' ]]; then
CINDER_TARGET_PROTOCOL=${CINDER_TARGET_PROTOCOL:-'nvmet_rdma'}
CINDER_TARGET_PREFIX=${CINDER_TARGET_PREFIX:-'nvme-subsystem-1'}
CINDER_TARGET_PORT=${CINDER_TARGET_PORT:-4420}
else
CINDER_TARGET_PROTOCOL=${CINDER_TARGET_PROTOCOL:-'iscsi'}
CINDER_TARGET_PREFIX=${CINDER_TARGET_PREFIX:-'iqn.2010-10.org.openstack:'}
CINDER_TARGET_PORT=${CINDER_TARGET_PORT:-3260}
fi
# EL should only use lioadm
if is_fedora; then
if [[ ${CINDER_TARGET_HELPER} != "lioadm" && ${CINDER_TARGET_HELPER} != 'nvmet' ]]; then
die "lioadm and nvmet are the only valid Cinder target_helper config on this platform"
# EL and SUSE should only use lioadm
if is_fedora || is_suse; then
if [[ ${CINDER_ISCSI_HELPER} != "lioadm" ]]; then
die "lioadm is the only valid Cinder target_helper config on this platform"
fi
fi
@@ -187,12 +153,6 @@ fi
# Environment variables to configure the image-volume cache
CINDER_IMG_CACHE_ENABLED=${CINDER_IMG_CACHE_ENABLED:-True}
# Environment variables to configure the optimized volume upload
CINDER_UPLOAD_OPTIMIZED=${CINDER_UPLOAD_OPTIMIZED:-False}
# Environment variables to configure the internal tenant during optimized volume upload
CINDER_UPLOAD_INTERNAL_TENANT=${CINDER_UPLOAD_INTERNAL_TENANT:-False}
# For limits, if left unset, it will use cinder defaults of 0 for unlimited
CINDER_IMG_CACHE_SIZE_GB=${CINDER_IMG_CACHE_SIZE_GB:-}
CINDER_IMG_CACHE_SIZE_COUNT=${CINDER_IMG_CACHE_SIZE_COUNT:-}
@@ -202,11 +162,6 @@ CINDER_IMG_CACHE_SIZE_COUNT=${CINDER_IMG_CACHE_SIZE_COUNT:-}
# enable the cache for all cinder backends.
CINDER_CACHE_ENABLED_FOR_BACKENDS=${CINDER_CACHE_ENABLED_FOR_BACKENDS:-$CINDER_ENABLED_BACKENDS}
# Configure which cinder backends will have optimized volume upload, this takes the same
# form as the CINDER_ENABLED_BACKENDS config option. By default it will
# enable the cache for all cinder backends.
CINDER_UPLOAD_OPTIMIZED_BACKENDS=${CINDER_UPLOAD_OPTIMIZED_BACKENDS:-$CINDER_ENABLED_BACKENDS}
# Flag to set the oslo_policy.enforce_scope. This is used to switch
# the Volume API policies to start checking the scope of token. by default,
# this flag is False.
@@ -234,7 +189,7 @@ function _cinder_cleanup_apache_wsgi {
function cleanup_cinder {
# ensure the volume group is cleared up because fails might
# leave dead volumes in the group
if [ "$CINDER_TARGET_HELPER" = "tgtadm" ]; then
if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then
local targets
targets=$(sudo tgtadm --op show --mode target)
if [ $? -ne 0 ]; then
@@ -262,14 +217,8 @@ function cleanup_cinder {
else
stop_service tgtd
fi
elif [ "$CINDER_TARGET_HELPER" = "lioadm" ]; then
sudo cinder-rtstool get-targets | sudo xargs -rn 1 cinder-rtstool delete
elif [ "$CINDER_TARGET_HELPER" = "nvmet" ]; then
# If we don't disconnect everything vgremove will block
sudo nvme disconnect-all
sudo nvmetcli clear
else
die $LINENO "Unknown value \"$CINDER_TARGET_HELPER\" for CINDER_TARGET_HELPER"
sudo cinder-rtstool get-targets | sudo xargs -rn 1 cinder-rtstool delete
fi
if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then
@@ -290,7 +239,7 @@ function cleanup_cinder {
fi
stop_process "c-api"
remove_uwsgi_config "$CINDER_UWSGI_CONF" "cinder-wsgi"
remove_uwsgi_config "$CINDER_UWSGI_CONF" "$CINDER_UWSGI"
}
# configure_cinder() - Set config files, create data dirs, etc
@@ -320,7 +269,7 @@ function configure_cinder {
iniset $CINDER_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
iniset $CINDER_CONF DEFAULT target_helper "$CINDER_TARGET_HELPER"
iniset $CINDER_CONF DEFAULT target_helper "$CINDER_ISCSI_HELPER"
iniset $CINDER_CONF database connection `database_connection_url cinder`
iniset $CINDER_CONF DEFAULT api_paste_config $CINDER_API_PASTE_INI
iniset $CINDER_CONF DEFAULT rootwrap_config "$CINDER_CONF_DIR/rootwrap.conf"
@@ -328,7 +277,11 @@ function configure_cinder {
iniset $CINDER_CONF DEFAULT osapi_volume_listen $CINDER_SERVICE_LISTEN_ADDRESS
iniset $CINDER_CONF DEFAULT state_path $CINDER_STATE_PATH
iniset $CINDER_CONF oslo_concurrency lock_path $CINDER_STATE_PATH
iniset $CINDER_CONF DEFAULT my_ip "$CINDER_MY_IP"
if [[ $SERVICE_IP_VERSION == 6 ]]; then
iniset $CINDER_CONF DEFAULT my_ip "$HOST_IPV6"
else
iniset $CINDER_CONF DEFAULT my_ip "$HOST_IP"
fi
iniset $CINDER_CONF key_manager backend cinder.keymgr.conf_key_mgr.ConfKeyManager
iniset $CINDER_CONF key_manager fixed_key $(openssl rand -hex 16)
if [[ -n "$CINDER_ALLOWED_DIRECT_URL_SCHEMES" ]]; then
@@ -345,9 +298,6 @@ function configure_cinder {
# details and example failures.
iniset $CINDER_CONF DEFAULT rpc_response_timeout 120
iniset $CINDER_CONF DEFAULT report_interval $CINDER_SERVICE_REPORT_INTERVAL
iniset $CINDER_CONF DEFAULT service_down_time $(($CINDER_SERVICE_REPORT_INTERVAL * 6))
if is_service_enabled c-vol && [[ -n "$CINDER_ENABLED_BACKENDS" ]]; then
local enabled_backends=""
local default_name=""
@@ -368,14 +318,6 @@ function configure_cinder {
iniset $CINDER_CONF DEFAULT default_volume_type ${default_name}
fi
configure_cinder_image_volume_cache
# The upload optimization uses Cinder's clone volume functionality to
# clone the Image-Volume from source volume hence can only be
# performed when glance is using cinder as it's backend.
if [[ "$USE_CINDER_FOR_GLANCE" == "True" ]]; then
# Configure optimized volume upload
configure_cinder_volume_upload
fi
fi
if is_service_enabled c-bak && [[ -n "$CINDER_BACKUP_DRIVER" ]]; then
@@ -437,21 +379,12 @@ function configure_cinder {
if [[ ! -z "$CINDER_COORDINATION_URL" ]]; then
iniset $CINDER_CONF coordination backend_url "$CINDER_COORDINATION_URL"
elif is_service_enabled etcd3; then
# NOTE(jan.gutter): api_version can revert to default once tooz is
# updated with the etcd v3.4 defaults
iniset $CINDER_CONF coordination backend_url "etcd3+http://${SERVICE_HOST}:$ETCD_PORT?api_version=v3"
iniset $CINDER_CONF coordination backend_url "etcd3+http://${SERVICE_HOST}:$ETCD_PORT"
fi
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
else
iniset $CINDER_CONF oslo_policy enforce_scope false
iniset $CINDER_CONF oslo_policy enforce_new_defaults false
fi
if [ "$CINDER_USE_SERVICE_TOKEN" == "True" ]; then
init_cinder_service_user_conf
fi
}
@@ -476,19 +409,32 @@ function create_cinder_accounts {
create_service_user "cinder" $extra_role
local cinder_api_url
if [[ "$CINDER_USE_MOD_WSGI" == "False" ]]; then
cinder_api_url="$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT"
else
cinder_api_url="$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST/volume"
fi
# block-storage is the official service type
get_or_create_service "cinder" "block-storage" "Cinder Volume Service"
get_or_create_endpoint \
"block-storage" \
"$REGION_NAME" \
"$cinder_api_url/v3"
if [ "$CINDER_USE_MOD_WSGI" == "False" ]; then
get_or_create_endpoint \
"block-storage" \
"$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v3/\$(project_id)s"
get_or_create_service "cinderv3" "volumev3" "Cinder Volume Service V3"
get_or_create_endpoint \
"volumev3" \
"$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST:$CINDER_SERVICE_PORT/v3/\$(project_id)s"
else
get_or_create_endpoint \
"block-storage" \
"$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST/volume/v3/\$(project_id)s"
get_or_create_service "cinderv3" "volumev3" "Cinder Volume Service V3"
get_or_create_endpoint \
"volumev3" \
"$REGION_NAME" \
"$CINDER_SERVICE_PROTOCOL://$CINDER_SERVICE_HOST/volume/v3/\$(project_id)s"
fi
configure_cinder_internal_tenant
fi
}
@@ -529,9 +475,9 @@ function init_cinder {
function install_cinder {
git_clone $CINDER_REPO $CINDER_DIR $CINDER_BRANCH
setup_develop $CINDER_DIR
if [[ "$CINDER_TARGET_HELPER" == "tgtadm" ]]; then
if [[ "$CINDER_ISCSI_HELPER" == "tgtadm" ]]; then
install_package tgt
elif [[ "$CINDER_TARGET_HELPER" == "lioadm" ]]; then
elif [[ "$CINDER_ISCSI_HELPER" == "lioadm" ]]; then
if is_ubuntu; then
# TODO(frickler): Workaround for https://launchpad.net/bugs/1819819
sudo mkdir -p /etc/target
@@ -540,43 +486,6 @@ function install_cinder {
else
install_package targetcli
fi
elif [[ "$CINDER_TARGET_HELPER" == "nvmet" ]]; then
install_package nvme-cli
# TODO: Remove manual installation of the dependency when the
# requirement is added to nvmetcli:
# http://lists.infradead.org/pipermail/linux-nvme/2022-July/033576.html
if is_ubuntu; then
install_package python3-configshell-fb
else
install_package python3-configshell
fi
# Install from source because Ubuntu doesn't have the package and some packaged versions didn't work on Python 3
pip_install git+git://git.infradead.org/users/hch/nvmetcli.git
sudo modprobe nvmet
sudo modprobe nvme-fabrics
if [[ $CINDER_TARGET_PROTOCOL == 'nvmet_rdma' ]]; then
install_package rdma-core
sudo modprobe nvme-rdma
# Create the Soft-RoCE device over the networking interface
local iface=${HOST_IP_IFACE:-`ip -br -$SERVICE_IP_VERSION a | grep $CINDER_MY_IP | awk '{print $1}'`}
if [[ -z "$iface" ]]; then
die $LINENO "Cannot find interface to bind Soft-RoCE"
fi
if ! sudo rdma link | grep $iface ; then
sudo rdma link add rxe_$iface type rxe netdev $iface
fi
elif [[ $CINDER_TARGET_PROTOCOL == 'nvmet_tcp' ]]; then
sudo modprobe nvme-tcp
else # 'nvmet_fc'
sudo modprobe nvme-fc
fi
fi
}
@@ -613,13 +522,18 @@ function start_cinder {
service_port=$CINDER_SERVICE_PORT_INT
service_protocol="http"
fi
if [ "$CINDER_TARGET_HELPER" = "tgtadm" ]; then
if [ "$CINDER_ISCSI_HELPER" = "tgtadm" ]; then
if is_service_enabled c-vol; then
# Delete any old stack.conf
sudo rm -f /etc/tgt/conf.d/stack.conf
_configure_tgt_for_config_d
if is_ubuntu; then
sudo service tgt restart
elif is_suse; then
# NOTE(dmllr): workaround restart bug
# https://bugzilla.suse.com/show_bug.cgi?id=934642
stop_service tgtd
start_service tgtd
else
restart_service tgtd
fi
@@ -743,24 +657,6 @@ function configure_cinder_image_volume_cache {
done
}
function configure_cinder_volume_upload {
# Expect UPLOAD_VOLUME_OPTIMIZED_FOR_BACKENDS to be a list of backends
# similar to CINDER_ENABLED_BACKENDS with NAME:TYPE where NAME will
# be the backend specific configuration stanza in cinder.conf.
local be be_name
for be in ${CINDER_UPLOAD_OPTIMIZED_BACKENDS//,/ }; do
be_name=${be##*:}
iniset $CINDER_CONF $be_name image_upload_use_cinder_backend $CINDER_UPLOAD_OPTIMIZED
iniset $CINDER_CONF $be_name image_upload_use_internal_tenant $CINDER_UPLOAD_INTERNAL_TENANT
done
}
function init_cinder_service_user_conf {
configure_keystone_authtoken_middleware $CINDER_CONF cinder service_user
iniset $CINDER_CONF service_user send_service_user_token True
iniset $CINDER_CONF service_user auth_strategy keystone
}
# Restore xtrace
$_XTRACE_CINDER
+1 -1
View File
@@ -50,7 +50,7 @@ function configure_cinder_backend_lvm {
iniset $CINDER_CONF $be_name volume_backend_name $be_name
iniset $CINDER_CONF $be_name volume_driver "cinder.tests.fake_driver.FakeGateDriver"
iniset $CINDER_CONF $be_name volume_group $VOLUME_GROUP_NAME-$be_name
iniset $CINDER_CONF $be_name target_helper "$CINDER_TARGET_HELPER"
iniset $CINDER_CONF $be_name target_helper "$CINDER_ISCSI_HELPER"
iniset $CINDER_CONF $be_name lvm_type "$CINDER_LVM_TYPE"
if [[ "$CINDER_VOLUME_CLEAR" == "non" ]]; then
+1 -4
View File
@@ -50,10 +50,7 @@ function configure_cinder_backend_lvm {
iniset $CINDER_CONF $be_name volume_backend_name $be_name
iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.lvm.LVMVolumeDriver"
iniset $CINDER_CONF $be_name volume_group $VOLUME_GROUP_NAME-$be_name
iniset $CINDER_CONF $be_name target_helper "$CINDER_TARGET_HELPER"
iniset $CINDER_CONF $be_name target_protocol "$CINDER_TARGET_PROTOCOL"
iniset $CINDER_CONF $be_name target_port "$CINDER_TARGET_PORT"
iniset $CINDER_CONF $be_name target_prefix "$CINDER_TARGET_PREFIX"
iniset $CINDER_CONF $be_name target_helper "$CINDER_ISCSI_HELPER"
iniset $CINDER_CONF $be_name lvm_type "$CINDER_LVM_TYPE"
iniset $CINDER_CONF $be_name volume_clear "$CINDER_VOLUME_CLEAR"
}
-9
View File
@@ -32,15 +32,6 @@ function configure_cinder_backend_nfs {
iniset $CINDER_CONF $be_name volume_backend_name $be_name
iniset $CINDER_CONF $be_name volume_driver "cinder.volume.drivers.nfs.NfsDriver"
iniset $CINDER_CONF $be_name nfs_shares_config "$CINDER_CONF_DIR/nfs-shares-$be_name.conf"
iniset $CINDER_CONF $be_name nas_host localhost
iniset $CINDER_CONF $be_name nas_share_path ${NFS_EXPORT_DIR}
iniset $CINDER_CONF $be_name nas_secure_file_operations \
${NFS_SECURE_FILE_OPERATIONS}
iniset $CINDER_CONF $be_name nas_secure_file_permissions \
${NFS_SECURE_FILE_PERMISSIONS}
# NFS snapshot support is currently opt-in only.
iniset $CINDER_CONF $be_name nfs_snapshot_support True
echo "$CINDER_NFS_SERVERPATH" | tee "$CINDER_CONF_DIR/nfs-shares-$be_name.conf"
}
+23 -37
View File
@@ -20,7 +20,13 @@ if [[ -z "$MYSQL_SERVICE_NAME" ]]; then
MYSQL_SERVICE_NAME=mysql
if is_fedora && ! is_oraclelinux; then
MYSQL_SERVICE_NAME=mariadb
elif [[ "$DISTRO" =~ bookworm|bullseye ]]; then
elif is_suse && systemctl list-unit-files | grep -q 'mariadb\.service'; then
# Older mariadb packages on SLES 12 provided mysql.service. The
# newer ones on SLES 12 and 15 use mariadb.service; they also
# provide a mysql.service symlink for backwards-compatibility, but
# let's not rely on that.
MYSQL_SERVICE_NAME=mariadb
elif [[ "$DISTRO" == "bullseye" ]]; then
MYSQL_SERVICE_NAME=mariadb
fi
fi
@@ -48,7 +54,7 @@ function cleanup_database_mysql {
elif is_oraclelinux; then
uninstall_package mysql-community-server
sudo rm -rf /var/lib/mysql
elif is_fedora; then
elif is_suse || is_fedora; then
uninstall_package mariadb-server
sudo rm -rf /var/lib/mysql
else
@@ -63,12 +69,12 @@ function recreate_database_mysql {
}
function configure_database_mysql {
local my_conf mysql slow_log my_client_conf
local my_conf mysql slow_log
echo_summary "Configuring and starting MySQL"
if is_ubuntu; then
my_conf=/etc/mysql/my.cnf
elif is_oraclelinux; then
elif is_suse || is_oraclelinux; then
my_conf=/etc/my.cnf
elif is_fedora; then
my_conf=/etc/my.cnf
@@ -80,20 +86,11 @@ function configure_database_mysql {
exit_distro_not_supported "mysql configuration"
fi
# Set fips mode on
if is_ubuntu; then
if is_fips_enabled; then
my_client_conf=/etc/mysql/mysql.conf.d/mysql.cnf
iniset -sudo $my_client_conf mysql ssl-fips-mode "on"
iniset -sudo $my_conf mysqld ssl-fips-mode "on"
fi
fi
# Change bind-address from localhost (127.0.0.1) to any (::)
iniset -sudo $my_conf mysqld bind-address "$(ipv6_unquote $SERVICE_LISTEN_ADDRESS)"
# (Re)Start mysql-server
if is_fedora; then
if is_fedora || is_suse; then
# service is not started by default
start_service $MYSQL_SERVICE_NAME
elif is_ubuntu; then
@@ -103,13 +100,8 @@ function configure_database_mysql {
# Set the root password - only works the first time. For Ubuntu, we already
# did that with debconf before installing the package, but we still try,
# because the package might have been installed already. We don't do this
# for Ubuntu 22.04 (jammy) because the authorization model change in
# version 10.4 of mariadb. See
# https://mariadb.org/authentication-in-mariadb-10-4/
if ! (is_ubuntu && [[ "$DISTRO" == "jammy" ]] && [ "$MYSQL_SERVICE_NAME" == "mariadb" ]); then
sudo mysqladmin -u root password $DATABASE_PASSWORD || true
fi
# because the package might have been installed already.
sudo mysqladmin -u root password $DATABASE_PASSWORD || true
# In case of Mariadb, giving hostname in arguments causes permission
# problems as it expects connection through socket
@@ -122,23 +114,14 @@ function configure_database_mysql {
# In mariadb e.g. on Ubuntu socket plugin is used for authentication
# as root so it works only as sudo. To restore old "mysql like" behaviour,
# we need to change auth plugin for root user
# TODO(frickler): simplify this logic
if is_ubuntu && [[ ! "$DISTRO" =~ bookworm|bullseye ]] && [ "$MYSQL_SERVICE_NAME" == "mariadb" ]; then
if [[ "$DISTRO" == "jammy" ]]; then
# For Ubuntu 22.04 (jammy) we follow the model outlined in
# https://mariadb.org/authentication-in-mariadb-10-4/
sudo mysql -e "ALTER USER $DATABASE_USER@localhost IDENTIFIED VIA mysql_native_password USING PASSWORD('$DATABASE_PASSWORD');"
else
sudo mysql $cmd_args -e "UPDATE mysql.user SET plugin='' WHERE user='$DATABASE_USER' AND host='localhost';"
sudo mysql $cmd_args -e "FLUSH PRIVILEGES;"
fi
fi
if ! (is_ubuntu && [[ "$DISTRO" == "jammy" ]] && [ "$MYSQL_SERVICE_NAME" == "mariadb" ]); then
# Create DB user if it does not already exist
sudo mysql $cmd_args -e "CREATE USER IF NOT EXISTS '$DATABASE_USER'@'%' identified by '$DATABASE_PASSWORD';"
# Update the DB to give user '$DATABASE_USER'@'%' full control of the all databases:
sudo mysql $cmd_args -e "GRANT ALL PRIVILEGES ON *.* TO '$DATABASE_USER'@'%';"
if is_ubuntu && [[ "$DISTRO" != "bullseye" ]] && [ "$MYSQL_SERVICE_NAME" == "mariadb" ]; then
sudo mysql $cmd_args -e "UPDATE mysql.user SET plugin='' WHERE user='$DATABASE_USER' AND host='localhost';"
sudo mysql $cmd_args -e "FLUSH PRIVILEGES;"
fi
# Create DB user if it does not already exist
sudo mysql $cmd_args -e "CREATE USER IF NOT EXISTS '$DATABASE_USER'@'%' identified by '$DATABASE_PASSWORD';"
# Update the DB to give user '$DATABASE_USER'@'%' full control of the all databases:
sudo mysql $cmd_args -e "GRANT ALL PRIVILEGES ON *.* TO '$DATABASE_USER'@'%';"
# Now update ``my.cnf`` for some local needs and restart the mysql service
@@ -226,6 +209,9 @@ EOF
elif is_fedora; then
install_package mariadb-server mariadb-devel mariadb
sudo systemctl enable $MYSQL_SERVICE_NAME
elif is_suse; then
install_package mariadb-server
sudo systemctl enable $MYSQL_SERVICE_NAME
elif is_ubuntu; then
install_package $MYSQL_SERVICE_NAME-server
else
+10 -10
View File
@@ -32,7 +32,7 @@ function cleanup_database_postgresql {
# Get ruthless with mysql
apt_get purge -y postgresql*
return
elif is_fedora; then
elif is_fedora || is_suse; then
uninstall_package postgresql-server
else
return
@@ -46,10 +46,6 @@ function recreate_database_postgresql {
createdb -h $DATABASE_HOST -U$DATABASE_USER -l C -T template0 -E utf8 $db
}
function _exit_pg_init {
sudo cat /var/lib/pgsql/initdb_postgresql.log
}
function configure_database_postgresql {
local pg_conf pg_dir pg_hba check_role version
echo_summary "Configuring and starting PostgreSQL"
@@ -57,9 +53,8 @@ function configure_database_postgresql {
pg_hba=/var/lib/pgsql/data/pg_hba.conf
pg_conf=/var/lib/pgsql/data/postgresql.conf
if ! sudo [ -e $pg_hba ]; then
trap _exit_pg_init EXIT
sudo postgresql-setup initdb
trap - EXIT
localectl set-locale LANG=en_US.UTF-8
sudo -E postgresql-setup initdb
fi
elif is_ubuntu; then
version=`psql --version | cut -d ' ' -f3 | cut -d. -f1-2`
@@ -72,6 +67,11 @@ function configure_database_postgresql {
pg_dir=`find /etc/postgresql -name pg_hba.conf|xargs dirname`
pg_hba=$pg_dir/pg_hba.conf
pg_conf=$pg_dir/postgresql.conf
elif is_suse; then
pg_hba=/var/lib/pgsql/data/pg_hba.conf
pg_conf=/var/lib/pgsql/data/postgresql.conf
# initdb is called when postgresql is first started
sudo [ -e $pg_hba ] || start_service postgresql
else
exit_distro_not_supported "postgresql configuration"
fi
@@ -108,8 +108,8 @@ EOF
if [[ "$INSTALL_DATABASE_SERVER_PACKAGES" == "True" ]]; then
if is_ubuntu; then
install_package postgresql
elif is_fedora; then
install_package postgresql-server
elif is_fedora || is_suse; then
install_package postgresql-server langpacks-en glibc-langpack-en
if is_fedora; then
sudo systemctl enable postgresql
fi
-6
View File
@@ -40,18 +40,12 @@ function start_dstat {
if is_service_enabled peakmem_tracker; then
die $LINENO "The peakmem_tracker service has been removed, use memory_tracker instead"
fi
# To enable file_tracker add:
# enable_service file_tracker
# to your localrc
run_process file_tracker "$TOP_DIR/tools/file_tracker.sh"
}
# stop_dstat() stop dstat process
function stop_dstat {
stop_process dstat
stop_process memory_tracker
stop_process file_tracker
}
# Restore xtrace
+1 -1
View File
@@ -51,7 +51,7 @@ function start_etcd3 {
fi
cmd+=" --listen-client-urls http://$SERVICE_HOST:$ETCD_PORT"
if [ "$ENABLE_DEBUG_LOG_LEVEL" == "True" ]; then
cmd+=" --log-level=debug"
cmd+=" --debug"
fi
local unitfile="$SYSTEMD_DIR/$ETCD_SYSTEMD_SERVICE"
+9 -25
View File
@@ -47,8 +47,9 @@ USE_CINDER_FOR_GLANCE=$(trueorfalse False USE_CINDER_FOR_GLANCE)
# from CINDER_ENABLED_BACKENDS
GLANCE_CINDER_DEFAULT_BACKEND=${GLANCE_CINDER_DEFAULT_BACKEND:-lvmdriver-1}
GLANCE_STORE_ROOTWRAP_BASE_DIR=/usr/local/etc/glance
if [[ "$GLOBAL_VENV" == "True" ]] ; then
GLANCE_STORE_ROOTWRAP_BASE_DIR=${DEVSTACK_VENV}/etc/glance
# NOTE (abhishekk): For opensuse data files are stored in different directory
if is_opensuse; then
GLANCE_STORE_ROOTWRAP_BASE_DIR=/usr/etc/glance
fi
# When Cinder is used as a glance store, you can optionally configure cinder to
# optimize bootable volume creation by allowing volumes to be cloned directly
@@ -75,7 +76,6 @@ GLANCE_MULTIPLE_FILE_STORES=${GLANCE_MULTIPLE_FILE_STORES:-fast}
GLANCE_DEFAULT_BACKEND=${GLANCE_DEFAULT_BACKEND:-fast}
GLANCE_CACHE_DIR=${GLANCE_CACHE_DIR:=$DATA_DIR/glance/cache}
GLANCE_CACHE_DRIVER=${GLANCE_CACHE_DRIVER:-centralized_db}
# Full Glance functionality requires running in standalone mode. If we are
# not in uwsgi mode, then we are standalone, otherwise allow separate control.
@@ -99,13 +99,10 @@ GLANCE_USE_IMPORT_WORKFLOW=$(trueorfalse False GLANCE_USE_IMPORT_WORKFLOW)
GLANCE_ENABLE_QUOTAS=$(trueorfalse True GLANCE_ENABLE_QUOTAS)
# Flag to set the oslo_policy.enforce_scope. This is used to switch
# This is used to disable the Image API policies scope and new defaults.
# By Default, it is True.
# the Image API policies to start checking the scope of token. By Default,
# this flag is False.
# For more detail: https://docs.openstack.org/oslo.policy/latest/configuration/index.html#oslo_policy.enforce_scope
GLANCE_ENFORCE_SCOPE=$(trueorfalse True GLANCE_ENFORCE_SCOPE)
# Flag to disable image format inspection on upload
GLANCE_ENFORCE_IMAGE_FORMAT=$(trueorfalse True GLANCE_ENFORCE_IMAGE_FORMAT)
GLANCE_ENFORCE_SCOPE=$(trueorfalse False GLANCE_ENFORCE_SCOPE)
GLANCE_CONF_DIR=${GLANCE_CONF_DIR:-/etc/glance}
GLANCE_METADEF_DIR=$GLANCE_CONF_DIR/metadefs
@@ -171,7 +168,6 @@ function cleanup_glance {
# Cleanup reserved stores directories
sudo rm -rf $GLANCE_STAGING_DIR $GLANCE_TASKS_DIR
fi
remove_uwsgi_config "$GLANCE_UWSGI_CONF" "glance-wsgi-api"
}
# Set multiple cinder store related config options for each of the cinder store
@@ -334,7 +330,6 @@ function configure_glance {
iniset $GLANCE_API_CONF database connection $dburl
iniset $GLANCE_API_CONF DEFAULT use_syslog $SYSLOG
iniset $GLANCE_API_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
iniset $GLANCE_API_CONF DEFAULT image_cache_driver $GLANCE_CACHE_DRIVER
iniset $GLANCE_API_CONF oslo_concurrency lock_path $GLANCE_LOCK_DIR
iniset $GLANCE_API_CONF paste_deploy flavor keystone+cachemanagement
configure_keystone_authtoken_middleware $GLANCE_API_CONF glance
@@ -346,7 +341,6 @@ function configure_glance {
# Only use these if you know what you are doing! See OSSN-0065
iniset $GLANCE_API_CONF DEFAULT show_image_direct_url $GLANCE_SHOW_DIRECT_URL
iniset $GLANCE_API_CONF DEFAULT show_multiple_locations $GLANCE_SHOW_MULTIPLE_LOCATIONS
iniset $GLANCE_API_CONF image_format require_image_format_match $GLANCE_ENFORCE_IMAGE_FORMAT
# Configure glance_store
configure_glance_store $USE_CINDER_FOR_GLANCE $GLANCE_ENABLE_MULTIPLE_STORES
@@ -399,7 +393,6 @@ function configure_glance {
iniset $GLANCE_CACHE_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
iniset $GLANCE_CACHE_CONF DEFAULT use_syslog $SYSLOG
iniset $GLANCE_CACHE_CONF DEFAULT image_cache_dir $GLANCE_CACHE_DIR/
iniset $GLANCE_CACHE_CONF DEFAULT image_cache_driver $GLANCE_CACHE_DRIVER
iniset $GLANCE_CACHE_CONF DEFAULT auth_url $KEYSTONE_SERVICE_URI
iniset $GLANCE_CACHE_CONF DEFAULT admin_tenant_name $SERVICE_PROJECT_NAME
iniset $GLANCE_CACHE_CONF DEFAULT admin_user glance
@@ -437,17 +430,12 @@ function configure_glance {
iniset $GLANCE_API_CONF DEFAULT bind_host $GLANCE_SERVICE_LISTEN_ADDRESS
iniset $GLANCE_API_CONF DEFAULT bind_port $GLANCE_SERVICE_PORT_INT
iniset $GLANCE_API_CONF DEFAULT workers "$API_WORKERS"
iniset $GLANCE_API_CONF DEFAULT worker_self_reference_url $GLANCE_URL
fi
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
else
iniset $GLANCE_API_CONF oslo_policy enforce_scope false
iniset $GLANCE_API_CONF oslo_policy enforce_new_defaults false
iniset $GLANCE_API_CONF DEFAULT enforce_secure_rbac false
fi
}
@@ -552,7 +540,7 @@ function glance_remote_conf {
# start_glance_remote_clone() - Clone the regular glance api worker
function start_glance_remote_clone {
local glance_remote_conf_dir glance_remote_port remote_data
local glance_remote_uwsgi venv
local glance_remote_uwsgi
glance_remote_conf_dir="$(glance_remote_conf "")"
glance_remote_port=$(get_random_port)
@@ -590,16 +578,12 @@ function start_glance_remote_clone {
# We need to create the systemd service for the clone, but then
# change it to include an Environment line to point the WSGI app
# at the alternate config directory.
if [[ "$GLOBAL_VENV" == True ]]; then
venv="--venv $DEVSTACK_VENV"
fi
write_uwsgi_user_unit_file devstack@g-api-r.service "$(which uwsgi) \
--procname-prefix \
glance-api-remote \
--ini $glance_remote_uwsgi \
$venv" \
--ini $glance_remote_uwsgi" \
"" "$STACK_USER"
iniadd -sudo ${SYSTEMD_DIR}/devstack@g-api-r.service \
iniset -sudo ${SYSTEMD_DIR}/devstack@g-api-r.service \
"Service" "Environment" \
"OS_GLANCE_CONFIG_DIR=$glance_remote_conf_dir"
+1 -15
View File
@@ -109,21 +109,12 @@ function configure_horizon {
_horizon_config_set $local_settings "" OPENSTACK_KEYSTONE_MULTIDOMAIN_SUPPORT "True"
fi
if is_service_enabled c-bak; then
_horizon_config_set $local_settings OPENSTACK_CINDER_FEATURES enable_backup "True"
fi
# Create an empty directory that apache uses as docroot
sudo mkdir -p $HORIZON_DIR/.blackhole
local horizon_conf
horizon_conf=$(apache_site_config_for horizon)
local wsgi_venv_config=""
if [[ "$GLOBAL_VENV" == "True" ]] ; then
wsgi_venv_config="WSGIPythonHome $DEVSTACK_VENV"
fi
# Configure apache to run horizon
# Set up the django horizon application to serve via apache/wsgi
sudo sh -c "sed -e \"
@@ -133,13 +124,12 @@ function configure_horizon {
s,%APACHE_NAME%,$APACHE_NAME,g;
s,%DEST%,$DEST,g;
s,%WEBROOT%,$HORIZON_APACHE_ROOT,g;
s,%WSGIPYTHONHOME%,$wsgi_venv_config,g;
\" $FILES/apache-horizon.template >$horizon_conf"
if is_ubuntu; then
disable_apache_site 000-default
sudo touch $horizon_conf
elif is_fedora; then
elif is_fedora || is_suse; then
: # nothing to do
else
exit_distro_not_supported "horizon apache configuration"
@@ -173,10 +163,6 @@ function install_horizon {
# Apache installation, because we mark it NOPRIME
install_apache_wsgi
# Install the memcache library so that horizon can use memcached as its
# cache backend
pip_install_gr pymemcache
git_clone $HORIZON_REPO $HORIZON_DIR $HORIZON_BRANCH
}
-98
View File
@@ -1,98 +0,0 @@
#!/bin/bash
# Kernel Samepage Merging (KSM)
# -----------------------------
# Processes that mark their memory as mergeable can share identical memory
# pages if KSM is enabled. This is particularly useful for nova + libvirt
# backends but any other setup that marks its memory as mergeable can take
# advantage. The drawback is there is higher cpu load; however, we tend to
# be memory bound not cpu bound so enable KSM by default but allow people
# to opt out if the CPU time is more important to them.
ENABLE_KSM=$(trueorfalse True ENABLE_KSM)
ENABLE_KSMTUNED=$(trueorfalse True ENABLE_KSMTUNED)
function configure_ksm {
if [[ $ENABLE_KSMTUNED == "True" ]] ; then
install_package "ksmtuned"
fi
if [[ -f /sys/kernel/mm/ksm/run ]] ; then
echo $(bool_to_int ENABLE_KSM) | sudo tee /sys/kernel/mm/ksm/run
fi
}
# Compressed swap (ZSWAP)
#------------------------
# as noted in the kernel docs https://docs.kernel.org/admin-guide/mm/zswap.html
# Zswap is a lightweight compressed cache for swap pages.
# It takes pages that are in the process of being swapped out and attempts
# to compress them into a dynamically allocated RAM-based memory pool.
# zswap basically trades CPU cycles for potentially reduced swap I/O.
# This trade-off can also result in a significant performance improvement
# if reads from the compressed cache are faster than reads from a swap device.
ENABLE_ZSWAP=$(trueorfalse False ENABLE_ZSWAP)
# lz4 is very fast although it does not have the best compression
# zstd has much better compression but more latency
ZSWAP_COMPRESSOR=${ZSWAP_COMPRESSOR:="lz4"}
ZSWAP_ZPOOL=${ZSWAP_ZPOOL:="z3fold"}
function configure_zswap {
if [[ $ENABLE_ZSWAP == "True" ]] ; then
# Centos 9 stream seems to only support enabling but not run time
# tuning so dont try to choose better default on centos
if is_ubuntu; then
echo ${ZSWAP_COMPRESSOR} | sudo tee /sys/module/zswap/parameters/compressor
echo ${ZSWAP_ZPOOL} | sudo tee /sys/module/zswap/parameters/zpool
fi
echo 1 | sudo tee /sys/module/zswap/parameters/enabled
# print curent zswap kernel config
sudo grep -R . /sys/module/zswap/parameters || /bin/true
fi
}
ENABLE_SYSCTL_MEM_TUNING=$(trueorfalse False ENABLE_SYSCTL_MEM_TUNING)
function configure_sysctl_mem_parmaters {
if [[ $ENABLE_SYSCTL_MEM_TUNING == "True" ]] ; then
# defer write when memory is available
sudo sysctl -w vm.dirty_ratio=60
sudo sysctl -w vm.dirty_background_ratio=10
sudo sysctl -w vm.vfs_cache_pressure=50
# assume swap is compressed so on new kernels
# give it equal priority as page cache which is
# uncompressed. on kernels < 5.8 the max is 100
# not 200 so it will strongly prefer swapping.
sudo sysctl -w vm.swappiness=100
sudo grep -R . /proc/sys/vm/ || /bin/true
fi
}
function configure_host_mem {
configure_zswap
configure_ksm
configure_sysctl_mem_parmaters
}
ENABLE_SYSCTL_NET_TUNING=$(trueorfalse False ENABLE_SYSCTL_NET_TUNING)
function configure_sysctl_net_parmaters {
if [[ $ENABLE_SYSCTL_NET_TUNING == "True" ]] ; then
# detect dead TCP connections after 120 seconds
sudo sysctl -w net.ipv4.tcp_keepalive_time=60
sudo sysctl -w net.ipv4.tcp_keepalive_intvl=10
sudo sysctl -w net.ipv4.tcp_keepalive_probes=6
# reudce network latency for new connections
sudo sysctl -w net.ipv4.tcp_fastopen=3
# print tcp options
sudo grep -R . /proc/sys/net/ipv4/tcp* || /bin/true
# disable qos by default
sudo sysctl -w net.core.default_qdisc=pfifo_fast
fi
}
function configure_host_net {
configure_sysctl_net_parmaters
}
function tune_host {
configure_host_mem
configure_host_net
}
+1 -1
View File
@@ -31,7 +31,7 @@ function install_infra {
local PIP_VIRTUAL_ENV="$REQUIREMENTS_DIR/.venv"
[ ! -d $PIP_VIRTUAL_ENV ] && ${VIRTUALENV_CMD} $PIP_VIRTUAL_ENV
# We don't care about testing git pbr in the requirements venv.
PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install -U pbr setuptools
PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install -U pbr
PIP_VIRTUAL_ENV=$PIP_VIRTUAL_ENV pip_install $REQUIREMENTS_DIR
# Unset the PIP_VIRTUAL_ENV so that PBR does not end up trapped
+2 -7
View File
@@ -150,7 +150,7 @@ function cleanup_keystone {
sudo rm -f $(apache_site_config_for keystone)
else
stop_process "keystone"
remove_uwsgi_config "$KEYSTONE_PUBLIC_UWSGI_CONF" "keystone-wsgi-public"
remove_uwsgi_config "$KEYSTONE_PUBLIC_UWSGI_CONF" "$KEYSTONE_PUBLIC_UWSGI"
sudo rm -f $(apache_site_config_for keystone-wsgi-public)
fi
}
@@ -265,15 +265,10 @@ 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
iniset $KEYSTONE_CONF oslo_policy policy_file policy.yaml
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
else
iniset $KEYSTONE_CONF oslo_policy enforce_scope false
iniset $KEYSTONE_CONF oslo_policy enforce_new_defaults false
iniset $KEYSTONE_CONF oslo_policy policy_file policy.yaml
fi
}
+14
View File
@@ -39,6 +39,13 @@ elif is_fedora; then
LDAP_OLCDB_NUMBER=2
LDAP_OLCDB_TYPE=hdb
LDAP_ROOTPW_COMMAND=add
elif is_suse; then
# SUSE has slappasswd in /usr/sbin/
PATH=$PATH:/usr/sbin/
LDAP_OLCDB_NUMBER=1
LDAP_OLCDB_TYPE=hdb
LDAP_ROOTPW_COMMAND=add
LDAP_SERVICE_NAME=ldap
fi
@@ -69,6 +76,8 @@ function cleanup_ldap {
sudo rm -rf /etc/ldap/ldap.conf /var/lib/ldap
elif is_fedora; then
sudo rm -rf /etc/openldap /var/lib/ldap
elif is_suse; then
sudo rm -rf /var/lib/ldap
fi
}
@@ -117,6 +126,11 @@ function install_ldap {
configure_ldap
elif is_fedora; then
start_ldap
elif is_suse; then
_ldap_varsubst $FILES/ldap/suse-base-config.ldif.in >$tmp_ldap_dir/suse-base-config.ldif
sudo slapadd -F /etc/openldap/slapd.d/ -bcn=config -l $tmp_ldap_dir/suse-base-config.ldif
sudo sed -i '/^OPENLDAP_START_LDAPI=/s/"no"/"yes"/g' /etc/sysconfig/openldap
start_ldap
fi
echo "LDAP_PASSWORD is $LDAP_PASSWORD"
+8 -14
View File
@@ -129,25 +129,19 @@ function init_lvm_volume_group {
local vg=$1
local size=$2
# Start the tgtd service on Fedora if tgtadm is used
if is_fedora; then
# Start the tgtd service on Fedora and SUSE if tgtadm is used
if is_fedora || is_suse && [[ "$CINDER_ISCSI_HELPER" = "tgtadm" ]]; then
start_service tgtd
fi
# Start with a clean volume group
_create_lvm_volume_group $vg $size
if is_service_enabled cinder; then
# Remove iscsi targets
if [ "$CINDER_TARGET_HELPER" = "lioadm" ]; then
sudo cinder-rtstool get-targets | sudo xargs -rn 1 cinder-rtstool delete
elif [ "$CINDER_TARGET_HELPER" = "tgtadm" ]; then
sudo tgtadm --op show --mode target | awk '/Target/ {print $3}' | sudo xargs -r -n1 tgt-admin --delete
elif [ "$CINDER_TARGET_HELPER" = "nvmet" ]; then
# If we don't disconnect everything vgremove will block
sudo nvme disconnect-all
sudo nvmetcli clear
fi
# Remove iscsi targets
if [ "$CINDER_ISCSI_HELPER" = "lioadm" ]; then
sudo cinder-rtstool get-targets | sudo xargs -rn 1 cinder-rtstool delete
else
sudo tgtadm --op show --mode target | awk '/Target/ {print $3}' | sudo xargs -r -n1 tgt-admin --delete
fi
_clean_lvm_volume_group $vg
}
@@ -200,7 +194,7 @@ function set_lvm_filter {
filter_string=$filter_string$filter_suffix
clean_lvm_filter
sudo sed -i "/# global_filter = \[.*\]/a\ $filter_string" /etc/lvm/lvm.conf
sudo sed -i "/# global_filter = \[*\]/a\ $global_filter$filter_string" /etc/lvm/lvm.conf
echo_summary "set lvm.conf device global_filter to: $filter_string"
}
+586 -1027
View File
File diff suppressed because it is too large Load Diff
+1094 -3
View File
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -13,7 +13,7 @@ Plugin specific configuration variables should be in this file.
functions
---------
``lib/neutron`` calls the following functions when the ``$Q_PLUGIN`` is enabled
``lib/neutron-legacy`` calls the following functions when the ``$Q_PLUGIN`` is enabled
* ``neutron_plugin_create_nova_conf`` :
optionally set options in nova_conf
+1 -1
View File
@@ -67,7 +67,7 @@ function has_neutron_plugin_security_group {
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt neutron-agent && is_service_enabled q-dhcp neutron-dhcp && return 0
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
# Restore xtrace
+1 -1
View File
@@ -72,7 +72,7 @@ function has_neutron_plugin_security_group {
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt neutron-agent && is_service_enabled q-dhcp neutron-dhcp && return 0
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
# Restore xtrace
+1 -1
View File
@@ -97,7 +97,7 @@ function neutron_plugin_setup_interface_driver {
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt neutron-agent && is_service_enabled q-dhcp neutron-dhcp && return 0
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
# Restore xtrace
+13 -2
View File
@@ -67,7 +67,7 @@ function neutron_plugin_configure_common {
Q_PLUGIN_CLASS="ml2"
# The ML2 plugin delegates L3 routing/NAT functionality to
# the L3 service plugin which must therefore be specified.
neutron_service_plugin_class_add $ML2_L3_PLUGIN
_neutron_service_plugin_class_add $ML2_L3_PLUGIN
}
function neutron_plugin_configure_service {
@@ -111,7 +111,18 @@ function neutron_plugin_configure_service {
fi
fi
fi
populate_ml2_config /$Q_PLUGIN_CONF_FILE securitygroup enable_security_group=$Q_USE_SECGROUP
# REVISIT(rkukura): Setting firewall_driver here for
# neutron.agent.securitygroups_rpc.is_firewall_enabled() which is
# used in the server, in case no L2 agent is configured on the
# server's node. If an L2 agent is configured, this will get
# overridden with the correct driver. The ml2 plugin should
# instead use its own config variable to indicate whether security
# groups is enabled, and that will need to be set here instead.
if [[ "$Q_USE_SECGROUP" == "True" ]]; then
iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.not.a.real.FirewallDriver
else
iniset /$Q_PLUGIN_CONF_FILE securitygroup firewall_driver neutron.agent.firewall.NoopFirewallDriver
fi
populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2 mechanism_drivers=$Q_ML2_PLUGIN_MECHANISM_DRIVERS
if [[ "$Q_ML2_PLUGIN_MECHANISM_DRIVERS" == *"linuxbridge"* ]]; then
+1 -1
View File
@@ -68,7 +68,7 @@ function neutron_plugin_setup_interface_driver {
}
function neutron_plugin_check_adv_test_requirements {
is_service_enabled q-agt neutron-agent && is_service_enabled q-dhcp neutron-dhcp && return 0
is_service_enabled q-agt && is_service_enabled q-dhcp && return 0
}
# Restore xtrace
+46 -99
View File
@@ -91,14 +91,9 @@ OVN_GENEVE_OVERHEAD=${OVN_GENEVE_OVERHEAD:-38}
# http://www.openvswitch.org/support/dist-docs/ovs-appctl.8.txt
OVN_DBS_LOG_LEVEL=${OVN_DBS_LOG_LEVEL:-info}
# OVN metadata agent configuration
OVN_META_CONF=$NEUTRON_CONF_DIR/neutron_ovn_metadata_agent.ini
OVN_META_DATA_HOST=${OVN_META_DATA_HOST:-$(ipv6_unquote $SERVICE_HOST)}
# OVN agent configuration
OVN_AGENT_CONF=$NEUTRON_CONF_DIR/plugins/ml2/ovn_agent.ini
OVN_AGENT_EXTENSIONS=${OVN_AGENT_EXTENSIONS:-}
# If True (default) the node will be considered a gateway node.
ENABLE_CHASSIS_AS_GW=$(trueorfalse True ENABLE_CHASSIS_AS_GW)
OVN_L3_CREATE_PUBLIC_NETWORK=$(trueorfalse True OVN_L3_CREATE_PUBLIC_NETWORK)
@@ -137,7 +132,6 @@ OVN_RUNDIR=$OVS_PREFIX/var/run/ovn
NEUTRON_OVN_BIN_DIR=$(get_python_exec_prefix)
NEUTRON_OVN_METADATA_BINARY="neutron-ovn-metadata-agent"
NEUTRON_OVN_AGENT_BINARY="neutron-ovn-agent"
STACK_GROUP="$( id --group --name "$STACK_USER" )"
@@ -250,12 +244,11 @@ function _run_process {
local cmd="$2"
local stop_cmd="$3"
local group=$4
local user=$5
local rundir=${6:-$OVS_RUNDIR}
local user=${5:-$STACK_USER}
local systemd_service="devstack@$service.service"
local unit_file="$SYSTEMD_DIR/$systemd_service"
local environment="OVN_RUNDIR=$OVN_RUNDIR OVN_DBDIR=$OVN_DATADIR OVN_LOGDIR=$LOGDIR OVS_RUNDIR=$OVS_RUNDIR OVS_DBDIR=$OVS_DATADIR OVS_LOGDIR=$LOGDIR"
local environment="OVN_RUNDIR=$OVS_RUNDIR OVN_DBDIR=$OVN_DATADIR OVN_LOGDIR=$LOGDIR OVS_RUNDIR=$OVS_RUNDIR OVS_DBDIR=$OVS_DATADIR OVS_LOGDIR=$LOGDIR"
echo "Starting $service executed command": $cmd
@@ -271,14 +264,14 @@ function _run_process {
_start_process $systemd_service
local testcmd="test -e $rundir/$service.pid"
local testcmd="test -e $OVS_RUNDIR/$service.pid"
test_with_retry "$testcmd" "$service did not start" $SERVICE_TIMEOUT 1
local service_ctl_file
service_ctl_file=$(ls $rundir | grep $service | grep ctl)
service_ctl_file=$(ls $OVS_RUNDIR | grep $service | grep ctl)
if [ -z "$service_ctl_file" ]; then
die $LINENO "ctl file for service $service is not present."
fi
sudo ovs-appctl -t $rundir/$service_ctl_file vlog/set console:off syslog:info file:info
sudo ovs-appctl -t $OVS_RUNDIR/$service_ctl_file vlog/set console:off syslog:info file:info
}
function clone_repository {
@@ -294,7 +287,7 @@ function clone_repository {
function create_public_bridge {
# Create the public bridge that OVN will use
sudo ovs-vsctl --may-exist add-br $PUBLIC_BRIDGE -- set bridge $PUBLIC_BRIDGE protocols=OpenFlow13,OpenFlow15
sudo ovs-vsctl set open . external-ids:ovn-bridge-mappings=${OVN_BRIDGE_MAPPINGS}
sudo ovs-vsctl set open . external-ids:ovn-bridge-mappings=$PHYSICAL_NETWORK:$PUBLIC_BRIDGE
_configure_public_network_connectivity
}
@@ -340,24 +333,8 @@ function compile_ovn {
./boot.sh
fi
# NOTE(mnaser): OVN requires that you build using the OVS from the
# submodule.
#
# https://github.com/ovn-org/ovn/blob/3fb397b63663297acbcbf794e1233951222ae5af/Documentation/intro/install/general.rst#bootstrapping
# https://github.com/ovn-org/ovn/issues/128
git submodule update --init
pushd ovs
if [ ! -f configure ] ; then
./boot.sh
fi
if [ ! -f config.status ] || [ configure -nt config.status ] ; then
./configure
fi
make -j$(($(nproc) + 1))
popd
if [ ! -f config.status ] || [ configure -nt config.status ] ; then
./configure $prefix $localstatedir
./configure --with-ovs-source=$DEST/$OVS_REPO_NAME $prefix $localstatedir
fi
make -j$(($(nproc) + 1))
sudo make install
@@ -370,7 +347,7 @@ function compile_ovn {
# OVN service sanity check
function ovn_sanity_check {
if is_service_enabled q-agt neutron-agent; then
if is_service_enabled q-agt neutron-agt; then
die $LINENO "The q-agt/neutron-agt service must be disabled with OVN."
elif is_service_enabled q-l3 neutron-l3; then
die $LINENO "The q-l3/neutron-l3 service must be disabled with OVN."
@@ -393,6 +370,10 @@ function install_ovn {
sudo mkdir -p $OVS_RUNDIR
sudo chown $(whoami) $OVS_RUNDIR
# NOTE(lucasagomes): To keep things simpler, let's reuse the same
# RUNDIR for both OVS and OVN. This way we avoid having to specify the
# --db option in the ovn-{n,s}bctl commands while playing with DevStack
sudo ln -s $OVS_RUNDIR $OVN_RUNDIR
if [[ "$OVN_BUILD_FROM_SOURCE" == "True" ]]; then
# If OVS is already installed, remove it, because we're about to
@@ -483,7 +464,7 @@ function filter_network_api_extensions {
function configure_ovn_plugin {
echo "Configuring Neutron for OVN"
if is_service_enabled q-svc neutron-api; then
if is_service_enabled q-svc ; then
filter_network_api_extensions
populate_ml2_config /$Q_PLUGIN_CONF_FILE ml2_type_geneve max_header_size=$OVN_GENEVE_OVERHEAD
populate_ml2_config /$Q_PLUGIN_CONF_FILE ovn ovn_nb_connection="$OVN_NB_REMOTE"
@@ -507,9 +488,7 @@ function configure_ovn_plugin {
inicomment /$Q_PLUGIN_CONF_FILE network_log local_output_log_base="$Q_LOG_DRIVER_LOG_BASE"
fi
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent; then
populate_ml2_config /$Q_PLUGIN_CONF_FILE ovn ovn_metadata_enabled=True
elif is_service_enabled q-ovn-agent neutron-ovn-agent && [[ "$OVN_AGENT_EXTENSIONS" =~ 'metadata' ]]; then
if is_service_enabled q-ovn-metadata-agent; then
populate_ml2_config /$Q_PLUGIN_CONF_FILE ovn ovn_metadata_enabled=True
else
populate_ml2_config /$Q_PLUGIN_CONF_FILE ovn ovn_metadata_enabled=False
@@ -530,9 +509,7 @@ function configure_ovn_plugin {
fi
if is_service_enabled n-api-meta ; then
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent; then
iniset $NOVA_CONF neutron service_metadata_proxy True
elif is_service_enabled q-ovn-agent neutron-ovn-agent && [[ "$OVN_AGENT_EXTENSIONS" =~ 'metadata' ]]; then
if is_service_enabled q-ovn-metadata-agent ; then
iniset $NOVA_CONF neutron service_metadata_proxy True
fi
fi
@@ -565,42 +542,29 @@ function configure_ovn {
fi
# Metadata
local sample_file=""
local config_file=""
if is_service_enabled q-ovn-agent neutron-ovn-agent && [[ "$OVN_AGENT_EXTENSIONS" =~ 'metadata' ]] && is_service_enabled ovn-controller; then
sample_file=$NEUTRON_DIR/etc/neutron/plugins/ml2/ovn_agent.ini.sample
config_file=$OVN_AGENT_CONF
elif is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent && is_service_enabled ovn-controller; then
sample_file=$NEUTRON_DIR/etc/neutron_ovn_metadata_agent.ini.sample
config_file=$OVN_META_CONF
fi
if [ -n "$config_file" ]; then
if is_service_enabled q-ovn-metadata-agent && is_service_enabled ovn-controller; then
sudo install -d -o $STACK_USER $NEUTRON_CONF_DIR
mkdir -p $NEUTRON_DIR/etc/neutron/plugins/ml2
(cd $NEUTRON_DIR && exec ./tools/generate_config_file_samples.sh)
cp $sample_file $config_file
configure_root_helper_options $config_file
cp $NEUTRON_DIR/etc/neutron_ovn_metadata_agent.ini.sample $OVN_META_CONF
configure_root_helper_options $OVN_META_CONF
iniset $config_file DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
iniset $config_file DEFAULT nova_metadata_host $OVN_META_DATA_HOST
iniset $config_file DEFAULT metadata_workers $API_WORKERS
iniset $config_file DEFAULT state_path $DATA_DIR/neutron
iniset $config_file ovs ovsdb_connection tcp:$OVSDB_SERVER_LOCAL_HOST:6640
iniset $config_file ovn ovn_sb_connection $OVN_SB_REMOTE
iniset $OVN_META_CONF DEFAULT debug $ENABLE_DEBUG_LOG_LEVEL
iniset $OVN_META_CONF DEFAULT nova_metadata_host $OVN_META_DATA_HOST
iniset $OVN_META_CONF DEFAULT metadata_workers $API_WORKERS
iniset $OVN_META_CONF DEFAULT state_path $NEUTRON_STATE_PATH
iniset $OVN_META_CONF ovs ovsdb_connection tcp:$OVSDB_SERVER_LOCAL_HOST:6640
iniset $OVN_META_CONF ovn ovn_sb_connection $OVN_SB_REMOTE
if is_service_enabled tls-proxy; then
iniset $config_file ovn \
iniset $OVN_META_CONF ovn \
ovn_sb_ca_cert $INT_CA_DIR/ca-chain.pem
iniset $config_file ovn \
iniset $OVN_META_CONF ovn \
ovn_sb_certificate $INT_CA_DIR/$DEVSTACK_CERT_NAME.crt
iniset $config_file ovn \
iniset $OVN_META_CONF ovn \
ovn_sb_private_key $INT_CA_DIR/private/$DEVSTACK_CERT_NAME.key
fi
if [[ $config_file == $OVN_AGENT_CONF ]]; then
iniset $config_file agent extensions $OVN_AGENT_EXTENSIONS
iniset $config_file ovn ovn_nb_connection $OVN_NB_REMOTE
fi
fi
}
@@ -653,12 +617,12 @@ 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" "" "$STACK_GROUP" "root" "$OVS_RUNDIR"
_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.
local ovscmd="$OVS_SBINDIR/ovs-vswitchd --log-file --pidfile --detach"
_run_process ovs-vswitchd "$ovscmd" "" "$STACK_GROUP" "root" "$OVS_RUNDIR"
_run_process ovs-vswitchd "$ovscmd" "" "$STACK_GROUP" "root"
else
_start_process "$OVSDB_SERVER_SERVICE"
_start_process "$OVS_VSWITCHD_SERVICE"
@@ -697,7 +661,7 @@ function _start_ovs {
enable_service ovs-vtep
local vtepcmd="$OVS_SCRIPTDIR/ovs-vtep --log-file --pidfile --detach br-v"
_run_process ovs-vtep "$vtepcmd" "" "$STACK_GROUP" "root" "$OVS_RUNDIR"
_run_process ovs-vtep "$vtepcmd" "" "$STACK_GROUP" "root"
vtep-ctl set-manager tcp:$HOST_IP:6640
fi
@@ -720,12 +684,9 @@ function _start_ovn_services {
if is_service_enabled ovs-vtep ; then
_start_process "devstack@ovs-vtep.service"
fi
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent ; then
if is_service_enabled q-ovn-metadata-agent; then
_start_process "devstack@q-ovn-metadata-agent.service"
fi
if is_service_enabled q-ovn-agent neutron-ovn-agent ; then
_start_process "devstack@q-ovn-agent.service"
fi
}
# start_ovn() - Start running processes, including screen
@@ -744,26 +705,26 @@ 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" "$STACK_GROUP" "root" "$OVN_RUNDIR"
_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 $OVN_RUNDIR/ovnnb_db.sock
wait_for_sock_file $OVN_RUNDIR/ovnsb_db.sock
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:$OVN_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
sudo ovn-sbctl --db=unix:$OVN_RUNDIR/ovnsb_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
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
sudo ovn-sbctl --db=unix:$OVS_RUNDIR/ovnsb_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
fi
sudo ovn-nbctl --db=unix:$OVN_RUNDIR/ovnnb_db.sock set-connection p${OVN_PROTO}:6641:$SERVICE_LISTEN_ADDRESS -- set connection . inactivity_probe=60000
sudo ovn-sbctl --db=unix:$OVN_RUNDIR/ovnsb_db.sock set-connection p${OVN_PROTO}:6642:$SERVICE_LISTEN_ADDRESS -- set connection . inactivity_probe=60000
sudo ovs-appctl -t $OVN_RUNDIR/ovnnb_db.ctl vlog/set console:off syslog:$OVN_DBS_LOG_LEVEL file:$OVN_DBS_LOG_LEVEL
sudo ovs-appctl -t $OVN_RUNDIR/ovnsb_db.ctl vlog/set console:off syslog:$OVN_DBS_LOG_LEVEL file:$OVN_DBS_LOG_LEVEL
sudo ovn-nbctl --db=unix:$OVS_RUNDIR/ovnnb_db.sock set-connection p${OVN_PROTO}:6641:$SERVICE_LISTEN_ADDRESS -- set connection . inactivity_probe=60000
sudo ovn-sbctl --db=unix:$OVS_RUNDIR/ovnsb_db.sock set-connection p${OVN_PROTO}:6642:$SERVICE_LISTEN_ADDRESS -- set connection . inactivity_probe=60000
sudo ovs-appctl -t $OVS_RUNDIR/ovnnb_db.ctl vlog/set console:off syslog:$OVN_DBS_LOG_LEVEL file:$OVN_DBS_LOG_LEVEL
sudo ovs-appctl -t $OVS_RUNDIR/ovnsb_db.ctl vlog/set console:off syslog:$OVN_DBS_LOG_LEVEL file:$OVN_DBS_LOG_LEVEL
fi
if is_service_enabled ovn-controller ; then
@@ -771,7 +732,7 @@ function start_ovn {
local cmd="/bin/bash $SCRIPTDIR/ovn-ctl --no-monitor start_controller"
local stop_cmd="/bin/bash $SCRIPTDIR/ovn-ctl stop_controller"
_run_process ovn-controller "$cmd" "$stop_cmd" "$STACK_GROUP" "root" "$OVN_RUNDIR"
_run_process ovn-controller "$cmd" "$stop_cmd" "$STACK_GROUP" "root"
else
_start_process "$OVN_CONTROLLER_SERVICE"
fi
@@ -780,24 +741,18 @@ function start_ovn {
if is_service_enabled ovn-controller-vtep ; then
if [[ "$OVN_BUILD_FROM_SOURCE" == "True" ]]; then
local cmd="$OVS_BINDIR/ovn-controller-vtep --log-file --pidfile --detach --ovnsb-db=$OVN_SB_REMOTE"
_run_process ovn-controller-vtep "$cmd" "" "$STACK_GROUP" "root" "$OVN_RUNDIR"
_run_process ovn-controller-vtep "$cmd" "" "$STACK_GROUP" "root"
else
_start_process "$OVN_CONTROLLER_VTEP_SERVICE"
fi
fi
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent; then
if is_service_enabled q-ovn-metadata-agent; then
run_process q-ovn-metadata-agent "$NEUTRON_OVN_BIN_DIR/$NEUTRON_OVN_METADATA_BINARY --config-file $OVN_META_CONF"
# Format logging
setup_logging $OVN_META_CONF
fi
if is_service_enabled q-ovn-agent neutron-ovn-agent; then
run_process q-ovn-agent "$NEUTRON_OVN_BIN_DIR/$NEUTRON_OVN_AGENT_BINARY --config-file $OVN_AGENT_CONF"
# Format logging
setup_logging $OVN_AGENT_CONF
fi
_start_ovn_services
}
@@ -816,18 +771,10 @@ function _stop_process {
}
function stop_ovn {
if is_service_enabled q-ovn-metadata-agent neutron-ovn-metadata-agent; then
# pkill takes care not to kill itself, but it may kill its parent
# sudo unless we use the "ps | grep [f]oo" trick
sudo pkill -9 -f "[h]aproxy" || :
if is_service_enabled q-ovn-metadata-agent; then
sudo pkill -9 -f haproxy || :
_stop_process "devstack@q-ovn-metadata-agent.service"
fi
if is_service_enabled q-ovn-agent neutron-ovn-agent; then
# pkill takes care not to kill itself, but it may kill its parent
# sudo unless we use the "ps | grep [f]oo" trick
sudo pkill -9 -f "[h]aproxy" || :
_stop_process "devstack@q-ovn-agent.service"
fi
if is_service_enabled ovn-controller-vtep ; then
_stop_process "$OVN_CONTROLLER_VTEP_SERVICE"
fi
@@ -870,5 +817,5 @@ function cleanup_ovn {
_cleanup $ovs_path
fi
sudo rm -rf $OVN_RUNDIR
sudo rm -f $OVN_RUNDIR
}
+13
View File
@@ -80,6 +80,19 @@ function _neutron_ovs_base_install_agent_packages {
elif is_fedora; then
restart_service openvswitch
sudo systemctl enable openvswitch
elif is_suse; then
if [[ $DISTRO == "sle12" ]] && vercmp "$os_RELEASE" "<" "12.2" ; then
restart_service openvswitch-switch
else
# workaround for https://bugzilla.suse.com/show_bug.cgi?id=1085971
if [[ $DISTRO =~ "tumbleweed" ]]; then
sudo sed -i -e "s,^OVS_USER_ID=.*,OVS_USER_ID='root:root'," /etc/sysconfig/openvswitch
fi
restart_service openvswitch || {
journalctl -xe || :
systemctl status openvswitch
}
fi
fi
fi
}
+9 -3
View File
@@ -33,9 +33,9 @@ function load_module {
local fatal=$2
if [ "$(trueorfalse True fatal)" == "True" ]; then
sudo modprobe $module || (sudo dmesg && die $LINENO "FAILED TO LOAD $module")
sudo modprobe $module || (dmesg && die $LINENO "FAILED TO LOAD $module")
else
sudo modprobe $module || (echo "FAILED TO LOAD $module" && sudo dmesg)
sudo modprobe $module || (echo "FAILED TO LOAD $module" && dmesg)
fi
}
@@ -103,7 +103,7 @@ function prepare_for_ovs_compilation {
function load_ovs_kernel_modules {
load_module openvswitch
load_module vport-geneve False
sudo dmesg | tail
dmesg | tail
}
# reload_ovs_kernel_modules() - reload openvswitch kernel module
@@ -180,6 +180,12 @@ function action_openvswitch {
${action}_service openvswitch-switch
elif is_fedora; then
${action}_service openvswitch
elif is_suse; then
if [[ $DISTRO == "sle12" ]] && [[ $os_RELEASE -lt 12.2 ]]; then
${action}_service openvswitch-switch
else
${action}_service openvswitch
fi
fi
}
+3 -9
View File
@@ -47,8 +47,7 @@ Q_L3_ROUTER_PER_TENANT=${Q_L3_ROUTER_PER_TENANT:-True}
# used for the network. In case of ofagent, you should add the
# corresponding entry to your OFAGENT_PHYSICAL_INTERFACE_MAPPINGS.
# For openvswitch agent, you should add the corresponding entry to
# your OVS_BRIDGE_MAPPINGS and for OVN add the corresponding entry
# to your OVN_BRIDGE_MAPPINGS.
# your OVS_BRIDGE_MAPPINGS.
#
# eg. (ofagent)
# Q_USE_PROVIDERNET_FOR_PUBLIC=True
@@ -61,11 +60,6 @@ Q_L3_ROUTER_PER_TENANT=${Q_L3_ROUTER_PER_TENANT:-True}
# PUBLIC_PHYSICAL_NETWORK=public
# OVS_BRIDGE_MAPPINGS=public:br-ex
#
# eg. (ovn agent)
# Q_USER_PROVIDERNET_FOR_PUBLIC=True
# PUBLIC_PHYSICAL_NETWORK=public
# OVN_BRIDGE_MAPPINGS=public:br-ex
#
# The provider-network-type defaults to flat, however, the values
# PUBLIC_PROVIDERNET_TYPE and PUBLIC_PROVIDERNET_SEGMENTATION_ID could
# be set to specify the parameters for an alternate network type.
@@ -329,7 +323,7 @@ function _neutron_configure_router_v4 {
openstack --os-cloud devstack-admin-demo --os-region "$REGION_NAME" router set --external-gateway $EXT_NET_ID $ROUTER_ID
# This logic is specific to using OVN or the l3-agent for layer 3
if ([[ $Q_AGENT == "ovn" ]] && [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]] && is_service_enabled q-svc neutron-api) || is_service_enabled q-l3 neutron-l3; then
if ([[ $Q_AGENT == "ovn" ]] && [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]] && is_service_enabled q-svc neutron-server) || is_service_enabled q-l3 neutron-l3; then
# Configure and enable public bridge
local ext_gw_interface="none"
if is_neutron_ovs_base_plugin; then
@@ -378,7 +372,7 @@ function _neutron_configure_router_v6 {
fi
# This logic is specific to using OVN or the l3-agent for layer 3
if ([[ $Q_AGENT == "ovn" ]] && [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]] && is_service_enabled q-svc neutron-api) || is_service_enabled q-l3 neutron-l3; then
if ([[ $Q_AGENT == "ovn" ]] && [[ "$OVN_L3_CREATE_PUBLIC_NETWORK" == "True" ]] && is_service_enabled q-svc neutron-server) || is_service_enabled q-l3 neutron-l3; then
# if the Linux host considers itself to be a router then it will
# ignore all router advertisements
# Ensure IPv6 RAs are accepted on interfaces with a default route.
+1 -1
View File
@@ -12,7 +12,7 @@ AGENT_METERING_BINARY="$NEUTRON_BIN_DIR/neutron-metering-agent"
METERING_PLUGIN="neutron.services.metering.metering_plugin.MeteringPlugin"
function neutron_agent_metering_configure_common {
neutron_service_plugin_class_add $METERING_PLUGIN
_neutron_service_plugin_class_add $METERING_PLUGIN
}
function neutron_agent_metering_configure_agent {
+1 -1
View File
@@ -6,7 +6,7 @@ function configure_qos_service_plugin {
function configure_qos_core_plugin {
configure_qos_$Q_PLUGIN
configure_qos_$NEUTRON_CORE_PLUGIN
}
-10
View File
@@ -1,10 +0,0 @@
#!/bin/bash
function configure_segments_service_plugin {
neutron_service_plugin_class_add segments
}
function configure_segments_extension {
configure_segments_service_plugin
}
+19 -99
View File
@@ -53,19 +53,11 @@ NOVA_COND_CONF=$NOVA_CONF_DIR/nova.conf
NOVA_CPU_CONF=$NOVA_CONF_DIR/nova-cpu.conf
NOVA_FAKE_CONF=$NOVA_CONF_DIR/nova-fake.conf
NOVA_API_DB=${NOVA_API_DB:-nova_api}
NOVA_UWSGI=nova.wsgi.osapi_compute:application
NOVA_METADATA_UWSGI=nova.wsgi.metadata:application
NOVA_UWSGI=$NOVA_BIN_DIR/nova-api-wsgi
NOVA_METADATA_UWSGI=$NOVA_BIN_DIR/nova-metadata-wsgi
NOVA_UWSGI_CONF=$NOVA_CONF_DIR/nova-api-uwsgi.ini
NOVA_METADATA_UWSGI_CONF=$NOVA_CONF_DIR/nova-metadata-uwsgi.ini
# Allow forcing the stable compute uuid to something specific. This would be
# done by deployment tools that pre-allocate the UUIDs, but it is also handy
# for developers that need to re-stack a compute-only deployment multiple
# times. Since the DB is non-local and not erased on an unstack, making it
# stay the same each time is what developers want. Set to a uuid here or
# leave it blank for default allocate-on-start behavior.
NOVA_CPU_UUID=""
# The total number of cells we expect. Must be greater than one and doesn't
# count cell0.
NOVA_NUM_CELLS=${NOVA_NUM_CELLS:-1}
@@ -83,11 +75,6 @@ NOVA_API_PASTE_INI=${NOVA_API_PASTE_INI:-$NOVA_CONF_DIR/api-paste.ini}
# mean "use uwsgi" because we'll be always using uwsgi.
NOVA_USE_MOD_WSGI=${NOVA_USE_MOD_WSGI:-True}
# We do not need to report service status every 10s for devstack-like
# deployments. In the gate this generates extra work for the services and the
# database which are already taxed.
NOVA_SERVICE_REPORT_INTERVAL=${NOVA_SERVICE_REPORT_INTERVAL:-120}
if is_service_enabled tls-proxy; then
NOVA_SERVICE_PROTOCOL="https"
fi
@@ -110,18 +97,6 @@ NOVA_SERVICE_LISTEN_ADDRESS=${NOVA_SERVICE_LISTEN_ADDRESS:-$(ipv6_unquote $SERVI
METADATA_SERVICE_PORT=${METADATA_SERVICE_PORT:-8775}
NOVA_ENABLE_CACHE=${NOVA_ENABLE_CACHE:-True}
# Flag to set the oslo_policy.enforce_scope and oslo_policy.enforce_new_defaults.
# This is used to disable the compute API policies scope and new defaults.
# By Default, it is True.
# For more detail: https://docs.openstack.org/oslo.policy/latest/configuration/index.html#oslo_policy.enforce_scope
NOVA_ENFORCE_SCOPE=$(trueorfalse True NOVA_ENFORCE_SCOPE)
if [[ $SERVICE_IP_VERSION == 6 ]]; then
NOVA_MY_IP="$HOST_IPV6"
else
NOVA_MY_IP="$HOST_IP"
fi
# Option to enable/disable config drive
# NOTE: Set ``FORCE_CONFIG_DRIVE="False"`` to turn OFF config drive
FORCE_CONFIG_DRIVE=${FORCE_CONFIG_DRIVE:-"False"}
@@ -173,9 +148,6 @@ NOVA_SHUTDOWN_TIMEOUT=${NOVA_SHUTDOWN_TIMEOUT:-0}
# Whether to use Keystone unified limits instead of legacy quota limits.
NOVA_USE_UNIFIED_LIMITS=$(trueorfalse False NOVA_USE_UNIFIED_LIMITS)
# TB Cache Size in MiB for qemu guests
NOVA_LIBVIRT_TB_CACHE_SIZE=${NOVA_LIBVIRT_TB_CACHE_SIZE:-0}
# Functions
# ---------
@@ -233,9 +205,6 @@ function cleanup_nova {
done
sudo iscsiadm --mode node --op delete || true
# Disconnect all nvmeof connections
sudo nvme disconnect-all || true
# Clean out the instances directory.
sudo rm -rf $NOVA_INSTANCES_PATH/*
fi
@@ -251,8 +220,8 @@ function cleanup_nova {
stop_process "n-api"
stop_process "n-api-meta"
remove_uwsgi_config "$NOVA_UWSGI_CONF" "nova-api"
remove_uwsgi_config "$NOVA_METADATA_UWSGI_CONF" "nova-metadata"
remove_uwsgi_config "$NOVA_UWSGI_CONF" "$NOVA_UWSGI"
remove_uwsgi_config "$NOVA_METADATA_UWSGI_CONF" "$NOVA_METADATA_UWSGI"
if [[ "$NOVA_BACKEND" == "LVM" ]]; then
clean_lvm_volume_group $DEFAULT_VOLUME_GROUP_NAME
@@ -323,7 +292,6 @@ function configure_nova {
fi
fi
# Due to cinder bug #1966513 we ALWAYS need an initiator name for LVM
# Ensure each compute host uses a unique iSCSI initiator
echo InitiatorName=$(iscsi-iname) | sudo tee /etc/iscsi/initiatorname.iscsi
@@ -344,28 +312,8 @@ EOF
# not work under FIPS.
iniset -sudo /etc/iscsi/iscsid.conf DEFAULT "node.session.auth.chap_algs" "SHA3-256,SHA256"
if [[ $CINDER_TARGET_HELPER != 'nvmet' ]]; then
# ensure that iscsid is started, even when disabled by default
restart_service iscsid
# For NVMe-oF we need different packages that many not be present
else
install_package nvme-cli
sudo modprobe nvme-fabrics
# Ensure NVMe is ready and create the Soft-RoCE device over the networking interface
if [[ $CINDER_TARGET_PROTOCOL == 'nvmet_rdma' ]]; then
sudo modprobe nvme-rdma
iface=${HOST_IP_IFACE:-`ip -br -$SERVICE_IP_VERSION a | grep $NOVA_MY_IP | awk '{print $1}'`}
if ! sudo rdma link | grep $iface ; then
sudo rdma link add rxe_$iface type rxe netdev $iface
fi
elif [[ $CINDER_TARGET_PROTOCOL == 'nvmet_tcp' ]]; then
sudo modprobe nvme-tcp
else # 'nvmet_fc'
sudo modprobe nvme-fc
fi
fi
# ensure that iscsid is started, even when disabled by default
restart_service iscsid
fi
# Rebuild the config file from scratch
@@ -456,7 +404,11 @@ function create_nova_conf {
iniset $NOVA_CONF filter_scheduler enabled_filters "$NOVA_FILTERS"
iniset $NOVA_CONF scheduler workers "$API_WORKERS"
iniset $NOVA_CONF neutron default_floating_pool "$PUBLIC_NETWORK_NAME"
iniset $NOVA_CONF DEFAULT my_ip "$NOVA_MY_IP"
if [[ $SERVICE_IP_VERSION == 6 ]]; then
iniset $NOVA_CONF DEFAULT my_ip "$HOST_IPV6"
else
iniset $NOVA_CONF DEFAULT my_ip "$HOST_IP"
fi
iniset $NOVA_CONF DEFAULT instance_name_template "${INSTANCE_NAME_PREFIX}%08x"
iniset $NOVA_CONF DEFAULT osapi_compute_listen "$NOVA_SERVICE_LISTEN_ADDRESS"
iniset $NOVA_CONF DEFAULT metadata_listen "$NOVA_SERVICE_LISTEN_ADDRESS"
@@ -464,11 +416,8 @@ function create_nova_conf {
iniset $NOVA_CONF key_manager backend nova.keymgr.conf_key_mgr.ConfKeyManager
iniset $NOVA_CONF DEFAULT report_interval $NOVA_SERVICE_REPORT_INTERVAL
iniset $NOVA_CONF DEFAULT service_down_time $(($NOVA_SERVICE_REPORT_INTERVAL * 6))
if is_fedora; then
# nova defaults to /usr/local/bin, but fedora pip like to
if is_fedora || is_suse; then
# nova defaults to /usr/local/bin, but fedora and suse pip like to
# install things in /usr/bin
iniset $NOVA_CONF DEFAULT bindir "/usr/bin"
fi
@@ -506,13 +455,6 @@ function create_nova_conf {
NOVA_ENABLED_APIS=$(echo $NOVA_ENABLED_APIS | sed "s/,metadata//")
fi
iniset $NOVA_CONF DEFAULT enabled_apis "$NOVA_ENABLED_APIS"
if [[ "$NOVA_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then
iniset $NOVA_CONF oslo_policy enforce_new_defaults True
iniset $NOVA_CONF oslo_policy enforce_scope True
else
iniset $NOVA_CONF oslo_policy enforce_new_defaults False
iniset $NOVA_CONF oslo_policy enforce_scope False
fi
if is_service_enabled tls-proxy && [ "$NOVA_USE_MOD_WSGI" == "False" ]; then
# Set the service port for a proxy to take the original
iniset $NOVA_CONF DEFAULT osapi_compute_listen_port "$NOVA_SERVICE_PORT_INT"
@@ -542,7 +484,7 @@ function create_nova_conf {
# nova defaults to genisoimage but only mkisofs is available for 15.0+
# rhel provides mkisofs symlink to genisoimage or xorriso appropiately
if is_fedora; then
if is_suse || is_fedora; then
iniset $NOVA_CONF DEFAULT mkisofs_cmd /usr/bin/mkisofs
fi
@@ -552,11 +494,11 @@ function create_nova_conf {
iniset $NOVA_CONF upgrade_levels compute "auto"
if is_service_enabled n-api; then
write_uwsgi_config "$NOVA_UWSGI_CONF" "$NOVA_UWSGI" "/compute" "" "nova-api"
write_uwsgi_config "$NOVA_UWSGI_CONF" "$NOVA_UWSGI" "/compute"
fi
if is_service_enabled n-api-meta; then
write_uwsgi_config "$NOVA_METADATA_UWSGI_CONF" "$NOVA_METADATA_UWSGI" "" "$SERVICE_LISTEN_ADDRESS:${METADATA_SERVICE_PORT}" "nova-metadata"
write_uwsgi_config "$NOVA_METADATA_UWSGI_CONF" "$NOVA_METADATA_UWSGI" "" "$SERVICE_LISTEN_ADDRESS:${METADATA_SERVICE_PORT}"
fi
if is_service_enabled ceilometer; then
@@ -640,7 +582,7 @@ function configure_placement_nova_compute {
local conf=${1:-$NOVA_CONF}
iniset $conf placement auth_type "password"
iniset $conf placement auth_url "$KEYSTONE_SERVICE_URI"
iniset $conf placement username nova
iniset $conf placement username placement
iniset $conf placement password "$SERVICE_PASSWORD"
iniset $conf placement user_domain_name "$SERVICE_DOMAIN_NAME"
iniset $conf placement project_name "$SERVICE_TENANT_NAME"
@@ -943,23 +885,8 @@ function install_nova {
# a websockets/html5 or flash powered VNC console for vm instances
NOVNC_FROM_PACKAGE=$(trueorfalse False NOVNC_FROM_PACKAGE)
if [ "$NOVNC_FROM_PACKAGE" = "True" ]; then
# Installing novnc on Debian bullseye breaks the global pip
# install. This happens because novnc pulls in distro cryptography
# which will be prefered by distro pip, but if anything has
# installed pyOpenSSL from pypi (keystone) that is not compatible
# with distro cryptography. Fix this by installing
# python3-openssl (pyOpenSSL) from the distro which pip will prefer
# on Debian. Ubuntu has inverse problems so we only do this for
# Debian.
local novnc_packages
novnc_packages="novnc"
GetOSVersion
if [[ "$os_VENDOR" = "Debian" ]] ; then
novnc_packages="$novnc_packages python3-openssl"
fi
NOVNC_WEB_DIR=/usr/share/novnc
install_package $novnc_packages
install_package novnc
else
NOVNC_WEB_DIR=$DEST/novnc
git_clone $NOVNC_REPO $NOVNC_WEB_DIR $NOVNC_BRANCH
@@ -1057,7 +984,7 @@ function start_nova_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 180
iniset $NOVA_CPU_CONF DEFAULT reimage_timeout_per_gb 60
# Configure the OVSDB connection for os-vif
if [ -n "$OVSDB_SERVER_LOCAL_HOST" ]; then
@@ -1069,14 +996,7 @@ function start_nova_compute {
iniset $NOVA_CPU_CONF workarounds libvirt_disable_apic True
fi
if [[ "$NOVA_CPU_UUID" ]]; then
echo -n $NOVA_CPU_UUID > $NOVA_CONF_DIR/compute_id
fi
if [[ "$VIRT_DRIVER" = 'libvirt' ]]; then
if [ ${NOVA_LIBVIRT_TB_CACHE_SIZE} -gt 0 ]; then
iniset $NOVA_CPU_CONF libvirt tb_cache_size ${NOVA_LIBVIRT_TB_CACHE_SIZE}
fi
# The group **$LIBVIRT_GROUP** is added to the current user in this script.
# ``sg`` is used in run_process to execute nova-compute as a member of the
# **$LIBVIRT_GROUP** group.
+5 -11
View File
@@ -69,12 +69,12 @@ function install_libvirt {
$REQUIREMENTS_DIR/upper-constraints.txt -- libvirt-python
if is_ubuntu; then
install_package qemu-system libvirt-clients libvirt-daemon-system libvirt-dev python3-libvirt systemd-coredump
install_package qemu-system libvirt-clients libvirt-daemon-system libvirt-dev python3-libvirt
if is_arch "aarch64"; then
install_package qemu-efi
fi
#pip_install_gr <there-si-no-guestfs-in-pypi>
elif is_fedora; then
elif is_fedora || is_suse; then
# Optionally enable the virt-preview repo when on Fedora
if [[ $DISTRO =~ f[0-9][0-9] ]] && [[ ${ENABLE_FEDORA_VIRT_PREVIEW_REPO} == "True" ]]; then
@@ -82,17 +82,11 @@ function install_libvirt {
sudo dnf copr enable -y @virtmaint-sig/virt-preview
fi
if is_openeuler; then
qemu_package=qemu
else
qemu_package=qemu-kvm
fi
# Note that in CentOS/RHEL this needs to come from the RDO
# repositories (qemu-kvm-ev ... which provides this package)
# as the base system version is too old. We should have
# pre-installed these
install_package $qemu_package
install_package qemu-kvm
install_package libvirt libvirt-devel python3-libvirt
if is_arch "aarch64"; then
@@ -121,8 +115,8 @@ cgroup_device_acl = [
EOF
fi
if is_fedora; then
# Starting with fedora 18 enable stack-user to
if is_fedora || is_suse; then
# Starting with fedora 18 and opensuse-12.3 enable stack-user to
# virsh -c qemu:///system by creating a policy-kit rule for
# stack-user using the new Javascript syntax
rules_dir=/etc/polkit-1/rules.d
-4
View File
@@ -53,10 +53,6 @@ function configure_nova_hypervisor {
iniset $NOVA_CONF ironic project_domain_id default
iniset $NOVA_CONF ironic project_name demo
fi
if is_ironic_sharded; then
iniset $NOVA_CONF ironic shard $IRONIC_SHARD_1_NAME
fi
iniset $NOVA_CONF ironic user_domain_id default
iniset $NOVA_CONF ironic region_name $REGION_NAME
+3 -4
View File
@@ -56,10 +56,6 @@ function configure_nova_hypervisor {
# arm64-specific configuration
if is_arch "aarch64"; then
iniset $NOVA_CONF libvirt cpu_mode "host-passthrough"
# NOTE(mnaser): We cannot have `cpu_model` set if the `cpu_mode` is
# set to `host-passthrough`, or `nova-compute` refuses to
# start.
inidelete $NOVA_CONF libvirt cpu_model
fi
if isset ENABLE_FILE_INJECTION; then
@@ -118,6 +114,9 @@ function install_nova_hypervisor {
sudo dpkg-statoverride --add --update $STAT_OVERRIDE
fi
done
elif is_suse; then
# Workaround for missing dependencies in python-libguestfs
install_package python-libguestfs guestfs-data augeas augeas-lenses
elif is_fedora; then
install_package python3-libguestfs
fi
+7
View File
@@ -1,5 +1,10 @@
#!/bin/bash
# support vsctl or native.
# until bug #1929446 is resolved we override the os-vif default
# and fall back to the legacy "vsctl" driver.
OS_VIF_OVS_OVSDB_INTERFACE=${OS_VIF_OVS_OVSDB_INTERFACE:="vsctl"}
function is_ml2_ovs {
if [[ "${Q_AGENT}" == "openvswitch" ]]; then
echo "True"
@@ -14,9 +19,11 @@ OS_VIF_OVS_ISOLATE_VIF=$(trueorfalse False OS_VIF_OVS_ISOLATE_VIF)
function configure_os_vif {
if [[ -e ${NOVA_CONF} ]]; then
iniset ${NOVA_CONF} os_vif_ovs ovsdb_interface ${OS_VIF_OVS_OVSDB_INTERFACE}
iniset ${NOVA_CONF} os_vif_ovs isolate_vif ${OS_VIF_OVS_ISOLATE_VIF}
fi
if [[ -e ${NEUTRON_CONF} ]]; then
iniset ${NEUTRON_CONF} os_vif_ovs ovsdb_interface ${OS_VIF_OVS_OVSDB_INTERFACE}
iniset ${NEUTRON_CONF} os_vif_ovs isolate_vif ${OS_VIF_OVS_ISOLATE_VIF}
fi
}
+1 -14
View File
@@ -48,12 +48,6 @@ fi
PLACEMENT_SERVICE_PROTOCOL=${PLACEMENT_SERVICE_PROTOCOL:-$SERVICE_PROTOCOL}
PLACEMENT_SERVICE_HOST=${PLACEMENT_SERVICE_HOST:-$SERVICE_HOST}
# Flag to set the oslo_policy.enforce_scope and oslo_policy.enforce_new_defaults.
# This is used to switch the Placement API policies scope and new defaults.
# By Default, these flag are False.
# For more detail: https://docs.openstack.org/oslo.policy/latest/configuration/index.html#oslo_policy.enforce_scope
PLACEMENT_ENFORCE_SCOPE=$(trueorfalse False PLACEMENT_ENFORCE_SCOPE)
# Functions
# ---------
@@ -68,7 +62,7 @@ function is_placement_enabled {
# runs that a clean run would need to clean up
function cleanup_placement {
sudo rm -f $(apache_site_config_for placement-api)
remove_uwsgi_config "$PLACEMENT_UWSGI_CONF" "placement-api"
remove_uwsgi_config "$PLACEMENT_UWSGI_CONF" "$PLACEMENT_UWSGI"
}
# _config_placement_apache_wsgi() - Set WSGI config files
@@ -117,13 +111,6 @@ function configure_placement {
else
_config_placement_apache_wsgi
fi
if [[ "$PLACEMENT_ENFORCE_SCOPE" == "True" || "$ENFORCE_SCOPE" == "True" ]]; then
iniset $PLACEMENT_CONF oslo_policy enforce_new_defaults True
iniset $PLACEMENT_CONF oslo_policy enforce_scope True
else
iniset $PLACEMENT_CONF oslo_policy enforce_new_defaults False
iniset $PLACEMENT_CONF oslo_policy enforce_scope False
fi
}
# create_placement_accounts() - Set up required placement accounts
+14 -1
View File
@@ -52,7 +52,20 @@ function install_rpc_backend {
if is_service_enabled rabbit; then
# Install rabbitmq-server
install_package rabbitmq-server
if is_fedora; then
if is_suse; then
install_package rabbitmq-server-plugins
# the default systemd socket activation only listens on the loopback interface
# which causes rabbitmq to try to start its own epmd
sudo mkdir -p /etc/systemd/system/epmd.socket.d
cat <<EOF | sudo tee /etc/systemd/system/epmd.socket.d/ports.conf >/dev/null
[Socket]
ListenStream=
ListenStream=[::]:4369
EOF
sudo systemctl daemon-reload
sudo systemctl restart epmd.socket epmd.service
fi
if is_fedora || is_suse; then
# NOTE(jangutter): If rabbitmq is not running (as in a fresh
# install) then rabbit_setuser triggers epmd@0.0.0.0.socket with
# socket activation. This fails the first time and does not get
+11 -8
View File
@@ -547,6 +547,9 @@ function configure_swift {
local swift_log_dir=${SWIFT_DATA_DIR}/logs
sudo rm -rf ${swift_log_dir}
local swift_log_group=adm
if is_suse; then
swift_log_group=root
fi
sudo install -d -o ${STACK_USER} -g ${swift_log_group} ${swift_log_dir}/hourly
if [[ $SYSLOG != "False" ]]; then
@@ -844,14 +847,14 @@ function stop_swift {
function swift_configure_tempurls {
# note we are using swift credentials!
openstack --os-cloud="" \
--os-region-name="$REGION_NAME" \
--os-auth-url="$KEYSTONE_SERVICE_URI" \
--os-username="swift" \
--os-password="$SERVICE_PASSWORD" \
--os-user-domain-name="$SERVICE_DOMAIN_NAME" \
--os-project-name="$SERVICE_PROJECT_NAME" \
--os-project-domain-name="$SERVICE_DOMAIN_NAME" \
openstack --os-cloud "" \
--os-region-name $REGION_NAME \
--os-auth-url $KEYSTONE_SERVICE_URI \
--os-username=swift \
--os-password=$SERVICE_PASSWORD \
--os-user-domain-name=$SERVICE_DOMAIN_NAME \
--os-project-name=$SERVICE_PROJECT_NAME \
--os-project-domain-name=$SERVICE_DOMAIN_NAME \
object store account \
set --property "Temp-URL-Key=$SWIFT_TEMPURL_KEY"
}
+73 -69
View File
@@ -18,7 +18,7 @@
# - ``PUBLIC_NETWORK_NAME``
# - ``VIRT_DRIVER``
# - ``LIBVIRT_TYPE``
# - ``KEYSTONE_SERVICE_URI_V3`` from lib/keystone
# - ``KEYSTONE_SERVICE_URI``, ``KEYSTONE_SERVICE_URI_V3`` from lib/keystone
#
# Optional Dependencies:
#
@@ -29,7 +29,6 @@
# - ``DEFAULT_INSTANCE_USER``
# - ``DEFAULT_INSTANCE_ALT_USER``
# - ``CINDER_ENABLED_BACKENDS``
# - ``CINDER_BACKUP_DRIVER``
# - ``NOVA_ALLOW_DUPLICATE_NETWORKS``
#
# ``stack.sh`` calls the entry points in this order:
@@ -59,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
@@ -102,9 +101,6 @@ TEMPEST_USE_TEST_ACCOUNTS=$(trueorfalse False TEMPEST_USE_TEST_ACCOUNTS)
# it will run tempest with
TEMPEST_CONCURRENCY=${TEMPEST_CONCURRENCY:-$(nproc)}
TEMPEST_FLAVOR_RAM=${TEMPEST_FLAVOR_RAM:-192}
TEMPEST_FLAVOR_ALT_RAM=${TEMPEST_FLAVOR_ALT_RAM:-256}
# Functions
# ---------
@@ -153,10 +149,11 @@ function set_tempest_venv_constraints {
# 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 img_id ($2) parameters.
# 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=()
@@ -164,6 +161,7 @@ function get_active_images {
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 }')
@@ -172,12 +170,13 @@ function get_active_images {
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
get_active_images image_array image_id image_id_alt
if (( ${#image_array[*]} >= $TEMPEST_GLANCE_IMAGE_COUNT )) ; then
return
fi
@@ -229,7 +228,7 @@ function configure_tempest {
declare -a images
if is_service_enabled glance; then
get_active_images images 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
@@ -237,7 +236,7 @@ function configure_tempest {
# 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
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
@@ -253,22 +252,13 @@ function configure_tempest {
1)
if [ -z "$image_uuid" ]; then
image_uuid=${images[0]}
image_uuid_alt=${images[0]}
fi
image_uuid_alt=$image_uuid
;;
*)
if [ -z "$image_uuid" ]; then
image_uuid=${images[0]}
if [ -z "$image_uuid_alt" ]; then
image_uuid_alt=${images[1]}
fi
elif [ -z "$image_uuid_alt" ]; then
for image in ${images[@]}; do
if [[ "$image" != "$image_uuid" ]]; then
image_uuid_alt=$image
break
fi
done
image_uuid_alt=${images[1]}
fi
;;
esac
@@ -298,15 +288,13 @@ function configure_tempest {
if [[ ! ( $available_flavors =~ 'm1.nano' ) ]]; then
# Determine the flavor disk size based on the image size.
disk=$(image_size_in_gib $image_uuid)
ram=${TEMPEST_FLAVOR_RAM}
openstack --os-cloud devstack-admin flavor create --id 42 --ram ${ram} --disk $disk --vcpus 1 --property hw_rng:allowed=True m1.nano
openstack --os-cloud devstack-admin flavor create --id 42 --ram 128 --disk $disk --vcpus 1 --property hw_rng:allowed=True m1.nano
fi
flavor_ref=42
if [[ ! ( $available_flavors =~ 'm1.micro' ) ]]; then
# Determine the alt flavor disk size based on the alt image size.
disk=$(image_size_in_gib $image_uuid_alt)
ram=${TEMPEST_FLAVOR_ALT_RAM}
openstack --os-cloud devstack-admin flavor create --id 84 --ram ${ram} --disk $disk --vcpus 1 --property hw_rng:allowed=True m1.micro
openstack --os-cloud devstack-admin flavor create --id 84 --ram 192 --disk $disk --vcpus 1 --property hw_rng:allowed=True m1.micro
fi
flavor_ref_alt=84
else
@@ -357,20 +345,6 @@ function configure_tempest {
fi
fi
if is_service_enabled glance; then
git_clone $OSTESTIMAGES_REPO $OSTESTIMAGES_DIR $OSTESTIMAGES_BRANCH
pushd $OSTESTIMAGES_DIR
tox -egenerate
popd
iniset $TEMPEST_CONFIG image images_manifest_file ${OSTESTIMAGES_DIR}/images/manifest.yaml
local image_conversion
image_conversion=$(iniget $GLANCE_IMAGE_IMPORT_CONF image_conversion output_format)
if [[ -n "$image_conversion" ]]; then
iniset $TEMPEST_CONFIG image-feature-enabled image_conversion True
fi
iniset $TEMPEST_CONFIG image-feature-enabled image_format_enforcement $GLANCE_ENFORCE_IMAGE_FORMAT
fi
iniset $TEMPEST_CONFIG network project_network_cidr $FIXED_RANGE
ssh_connect_method=${TEMPEST_SSH_CONNECT_METHOD:-$ssh_connect_method}
@@ -400,6 +374,7 @@ function configure_tempest {
iniset $TEMPEST_CONFIG volume build_timeout $BUILD_TIMEOUT
# Identity
iniset $TEMPEST_CONFIG identity uri "$KEYSTONE_SERVICE_URI/v2.0/"
iniset $TEMPEST_CONFIG identity uri_v3 "$KEYSTONE_SERVICE_URI_V3"
iniset $TEMPEST_CONFIG identity user_lockout_failure_attempts $KEYSTONE_LOCKOUT_FAILURE_ATTEMPTS
iniset $TEMPEST_CONFIG identity user_lockout_duration $KEYSTONE_LOCKOUT_DURATION
@@ -410,7 +385,19 @@ function configure_tempest {
iniset $TEMPEST_CONFIG auth admin_project_name $admin_project_name
iniset $TEMPEST_CONFIG auth admin_domain_name $admin_domain_name
fi
if [ "$ENABLE_IDENTITY_V2" == "True" ]; then
# Run Identity API v2 tests ONLY if needed
iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 True
else
# Skip Identity API v2 tests by default
iniset $TEMPEST_CONFIG identity-feature-enabled api_v2 False
fi
iniset $TEMPEST_CONFIG identity auth_version ${TEMPEST_AUTH_VERSION:-v3}
if [[ "$TEMPEST_AUTH_VERSION" != "v2" ]]; then
# we're going to disable v2 admin unless we're using v2 by default.
iniset $TEMPEST_CONFIG identity-feature-enabled api_v2_admin False
fi
if is_service_enabled tls-proxy; then
iniset $TEMPEST_CONFIG identity ca_certificates_file $SSL_BUNDLE_FILE
fi
@@ -475,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
@@ -530,19 +517,8 @@ function configure_tempest {
# Scenario
SCENARIO_IMAGE_DIR=${SCENARIO_IMAGE_DIR:-$FILES}
SCENARIO_IMAGE_FILE=$DEFAULT_IMAGE_FILE_NAME
SCENARIO_IMAGE_TYPE=${SCENARIO_IMAGE_TYPE:-cirros}
iniset $TEMPEST_CONFIG scenario img_file $SCENARIO_IMAGE_DIR/$SCENARIO_IMAGE_FILE
# since version 0.6.0 cirros uses dhcpcd dhcp client by default, however, cirros, prior to the
# version 0.6.0, used udhcpc (the only available client at that time) which is also tempest's default
if [[ "$SCENARIO_IMAGE_TYPE" == "cirros" ]]; then
# the image is a cirros image
# use dhcpcd client when version greater or equal 0.6.0
if [[ $(echo $CIRROS_VERSION | tr -d '.') -ge 060 ]]; then
iniset $TEMPEST_CONFIG scenario dhcp_client dhcpcd
fi
fi
# If using provider networking, use the physical network for validation rather than private
TEMPEST_SSH_NETWORK_NAME=$PRIVATE_NETWORK_NAME
if is_provider_network; then
@@ -578,11 +554,8 @@ function configure_tempest {
TEMPEST_VOLUME_REVERT_TO_SNAPSHOT=${TEMPEST_VOLUME_REVERT_TO_SNAPSHOT:-True}
fi
iniset $TEMPEST_CONFIG volume-feature-enabled volume_revert $(trueorfalse False TEMPEST_VOLUME_REVERT_TO_SNAPSHOT)
if [[ "$CINDER_BACKUP_DRIVER" == *"swift"* ]]; then
iniset $TEMPEST_CONFIG volume backup_driver swift
fi
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
@@ -641,7 +614,7 @@ function configure_tempest {
# 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
@@ -708,14 +681,8 @@ function configure_tempest {
# test can be run with scoped token.
if [[ "$KEYSTONE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
iniset $TEMPEST_CONFIG enforce_scope keystone true
fi
if [[ "$NOVA_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
iniset $TEMPEST_CONFIG enforce_scope nova true
fi
if [[ "$PLACEMENT_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
iniset $TEMPEST_CONFIG enforce_scope placement true
iniset $TEMPEST_CONFIG auth admin_system 'all'
iniset $TEMPEST_CONFIG auth admin_project_name ''
fi
if [[ "$GLANCE_ENFORCE_SCOPE" == True || "$ENFORCE_SCOPE" == True ]] ; then
@@ -773,16 +740,39 @@ function configure_tempest {
# Neutron API Extensions
# disable metering if we didn't enable the service
if ! is_service_enabled q-metering neutron-metering; then
if ! is_service_enabled q-metering; then
DISABLE_NETWORK_API_EXTENSIONS+=", metering"
fi
# disable l3_agent_scheduler if we didn't enable L3 agent
if ! is_service_enabled q-l3 neutron-l3; then
if ! is_service_enabled q-l3; then
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 " ")}
@@ -794,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 " ")}
@@ -803,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 " ")}
+15 -9
View File
@@ -212,6 +212,9 @@ function init_CA {
if is_fedora; then
sudo cp $INT_CA_DIR/ca-chain.pem /usr/share/pki/ca-trust-source/anchors/devstack-chain.pem
sudo update-ca-trust
elif is_suse; then
sudo cp $INT_CA_DIR/ca-chain.pem /usr/share/pki/trust/anchors/devstack-chain.pem
sudo update-ca-certificates
elif is_ubuntu; then
sudo cp $INT_CA_DIR/ca-chain.pem /usr/local/share/ca-certificates/devstack-int.crt
sudo cp $ROOT_CA_DIR/cacert.pem /usr/local/share/ca-certificates/devstack-root.crt
@@ -364,11 +367,8 @@ function deploy_int_CA {
function fix_system_ca_bundle_path {
if is_service_enabled tls-proxy; then
local capath
if [[ "$GLOBAL_VENV" == "True" ]] ; then
capath=$($DEVSTACK_VENV/bin/python3 -c $'try:\n from requests import certs\n print (certs.where())\nexcept ImportError: pass')
else
capath=$(python3 -c $'try:\n from requests import certs\n print (certs.where())\nexcept ImportError: pass')
fi
capath=$(python3 -c $'try:\n from requests import certs\n print (certs.where())\nexcept ImportError: pass')
if [[ ! $capath == "" && ! $capath =~ ^/etc/.* && ! -L $capath ]]; then
if is_fedora; then
sudo rm -f $capath
@@ -376,6 +376,9 @@ function fix_system_ca_bundle_path {
elif is_ubuntu; then
sudo rm -f $capath
sudo ln -s /etc/ssl/certs/ca-certificates.crt $capath
elif is_suse; then
sudo rm -f $capath
sudo ln -s /etc/ssl/ca-bundle.pem $capath
else
echo "Don't know how to set the CA bundle, expect the install to fail."
fi
@@ -438,6 +441,9 @@ function enable_mod_ssl {
if is_ubuntu; then
sudo a2enmod ssl
elif is_suse; then
sudo a2enmod ssl
sudo a2enflag SSL
elif is_fedora; then
# Fedora enables mod_ssl by default
:
@@ -530,7 +536,6 @@ $listen_string
<VirtualHost $f_host:$f_port>
SSLEngine On
SSLCertificateFile $DEVSTACK_CERT
SSLProtocol -all +TLSv1.3 +TLSv1.2
# Disable KeepAlive to fix bug #1630664 a.k.a the
# ('Connection aborted.', BadStatusLine("''",)) error
@@ -544,11 +549,9 @@ $listen_string
# Avoid races (at the cost of performance) to re-use a pooled connection
# where the connection is closed (bug 1807518).
# Set acquire=1 to disable waiting for connection pool members so that
# we can determine when apache is overloaded (returns 503).
SetEnv proxy-initial-not-pooled
<Location />
ProxyPass http://$b_host:$b_port/ retry=0 nocanon acquire=1
ProxyPass http://$b_host:$b_port/ retry=0 nocanon
ProxyPassReverse http://$b_host:$b_port/
</Location>
ErrorLog $APACHE_LOG_DIR/tls-proxy_error.log
@@ -557,6 +560,9 @@ $listen_string
CustomLog $APACHE_LOG_DIR/tls-proxy_access.log combined
</VirtualHost>
EOF
if is_suse ; then
sudo a2enflag SSL
fi
for mod in headers ssl proxy proxy_http; do
enable_apache_mod $mod
done

Some files were not shown because too many files have changed in this diff Show More