35 Commits

Author SHA1 Message Date
Mark Goddard
3bbf736d8d Ubuntu: support systemd-networkd
This change adds support for network configuration via systemd-networkd
on Ubuntu systems.

This is implemented via an Ansible Galaxy role,
stackhpc.systemd_networkd which was forked from
aruhier.systemd_networkd. Several improvements were made in
https://github.com/stackhpc/ansible-role-systemd-networkd/pull/1,
including:

* Add support for removing unexpected config files
* Use become where necessary
* Refactor config generation into a single task to improve performance

The systemd_networkd role does not add much abstraction on top of the
systemd-networkd configuration file format, which provides a lot of
flexibility at the expense of additional code in Kayobe. This code is
implemented as filter plugins, similarly to the existing
MichaelRigart.interfaces role.

This patch includes support for:

* Ethernet interfaces
* bridges
* bonds
* VLANs
* virtual Ethernet pairs (to connect Linux bridges and OVS bridges)
* static IP addresses
* static routes
* MTU

Some network attributes are currently not supported for
systemd-networkd:

* rules
* route options
* ethtool_opts
* zone
* allowed addresses

Story: 2004960
Task: 41881

Change-Id: I248b5bb9ce5a80a07a2a311cb3aca6daca920720
2021-04-21 08:23:44 +00:00
Mark Goddard
2d70af0122 Refactor network filter plugins to a Python module
This is in preparation for addition of filters for systemd-networkd.

Change-Id: If9f7041cca9467ca958174d7187d30ea94d39df2
Story: 2004960
Task: 41919
2021-03-12 17:20:02 +00:00
Bartosz Bezak
d10d95f949 Support for firewalld ZONE option in network interfaces configuration
Change-Id: Id21616b5c03922002cd7c99d6df7976a502b4e3c
Story: 2008369
Task: 41279
2020-11-19 15:19:52 +01:00
Pierre Riteau
2606c23812 Avoid setting IPADDR=0.0.0.0
Configuring network interfaces with IPADDR=0.0.0.0 may fail with:
Error, some other host (FF:FF:FF:FF:FF:FF) already uses address 0.0.0.0.

Change-Id: I908dc3320cb1dce7a040a1dbfeac414ace22d6e3
Co-Authored-By: Bartosz Bezak <bartosz@stackhpc.com>
Story: 2007900
Task: 40289
2020-09-16 15:29:14 +02:00
Pierre Riteau
ea4a507f04 Support setting ethtool options on network interfaces
Change-Id: I5650b8b489d5968b42526e45667dfc7fa6ad7b2f
Story: 2008020
Task: 40672
2020-08-17 16:35:11 +02:00
Mark Goddard
2b86fd9945 Add support for custom options in static routes
Currently it is possible to set the CIDR, gateway and route table for
static routes. Other options cannot be set. This change adds support for
setting arbitrary options via an 'options' attribute in the route, which
should be a list of additional options to apply.

Depends on
https://github.com/michaelrigart/ansible-role-interfaces/pull/74.

Story: 2007835
Task: 40122

Change-Id: Ib27deac4ddf4976a571b192ee5d1b8ca57701916
2020-07-08 19:25:40 +02:00
Mark Goddard
35f30a61b1 Fix external API interface with out an IP address
Steps to reproduce:

* Define a separate network for the external API network
* Don't define a cidr field for the new network (prevents IPs being
  allocated to hosts on this network)
* Set the vip_address field for the network (and optionally fqdn)
* kayobe overcloud host configure
* kayobe overcloud service deploy
* kayobe overcloud host configure (again)

On the final command, keepalived will have created a VIP on the
interface, causing the command to fail with an error like the following:

    Interface eth0 has an IPv4 address but none was requested

This change fixes the issue by passing the VIP address as an allowed
address to the MichaelRigart.interfaces role. This depends on
https://github.com/michaelrigart/ansible-role-interfaces/pull/71.

Change-Id: Ic86c0ca1b8209c968cb20a11bb3f40da71f296d0
Story: 2007736
Task: 39902
2020-06-01 09:18:27 +00:00
jacky06
b540482171 Remove six
Six is a python 2 and 3 compatibility library, remove it since openstack
use python3

Change-Id: Ib0e84ce417759843eccc2606ccb621242411e6c2
2020-05-28 10:30:07 +01:00
Zuul
78e0e064b7 Merge "Convert network MTU to an integer" 2019-02-01 19:14:02 +00:00
Mark Goddard
983ce3dae2 Convert network MTU to an integer
This seems to be required for the seed VM, if an MTU is specified.

Change-Id: I49d7893ab6900b3bd66eec1f6b03cf89c917e5bd
2019-01-31 16:58:15 +00:00
Pierre Riteau
55f73c52ca Add support for setting defroute
Change-Id: I483d8f4189a569d58bc95591c7c86a88c9c5b5f3
Story: 2004884
Task: 29165
2019-01-29 14:58:21 +00:00
stack
8cf23b7578 Support DHCP for managed network interfaces
Adds support for setting the boot protocol of a network interface. Valid values
are 'static' and 'dhcp'.  The default is 'static'. When set to 'dhcp', an
external DHCP server must be provided.

Change-Id: Ie4cafdcd24c6706009ca9e8accac2017d7d6bba7
Story: 2001967
Task: 15717
2018-05-09 19:12:00 +01:00
Mark Goddard
dbb92fb42d Pass MTU configuration to seed VM's configdrive
This ensures that the seed VM honours any MTU configuration following its
initial provisioning.
2018-01-16 19:36:49 +00:00
Jonathan Davies
99b93ad9c7 networks.py: Added up/down-delay and lacp rate options. 2017-11-03 17:01:41 +00:00
Jonathan Davies
a2b75046b9 networks.py: Added xmit_hash_policy to bonding option filters. 2017-11-03 10:09:20 +00:00
Mark Goddard
cd5605fa71 Add support for configuration of IP route tables and rules 2017-10-26 11:06:19 +00:00
Mark Goddard
4f1ba98167 Allow limiting physical network interface configuration to subsets
Allow the physical network interface configuration to be limited to a subset of
interfaces, either by interface name or switch interface description. This is done
via:

kayobe physical network configure --interface-limit interface1,interface2

or

kayobe physical network configure --interface-description-limit host1,host2

Fixes: #25
2017-10-17 11:48:36 +00:00
Mark Goddard
a62ad6b0d3 Allow switch ports to be excluded from NGS trunk port list
Currently we use the switch interface descriptions in the
switch_interface_config variable with the
kolla_neutron_ml2_generic_switch_trunk_port_hosts variable to generate a list
of ports for each switch that should be added as trunk ports to all networks.

This change allows switch interfaces to be given an 'ngs_trunk_port' boolean
field which can be used to exclude matching interfaces from the list. This
may be useful in cases where a host has multiple interfaces but only some
should be added as trunk ports.
2017-09-11 10:29:13 +00:00
Mark Goddard
5c6d85adfa Add network configuration for gateways in provisioning and inspection networks
These allow us to use different gateways for compute nodes on the inspection
and provisioning networks than on the control plane hosts also accessing these
networks.
2017-09-01 18:22:42 +00:00
Mark Goddard
e5cec6aed3 Add support for setting bmc_type=intel for Intel BMCs 2017-08-29 13:12:47 +00:00
Mark Goddard
b24db07b35 Explicitly set IP=0.0.0.0 on interfaces with no IP address
This will remove any existing IP address from the interface.
2017-08-22 15:12:06 +00:00
Mark Goddard
c7cf0d1688 Add support for physical_network attribute of networks
A network may be assigned a physical network by defining a variable of
the form <network>_physical_network. Currently this is not used by
kayobe but may be referenced in configuration e.g. when setting
neutron_vlan_ranges.
2017-08-07 12:08:41 +00:00
Mark Goddard
2afc6fabae Add support for bonded (LAG) host network interfaces
This is configured by setting the <network>_bond_slaves variable to a list
of network interfaces to act as slaves.
2017-08-07 12:08:41 +00:00
Mark Goddard
a82047f14f Improve automation of seed VM network configuration
The list of libvirt networks is now generated from the seed's network interfaces.
This can be overridden if necessary.
2017-08-07 12:08:41 +00:00
Mark Goddard
22b56d5a03 Add support for static routes on networks 2017-07-05 19:05:25 +01:00
Mark Goddard
eb8a42e911 Support configuration of controller ports for neutron ML2 generic switch driver
We use the switch interface configuration to provide a list of interfaces
to the neutron ML2 generic switch driver to be configured as trunk ports
in each neutron network. These interfaces correspond to the controllers
by default, which need access to all of the networks in order to provide
services such as DHCP and routing.

Related-Bug: #1690115
2017-05-11 19:09:43 +01:00
Mark Goddard
7807016862 License kayobe project under Apache2
All python files now have a license header and copyright notice
2017-04-06 10:15:29 +01:00
Mark Goddard
3b5d71d399 Separate IP allocation pool for inspection from kayobe and neutron pools
This ensures that the inspection DHCP servers do not allocate IP addresses from
the same pool as kayobe and neutron.
2017-04-05 14:21:57 +01:00
Mark Goddard
c56d126ddc Add inspector rules to add system vendor to metadata, use to set bmc_type 2017-04-05 11:23:44 +01:00
Mark Goddard
518be97adb Support specification of separate IP allocation pool for Neutron
Allows us to define separate IP ranges for use by Kayobe control plane and Neutron
2017-04-01 09:25:10 +01:00
Mark Goddard
26be2c5af3 Support Neutron VLAN networks
For VLAN networks we need to use a tagged Linux bridge on the controller with a
veth pair to link it to the corresponding Neutron OVS bridge. This must be done
for the physical network(s) carrying the provisioning, tenant, and external
network traffic. We also need untagged VLAN subinterfaces on the tagged bridge
for the controller to communicate on these networks with.

The network interface role in use requires that we use two passes through
interface configuration to ensure that VLAN subinterfaces can be added to
bridge interfaces.

Finally, we must configure Ironic with the name of the Neutron network used
for provisioning.
2017-03-24 16:14:48 +00:00
Mark Goddard
ff7c40d3b5 Add filter for network prefix 2017-03-24 16:14:48 +00:00
Mark Goddard
dc45036c92 Add a net_mask filter 2017-03-24 15:11:32 +00:00
stack
6b2f5dd7e2 Add support for configuring MTU on network interfaces 2017-03-17 17:12:27 +00:00
Mark Goddard
b654a70e65 Initial mega commit of Kayobe 2017-02-14 15:14:29 +00:00