99 Commits

Author SHA1 Message Date
Zuul
7152718493 Merge "Fix building Ubuntu 20.04 focal amphorae" 2020-09-24 18:11:58 +00:00
Michael Johnson
70079d861d Fix building Ubuntu 20.04 focal amphorae
Ubuntu 20.04 is a "Tested Runtime" for the Victoria release[1].
This patch updated our diskimage-create script and elements to
support building a amphora image that uses Ubuntu 20.04 (focal).

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

Change-Id: I6f53ea5d012ab64b985d981ecd1b1967e18e4e81
2020-09-23 14:14:25 -07:00
Carlos Goncalves
16f9d2ebf8 Fix image build when installing agent from package
There is a bug in the octavia-lib DIB element where it runs install
actions that should only be ran when the amphora-agent is installed from
source. This issue causes the amphora image build to fail when
installing the amphora-agent from distribution packages (option -p in
the diskimage-create.sh tool).

Task: 40870
Story: 2008138

Change-Id: I46ba7798322f24255ab7d49db4b4df886e92cbf3
2020-09-14 18:56:36 +02:00
Michael Johnson
a446c04f77 Revert pyroute2 workaround
The pyroute2 module had a regression in 0.5.13, but neutron needed a fix
that was included in 0.5.13. It was easier for us to work around it than
for neutron to revert the update to 0.5.13, so we hacked a workaround[1].

A new pyroute2 release, 0.5.14, has been published, so this patch reverts
the hack and bumps our minimum version of pyroute2 to 0.5.14.

[1] https://review.opendev.org/#/c/744045

Change-Id: Ia4357a4f5db07e1a6b0beb11b58ce125215eeef1
2020-09-10 16:57:02 -07:00
Zuul
87e55d6350 Merge "Add support for nftables" 2020-09-10 18:29:38 +00:00
Michael Johnson
1a3b56a0d5 Add support for nftables
This patch adds support for nftables (an iptables replacement) to
the devstack plugin and the amphora agent.

Change-Id: I9e2c4d6e68da67d68c6dfeb3b47edd600d1ba397
2020-09-03 13:15:27 -07:00
Carlos Goncalves
dcda721320 Add DIB element octavia-lib
This new diskimage-builder element installs octavia-lib from Git for
source install type image builds rather than from released versions.

To mention some advantages:

1. allow custom octavia-lib versions (useful for development)
2. test unreleased octavia-lib changes in CI
3. install latest changes from master and stable branches
   (aligns with approach taken with amphora-agent)

Branch checkout to stable/* from master for octavia-lib DIB element will
be automated on branch create. See https://review.opendev.org/#/c/745877

Change-Id: I6d87b6bd25c536b2bed1994427cd933bdcc091d6
2020-08-24 11:24:19 +02:00
Michael Johnson
7d6322ae08 Switch back to using git for the agent ref
A diskimage-builder patch [1] broke our amphora-agent element by
uninstalling git prior to the post-install.d phase.
A followup patch in Octavia [2] changed how we get the git
reference to awking an git internal log file. This seems fragile
to me, so I am proposing this alternative.
This patch updates our element to finish using git before the
install.d phase is complete.

[1] https://review.opendev.org/745678
[2] https://review.opendev.org/745683

Change-Id: I9a346b626f852171ec00d2868ccb6f98b1fb8994
2020-08-18 11:27:51 -07:00
Carlos Goncalves
fa1c5ef6dd Set amphora-agent build-only packages
A recent change in DIB [1] broke our CentOS 8 amphora image builds only
because we've not been handling package dependencies propertly.

The DIB change now installs package "python3" which provides
/usr/bin/python3 and is a requirement of scripts in later build phases.
It so happens that we are removing package "python3-pip", a dependency
of "python36" too early so builds fail when bin python3 is required.

DIB package-installs element provides property "build-only". When set,
it will cause packages to be added both to the list of packages
installed and list of packages to be uninstalled. This allows expressing
build-time dependencies that should not end up in the final image as is
the case of packages like "build-essential" and "libffi-dev" in our
amphora-agent element.

As for the removal of Git, we do not explicitely install it so we should
not uninstall it either. Git is a fake dependency of source-repositories
element and will be abstent in the final image with [2].

[1] https://review.opendev.org/#/c/741868/
[2] https://review.opendev.org/#/c/745678/

Depends-On: https://review.opendev.org/#/c/745678/

Change-Id: I3b82180c8fcf2e2f053c6bcce405f1ea730f62ba
2020-08-11 17:21:27 +02:00
Carlos Goncalves
b29487952e Install ppc64-diag in ppc64le amphora images
This package provides rtas_errd which is necessary to process hotplug
events like VIP and member port attachments.

https://bugzilla.redhat.com/show_bug.cgi?id=1862726

Change-Id: I8b20602c5b075a6e47d3f7dc42a1bffb1b7a14ea
2020-08-03 11:15:22 +02:00
Michael Johnson
51b93c0022 Workaround broken pyroute2 0.5.13
The pyroute2 package version 0.5.13 introduced a bug[1] that breaks
amphora. Unfortunately neutron needs a different fix that is in 0.5.13,
so we are going to work around the problem until we can get pyroute2 fixed.

This patch uninstalls pyroute2 and installs version 0.5.12.

[1] https://github.com/svinota/pyroute2/issues/724

Change-Id: I365d719810de792213da47ebafa46e7e0fd2e9fa
2020-07-30 13:01:55 -07:00
Mikhail Ushanov
3ef4a75a17 fix(elements): fix nf_conntrack sysctl param names
Remove net.ipv4.tcp_tw_recycle because it has been
removed from kernel since 4.12.
Change for tcp_timeout_time_wait/tcp_timeout_fin_wait
to net.netfilter.nf_*.

Change-Id: I0e3cde5aad9e9b6007f975eafb0205e2912b19d3
Signed-off-by: Mikhail Ushanov <gm.mephisto@gmail.com>
2020-06-21 12:00:51 +00:00
Michael Johnson
81ed1334d2 Exclude acpid on Red Hat family DIB builds
Red Hat/centos do not ship acpid for ppc64le, but others do.
This patch sets up a package map for DIB to exclude the acpid
package on Red Hat family image builds, while allowing it for the
other distros.

Change-Id: Iaef520e5f2a66833228e824ec4fb41f5915169af
2020-03-23 09:27:10 -07:00
Michael Johnson
c8b044af4a Stop "dnf makecache" in the amphora images
On base operating systems that use DNF there can be a systemd timer
that attempts to call out and update the dnf cache every hour.
This patch adds an diskimage-builder element that disables this
timer as most amphora will not be successful in updating this cache
because they do not have network access or DNS services avaialable.

Change-Id: I5dec631d3e66e1dfb6b8741caea89938ee18a7d8
Story: 2007408
Task: 39019
2020-03-16 16:53:27 +00:00
Zuul
3b3d502fb2 Merge "Stop supporting CentOS 7 controllers and images" 2020-02-02 08:56:40 +00:00
Gregory Thiemonge
c2ef7792fd Use LUKS1 for certfs-ramfs for all distributions
This commit forces the use of LUKS1 in cryptsetup.

Centos uses LUKS2 by default in cryptsetup, ubuntu uses LUKS1.
Formating a LUKS2 block device is way longer than formating a LUKS1
device (15 sec vs 8 sec in my env) and LUKS2 doesn't provide any
significant features for octavia (it only improves recovery and
metadata).

The commit aslo limits the creation of more than 1 block ram device
(amphora doesn't need 16 ram devices), which reduces startup time.

Change-Id: I5cdc0a9ccc01548f195eed80f2ee2848a1a93e17
2020-01-17 10:38:45 +01:00
Carlos Goncalves
dc2dd711e6 Stop supporting CentOS 7 controllers and images
The diskimage-create.sh tool will now default to CentOS 8 when building
CentOS-based amphora images.

This patch also removes leftover references to support for Ubuntu Trusty
and Xenial.

Change-Id: I3aba59c8dd86aeeee28cc6a67af93697912fb55b
2020-01-08 17:59:09 +01:00
Carlos Goncalves
3740b67854 Add support for CentOS 8 amphora images
Change-Id: Ic3b1dab418cfd95fe261ca19528ec969ee57610e
2019-12-06 09:24:33 +00:00
Michael Johnson
7ad61bb451 Remove unnecessary interface configurations
The image building process adds some unnecessary network interface
configuration files to /etc/network/interfaces.d. This element cleans those
out as they are not needed because cloud-init will create the required
configuration file.

Change-Id: If5fbfc34ff0e91608f402811aa2b78c9cbcb00ec
2019-11-20 16:02:42 -08:00
Michael Johnson
1900ee71a5 Fix a potential race condition with certs-ramfs
There is a potential race condition in the start order for the
amphora-agent service and the certs-ramfs service.
This patch configures an explict ordering for the services.

Change-Id: I8e449b19af72d72f6effd52e0a2debb5754a19b3
Story: 2006823
Task: 37396
2019-11-11 13:45:35 -08:00
Zuul
0ee7a3cf22 Merge "Change amphora logging to dedicated socket" 2019-08-22 19:44:54 +00:00
Carlos Goncalves
a04e3e3741 Remove amphora-agent build deps
The amphora-agent element installs a few build packages when installing
the agent from source. This patch removes those large in size packages
after they are no longer needed. This will reduce the
image size significantly.

Co-Authored-By: Michael Johnson <johnsomor@gmail.com>

Change-Id: I5d12b7a987f65013daa5298f5062c1f30db23f41
2019-08-08 12:41:58 +00:00
Michael Johnson
afa917a3de Change amphora logging to dedicated socket
In some environments running older versions of gunicorn in the
amphora image, gunicorn can fail to start do to /dev/log socket
issues (timing, configuration, etc.).

This patch sets up a dedicated rsyslog socket /run/rsyslog/octavia/log
for gunicorn and haproxy to use. This should resolve any issues with
systemd overriding the /dev/log socket.

This also bumps the gunicorn minimum verison to 19.9.0.

Change-Id: I1e1ad8fde2ad8c1ffba95b1867afb130503b0a5b
2019-08-07 09:02:22 -07:00
Gregory Thiemonge
50c168e860 Fix wrong package names or versions for centos-minimal images
Since centos-minimal is used as base for centos image, dib installs
haproxy 1.5.x instead of haproxy 1.8.x, and dhcp client is missing
(dhclient package).

Depends-On: https://review.opendev.org/#/c/673172/

Story: 2006323
Task: 36056

Change-Id: I3be0fa18578c7c1552f24842a09e18c01e34358a
2019-08-06 15:39:59 +00:00
Michael Johnson
2bb2f918ee Fix cryptsetup --pbkdf-memory failures
A recent patch[1] added --pbkdf-memory to the cryptsetup command line
to limit the memory cryptsetup is using. However, some distros use
an older version of cryptsetup that does not need this setting.
This patch adds logic to detect this and run the commands without
--pbkdf-memory.

[1] https://review.opendev.org/663784

Change-Id: I9e0debcbfe6ceeff0012c827d70d80d938b5a2fb
Story: 2006066
Task: 34782
2019-07-17 21:32:45 +00:00
Zuul
5f38432c2f Merge "Fix dhclient enter hook path on RHEL-based amps" 2019-07-16 05:31:40 +00:00
Frode Nordahl
5114a9a4f9
elements: add arch property for `open-vm-tools`
The ``open-vm-tools`` package only exists for x86-platforms.

Task: 35814
Story: 2006219

Change-Id: I9f1b6e58004d7c2024f8d60d50ac998240abb6ee
2019-07-15 08:06:26 +02:00
Carlos Goncalves
6c0756864f Fix dhclient enter hook path on RHEL-based amps
dhclient-script(8) defines the enter hook path is
/etc/dhcp/dhclient-enter-hooks:

"On  after defining the make_resolv_conf function, the client script
checks for the presence of an executable /etc/dhcp/dhclient-enter-hooks
script, and if present, it invokes the script inline, using the Bourne
shell command."

This was confirmed to be valid on RHEL and CentOS 7-8, and Fedora 28-30.

Change-Id: I473f1e5c6862ebf0d691a8191d17649ccf51e7f4
Task: 35725
Story: 2006190
2019-07-09 12:34:16 +02:00
Zuul
620c19804c Merge "Add RHEL 8 amphora support" 2019-06-09 13:56:08 +00:00
Carlos Goncalves
8821737359 Add RHEL 8 amphora support
Network scripts are deprecated in RHEL 8. This patch makes sure the
package is installed and the service enabled. Sometime in the future
(Train release or newer), support for Network Manager will be added as
it became the default network configuration tool in RHEL/CentOS 8 and
Fedora 28+.

This patch also reflects a change to diskimage-builder that will now
have a version-less 'rhel' element as opposed to a separate 'rhel7'
and 'rhel8' elements.

Change-Id: Id11459ea70479aa0145059f88af847dddcd93553
2019-06-07 18:34:29 +02:00
Michael Johnson
4007d56b3e Limit cryptsetup key RAM usage
This patch limits cryptsetup to 256MB of RAM during the amphora
startup. Recent distros have changed to LUKS2 with Argon2
key derivation which defaults to using up to 1GB of RAM.
Typically our amphora are built with only 1GB of RAM for the whole
system.

Change-Id: I018e36f69a9c0b48a6651a01cc9a64abfc04d4de
Story: 2005837
Task: 33606
2019-06-06 15:10:36 -07:00
caoyuan
1910f024a3 Replace git.openstack.org URLs with opendev.org URLs
Change-Id: I291eb706df84489398b4f4b2736d7c5ab2e84747
2019-05-13 19:59:59 +00:00
Adam Harwell
28f4f9e44a Fix missing INCLUDEPKGS var in haproxy element
Change-Id: I5ccae72695642379c5e817f7335348c344480747
2019-05-03 15:28:43 -06:00
Trevor Vardeman
b1f3d949c6 Removing an erroneous comment
Left a code-comment in a change by accident, updating to remove it.

Change-Id: I97fd1de040a8bf7706b78fe1825e48761c2073ee
2019-04-23 15:31:47 -05:00
Trevor Vardeman
4c9097c681 Adding changes to support ppc64le amphora builds with CentOS
Updated diskimage create script to include an argument for disabling the temporary filesystem.
Updated diskimage create to support ppc64le as an argument.
Updated backports to support a properly configured PaaS repository for CentOS on power.

Change-Id: I8897278b1ac8b76d564f45bd0c7cbc26b29a8e5d
2019-04-18 11:11:09 -05:00
Zuul
75c1d7c1ab Merge "Make disk image buildable for fedora" 2018-12-08 14:52:21 +00:00
Nir Magnezi
fbb9397979 Fix IPv6 in Active/Standby topology
Load balancers with IPv6 VIP addresses would fail to create due to
a duplicate address detection issue. The keepalived process would also
crash with a segfault due to a known bug[1].

This patch resolves both issues and allows load balancers with IPv6
VIP addresses to be created in active/standby topology.

[1] https://github.com/acassen/keepalived/issues/457

Story: 2003451
Task: 24657
Co-Authored-By: Michael Johnson <johnsomor@gmail.com>

Change-Id: I15a4be05740e2657f998902d468e57763c3ed52e
2018-12-06 20:10:38 +00:00
Jacky Hu
a587614756 Make disk image buildable for fedora
1. Enforce amphora image size >= 3G
2. Exclude debs required by ubuntu minimal for redhat

Change-Id: I343eaf19d4bd595d5b10dc330e53d41ceccc560a
2018-10-01 12:24:35 +08:00
Michael Johnson
cc97397d1c Followup patch for UDP support
1. Removes the misc_dynamic setting from the UDP-CONNECT health monitor
   as our script does not use it.
2. Adds a release note for the UDP features.
3. Updates the API reference for UDP support.
4. Adds a comment to the keepalived config with the LB ID.
5. Updates the status message type to be the correct UDP protocol.
6. Fix error during deleting a listener if there are multiple amphoraes.
7. Refactors systemd service script handling.

Story: 2003306
Task: 24258
Change-Id: I09240023d066ac5a71836d01045cda6ce5678712
2018-08-07 20:55:11 -07:00
Michael Johnson
294e0fc128 Fixes unlimited listener connection limit
When using the Octavia/amphora driver, unspecified or unlimited (-1)
settings would lead to a 2000 connection limit in HAproxy.
This patch updates that to be 1,000,000 connections.
1,000,000 was selected to amphora memory usage at a reasonable level.

Change-Id: Iddeb62412bb71b69cf1e9198be6131c59a3051b0
Story: 1635416
Task: 5159
2018-07-19 09:47:31 +02:00
German Eichberger
464d8f9371 Introduce ipvsadm to the amphora image
This patch adds the "ipvsadm" tool to the amphora image.

Change-Id: I7ccf823cae3dbd57dc3f40aec66629e27e5db98b
2018-07-06 00:02:54 +00:00
chengebj5238
52eaaa7583 Amend the spelling error of a word
Change-Id: I7a2da9597d601740921c8e6fc16f9c37b1a60eef
2018-06-06 18:03:02 +08:00
Adam Harwell
b0a845554b Update HAProxy version for Centos
ALso tweak the systemd service config for haproxy 1.8 since it no longer
ships with a systemd wrapper.

Change-Id: If4f230dcba8c360c919f6c2d93705bf67089b2cf
2018-05-07 18:57:34 +00:00
Adam Harwell
aa1b32df54 Fix keepalived vrrp check script to be in PATH
ACTIVE_STANDBY is currently broken because keepalived can't access the
main check script.

Change-Id: I66a5df575583b0545fb00bc1170ad8064d2963aa
2018-04-25 16:49:05 -07:00
Carlos Goncalves
c5c7770e30 Add sos element to Red Hat family images
sosreport is a tool that collects information about a system.

The sos plugin for Octavia can gather information of installed packages,
log and configuration files for Octavia controller components and
amphora agent. The result is a generated report that can be used for
troubleshooting. The plugin redacts confidential data such as passwords,
certificates and secrets.

At present sos only installs in Red Hat family images as the plugin does
not support other distributions.

Change-Id: I5131a4cfdedd8b78fb673b4264ef1d7a1d613972
2018-04-19 15:51:50 +02:00
Michael Johnson
f935a51fe4 Switch to ubuntu-minimal for default amphora image
Previously we were using the "ubuntu" diskimage-builder base element as the
default base OS to build the amphora image.
The "ubuntu" element is based on the ubuntu cloud image. This image includes
packages we do not need for the amphora image. At this point it's not clear
that Ubuntu will ship an 18.04 LTS cloud image in the format the "ubuntu"
element requires.
This patch switches the default Ubuntu amphora image to build with the
"ubuntu-minimal" diskimage-builder element.

This patch also moves the amphora agent into a virtual environment inside
the amphora.

It also sets up support for Ubuntu 18.04 (bionic beaver) and HAProxy 1.8.

Change-Id: I84a85ca1363bce2e0f13da64540ec7ba3575e818
2018-04-16 18:07:31 -07:00
Bernard Cafarelli
579eaafe7f
Do not install pip in amphora when using distribution packages
pip-and-virtualenv element is not needed in that case, and can cause
image build failures in environments without direct Internet access

Change-Id: I37616d76dd78ffb1419a898509e9466e7c54f69f
2018-02-02 13:12:26 +01:00
Bernard Cafarelli
d43d3fce86 Rework amphora agent installation element
Merge source and RHEL elements, allowing both source and package based
installations.

Allow amphora agent install from distribution packages (not limited to
RHEL)

Add a new option to diskimage-create.sh script to do so (default is kept
to source installation from Octavia git tree)

For now, amphorae built with distribution packages will have SELinux
(when available) running in permissive mode.

Made the rebind-sshd element generic to streamline the script
Use POSIX syntax for logrotate kill command

Change-Id: I391b2a95d54c7b9fd8f31d3e2c136ff9cc3451f1
2018-01-22 18:04:41 -08:00
Michael Johnson
2897b340f7 Fix health monitor type "PING" to use icmp ping
Currently with Octavia, if the user specifies a health monitor of type
"PING" we are still using a TCP connect to check for health.
This patch fixes that to actually ping the member to validate health.

Change-Id: I8a67efb7113ffa49b2805b37c3855373b17e5789
Story: 2001280
Task: 5826
2017-11-29 15:23:28 -08:00
Adam Harwell
8975d7acbd Merge keepalived elements
Change-Id: I2676b26ee59ad18583df937b258549bae241e100
2017-11-10 23:59:12 +00:00