Commit Graph

4 Commits

Author SHA1 Message Date
siavash sardari 0b7a8645de Add ovs support for lxc containers.
The main problem this commit is resolving is that with openvswitch,
the ports were not get cleaned up, and after restart (hard restart or even with soft restart
lxc.service gets time-out) containers couldn't start properly, due to existing port on the bridges.

Change-Id: I707dbfc6878095f7593abe3fca3a5e5b310063e5
Depends-On: https://review.opendev.org/c/openstack/openstack-ansible/+/837742
2022-06-08 08:10:06 +00:00
Gaudenz Steinlin 9a0dbf05f3 Wait for 2s after restarting systemd-networkd
Systemd has a limit of 5 service restart in 10 seconds. If a service is
restarted more often it fails. The lxc-vet-wiring.sh script can trigger
this if more than 5 interfaces are configured in a container. To avoid
this failure wait for 2s after each service restart.

Change-Id: I4ca394314b1fa9c5f3ac5918e98a497ca5b55471
2022-04-11 12:17:08 +02:00
Kevin Carter 815ece7454 Unify container network interfaces with networkd
Unify container network interfaces using Systemd Networkd for ubuntu,
centos, and openSUSE. This change allows the role to use a single way to
configure container networks.

Care has been taken to ensure we're able to cleanly upgrade to the new
capabilities within existing environments without breaking any feature
compatibility or causing any container restarts.

It's also worth noting that all of the pre/post networking up/down
script options have been converted to systemd "oneshot" services. This
retains the ability to run adhoc scripts post network availability
while also opening up this capability, which used to be ubuntu only,
to all of our supported operating systems.

> Our usage of `lxc-attach` was removed in favor of `nsenter` to fix a
  issue where multiple `lxc-attach` commands issued to a single physical
  host could result in a hang.

> Scripts that were being generated inline have been placed into
  template files. This solves a long standing memory consumption issue
  when creating lots of containers. The old shell tasks will now be 
  executed from a generated script. While this should also help with 
  debugging, the main driver is to ensure better system stability.

> A lot of cleanup has been done throughout the task files and
  templates. In the process of updating the role to use unified
  networking a lot of duplicate tasks, scripts, and processes have
  consolidated.

> Handlers have been added for network connection wait conditions and
  to various service restarts.

> The OSA plugins have been added to this role as a dependency. We
  rely on the connection plugins throughout the stack however we were
  doing a lot of workarounds to cater to the possibility of a deployer
  running this role without them. This change simply adds the plugins
  as a known dependency which allows for a more streamlined setup.

Change-Id: I5d3ddcfa11d575648a69a04f2fb30236c2c89da3
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2018-03-01 10:55:14 +00:00
Kevin Carter e48e4fe204 Modify container network create for seamless additions
This change adds the ability for a container to have network interfaces
added without needing to restart to get the interfaces online. Adding
the interface with the container online will be faster and allow for
rolling changes in an environment that may effect critical services that
run from within a container.

Change-Id: I68048ae10cdd52fc3b5c43542686e056237a9305
Signed-off-by: Kevin Carter <kevin.carter@rackspace.com>
2016-08-12 17:01:59 +00:00