124 Commits

Author SHA1 Message Date
David Ames
a1639fe51f Enable isolated provider network metadata access
When an isolated provider network with no virtual routers metadata
access occurs in the qdhcp netns.

Without the force_metadata option in dhcp_agent.ini and the haproxy
package installed ns-metadata-proxy is not enabled. ns-metdata-proxy
sits in the ip netns and proxies requests from 169.254.169.254 to the
nova-api-metadata service outside the netns.

This change adds the force_metadata option and installs haproxy when
enable-local-dhcp-and-metadata is True.

Closes-Bug: #1831935

Change-Id: Iaad1501e8d7d58888ef0917b6700d22a7cf05ecf
2019-06-07 10:34:50 -07:00
Sahid Orentino Ferdjaoui
380adb7271 pci: use sriov-device-mappings when configure sriov devices
When 'sriov-numvfs' is configured in 'auto', only the devies set in
'sriov-device-mappings' are discovered and automatically configured.

Change-Id: I1be61a19639d366d787fb92815c3a8a5c302fbda
Closes-Bug: #1818975
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-05-23 09:58:02 +02:00
Sahid Orentino Ferdjaoui
440d6f0f49 dpdk: set global mtu to the dpdk interfaces
Change-Id: I7d3c5fbd15b993e2ce8d48fac049ecab5e401fae
Closes-Bug: 1827256
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-05-14 17:13:16 +02:00
Sahid Orentino Ferdjaoui
9d0473c2a9 dpdk: add function to set mtu to dpdk interfaces
Change-Id: Id503f76740cc270b55e48480d95577a31933fea6
Related-Bug: 1827256
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-05-14 17:13:16 +02:00
Sahid Orentino Ferdjaoui
381a3b1a33 hooks: fix initial sriov configurations
To configure SRIOV devices it was expected that the 'sriov-numvfs'
config option to be changed but during an initial setup this not
happens.

In this commit we remove the condition but add a logic in
PCINetDevice to avoid reconfiguring PF devices if not necessary.

Change-Id: Ib8232b29f76ca7e25e1cd835d5e31a276000f1d4
Closes-Bug: #1817079
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-03-07 11:54:37 +00:00
Sahid Orentino Ferdjaoui
450cf845be pci: refactor set_sriov_numvfs to handle reset call
We should reset PF before to be able to allocate new VFs. This commit
is moving that part in PCIDevDevice that to refactor the code and in
order to fix related issue #1817079 in the next commit.

Change-Id: I17ba3908469ab604bf5eda3528e0b50b2e5e968f
Related-to: ##1817079
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@canonical.com>
2019-03-07 11:54:33 +00:00
Dmitrii Shcherbakov
1486c83a1f Allow dvr_snat l3 agent mode to be used with DVR
Currently it is a requirement to have a network node with an l3 agent
running in the dvr_snat mode even for DVR deployments that do not use
SNAT or have a very limited usage of SNAT.

It is not possible to disable snat completely:
https://bugs.launchpad.net/neutron/+bug/1761591

Neutron creates a network:router_centralized_snat port and if it is not
possible to find a dvr_snat agent to schedule it on there are various
side-effects which are not seen at first. For example, Designate stops
creating records for floating IPs and Neutron/Designate integration is,
therefore, not functional.

The Neutron DVR documentation says that dvr_snat should be used on
network nodes. However, there is nothing restricting a DVR deployment
from using dvr_snat l3 agents on every compute node and not having
dedicated network nodes.

This change modifies neutron-openvswitch to optionally enable dvr_snat
l3 agent mode (this includes supporting L3HA routers if enabled). As a
result, it is possible to have deployments without neutron-gateway thus
saving on the amount of required nodes. Care should be taken when a
large amount of L3HA routers is used and using DVR routers without L3HA
is a recommended.

Change-Id: Iad3a64967f91c81312911f6db856ce2271b0e068
Closes-Bug: #1808045
2018-12-12 00:37:29 +03:00
David Ames
b404c18a50 Explicitly install dependencies for DVR
The DVR package neutron-l3-agent depends on python-neutron-fwaas or
python3-neutron-fwaas. On Rocky without being explicit it will
incorrectly install the python2 version which in turn installs many
python2 dependencies.

This change explicitly adds python3-neutron-fwaas as a dependency on
Rocky and updates python-neutron-fwaas as a purge package.

Change-Id: Idb537df84b044e8ea92527a5f56ab06a37b9ffad
Closes-Bug: #1803744
2018-11-16 11:59:13 -08:00
James Page
3015d95af8 py3: Switch to Python 3 for OpenStack Rocky
Switch to execution of Neutron agents under Python 3 for
OpenStack Rocky; this is triggered by the nova-compute charm
mutating the container scoped neutron-plugin relation post
OpenStack series upgrade.

Update default smoke test target to bionic-rocky.

Change-Id: Ic5e96336b6a2ca474fc28d358553c6a05e1a75ce
2018-10-04 14:58:19 +01:00
James Page
3b72caa031 Gate install of tmpfiles configuration
The vhost-user tmpfiles configuration is only applicable in deployments
using libvirt/kvm with nova-compute.

Ensure appropriate user and group exists before installing tmpfiles.d
configuration.

Change-Id: I471ff459e5f979cb6781193fb074f6f5f7ee967f
Closes-Bug: 1792414
2018-09-13 11:17:46 -06:00
Zuul
a1b35bb5b9 Merge "Misc updates for DPDK support" 2018-09-07 11:09:49 +00:00
James Page
96c1788e94 Misc updates for DPDK support
Fix use of OVS DPDK context by direct use of methods on context
for OVS table values.

For modern OVS versions that require the PCI address of the
DPDK device for type=dpdk ports, use a hash of the PCI address
for the port name rather than the index of the PCI device in
the current list of devices to use; this is idempotent in the
event that the configuration changes and new devices appear
in the list of devices to use for DPDK.

Only set OVS table values if the value has changed; OVS will
try to re-allocate hugepage memory, irrespective as to whether
the table value actually changed.

Switch to using /run/libvirt-vhost-user for libvirt created DPDK
sockets, allowing libvirt to directly create the socket as part
of instance creation; Use systemd-tmpfiles to ensure that the
vhost-user subdirectory is re-created on boot with the correct
permissions.

Scan data-port and dpdk-bond-mappings for PCI devices to use
for DPDK to avoid having to replicate all PCI devices in data-port
configuration when DPDK bonds are in use.

Change-Id: I2964046bc8681fa870d61c6cd23b6ad6fee47bf4
2018-09-04 12:43:03 +01:00
James Page
56d60366c7 Deal with lack of neutron-plugin-openvswitch-agent
The neutron-plugin-openvswitch-agent package has been dropped @ Rocky.

Pre-install neutron-common and ensure any previously cached os_release
value is reset when evaluating which OpenStack release is being installed,
ensuring that the correct package for the neutron-openvswitch-agent is
used.

Closes-Bug: #1788266
Change-Id: I1224aa7f5e7caa6a8aaf2ab3043fac9c62735749
2018-08-22 16:17:34 +00:00
Edward Hope-Morley
e8af22633b Fix charm upgrade broken by commit 862c362
Currently, upgrading this charm on a host that is running
ovs >= 2.6 will break because the OVS_DEFAULT config file
is not expected to be written by the charm.

Change-Id: I33352deb3b60231347045d5f39f3508a29dda61e
2018-07-17 14:31:49 +01:00
Nikolay Nikolaev
587de9197e ovs-dpdk: add dpdk-bond-config config option
This allows more fine grained control over the bond mode
and LACP settings. Directly mapped to what OVS-DPDK configuration
exposes.

Change-Id: I1cca1043058f1ec99f194c1bdb611ebd603d646d
2018-06-21 12:38:02 +03:00
Nikolay Nikolaev
8225b4dca9 Add dpdk-bond-mappings configuration option
The current charm does not support creating and managing bonded network
interfaces. They are managed externaly. This is not possible when DPDK
is enabled. In this case OVS exposes the DPDK bond PMD which enslaves
the corresponding attached bond interfaces.

The new dpdk-bond-mappings configuration option allows such configuration
where mac:bond is specified. When the data-port configuration is processed
dpdk-bond-mappings are consulted to identify if the port belongs to a bond.
If this is true - then the bond is created with the mac designated interface
and the bond is added to the bridge. Subsequently more interfaces can be
added to the same bond.

Change-Id: I0224caaa1c2431c793c4f64caa7fc9e95b972fd7
2018-06-21 12:38:01 +03:00
Nikolay Nikolaev
862c362296 ovs-dpdk: support late initialization since ovs 2.6.0
OVS 2.6.0 introduces new mechanisms to configure the DPDK netdev
provider. It now relies on the database and allows dynamic runtime
configuration. Network interface binding is more fine grained by
specifying the NIC PCI address and not relying on special port naming
and indexing.

Here we introduce the support of post 2.6.0 OVS-DPDK and change the
relevant tests.

Change-Id: Ic0185097d65df04a2b566e16cb22bcbd088eed3e
2018-06-12 14:21:48 +03:00
James Page
f4ef607187 Fix misc unit test failures
A recent commit landed with failing unit tests, but due to
gate misconfiguration this was not picked up during pre-commit
testing.

Fixup offending code.

Change-Id: I20488efabe91b2423c85dd4e7474cbaf9a0a0261
2018-05-24 15:52:39 -07:00
Michael Skalka
07254a5c59 Enable IPFIX exporting for OVS bridges.
Adds a config option and calls to enable IPFIX exporting on all OVS
bridges created on a system by the OVS charm.

Closes-Bug: 1768016

Change-Id: Id2591ac5f39319d50ba235f6b9b5d493e7885d3a
2018-05-09 12:32:05 -04:00
James Page
fe9633856b Remove deploy from source support
Drop support for deployment from Git repositories, as deprecated
in the 17.02 charm release.  This feature is unmaintained and has
no known users.

Change-Id: Ib954ddd1fb63d409af77949d8e76a6d6da8f2cde
2018-01-10 12:01:23 +00:00
James Page
46faae4ff8 Drop zeromq support
Support for the ZeroMQ messaging driver has bit-rotted over
the last few years across the OpenStack charms; drop support
for ZMQ inline with deprecation notices issued in 17.02 charm
release.

Change-Id: I3a4f4bc84327ee2e269d3ebd93d102494102b05e
2017-12-15 12:26:50 -08:00
James Page
0e86a664be Update to run under Python 3
Refactoring of charm to support execution under Python 3.

Change-Id: I8d48614f38abf31159311d82b0cbb54e60f710c1
2017-11-20 08:54:31 -08:00
Jenkins
6421d19b98 Merge "Add deprecation notice for prevent-arp-spoofing" 2017-08-24 20:29:50 +00:00
Frode Nordahl
4ffbc2fe25 Fix handling of SR-IOV interface configuration
SR-IOV interfaces are currently only configured on charm
installation and not after seubsequent reboots.

The VFs need to be configured before the Neutron SR-IOV
agent is started. Charms should also really not be involved
in boot time system configuration. Due to these factors
this commit adds a init script and corrensponding systemd
unit file and upstart job to handle the boot-time configuration.

Keep configure_sriov function for runtime configuration. Add
warning about runtime configuration disrupting network service.

Add restart of Neutron SR-IOV agent after runtime configuration.

Cap value of sriov-numvfs at each interfaces sriov_totalvfs value.

Change-Id: I7bde7217bf027db09ded35a262c214ccb11d6d86
Closes-Bug: #1697572
2017-08-24 12:34:58 -07:00
Edward Hope-Morley
3c2553b055 Add deprecation notice for prevent-arp-spoofing
Config option will have no effect for >= Ocata.
Also adds log WARNING.

Change-Id: I06b78152a9e42e5411d6a426073641ce474573ff
Closes-Bug: 1691080
2017-08-24 13:57:33 +01:00
Edward Hope-Morley
fbed3f3d7a Support configurable metadata_workers
Adds config option worker-multiplier to allow
configuring the number of workers used for the
metadata api when using local dhcp.

Change-Id: Ie3a7d6aab0d9902a6637637fbf75b2df3ec084b1
Closes-Bug: 1707618
2017-08-11 18:20:13 +01:00
James Page
5967b18b50 deepcopy SRIOV_RESOURCE_MAP
Ensure that a full copy of the SR-IOV resource map is made when
building the full resource_map for the charm; this avoids any
direct manipulation of the constant SRIOV_RESOURCE_MAP and
some associated unit test failures.

Change-Id: Ia1d1da9e625fa85dc0afc8931b11bc2b30b41c09
2017-08-01 09:06:07 +01:00
Frode Nordahl
25450d27fa Handle neutron-sriov-agent on Kilo and Liberty
On Kilo and Liberty the agent is called 'neutron-plugin-sriov-agent'.

Add unit-test to verify package determination.
Add functional test to verify that configuration is written.

Change-Id: I8a40c12cbb7f6a692b19105d5c029fd7f2829504
Closes-Bug: #1696691
2017-06-13 16:59:37 +02:00
Billy Olsen
9ce4995205 Add dnsmasq-flags to charm-neutron-openvswitch
Add a new option to provide the ability to specify flags in the
dnsmasq.conf file. This allows users to configure the dnsmasq
processes used by the neutron-dhcp-agent when local dhcp and
metadata are enabled for provider networks.

Change-Id: I2bab8a00322afb0f81986001c86f0ef4fc535651
Closes-Bug: #1684231
2017-05-02 15:54:24 -07:00
Jenkins
0fb6c60db4 Merge "Add support of a linuxbridge bridge in data-port config" 2017-05-01 00:57:28 +00:00
Alex Kavanagh
4c916a02ac Fix alphanumeric comparisons for openstack and ubuntu releases
- sync charmhelpers with fix-alpha helpers
- fix up code where the alpha comparisons are done
- fix tests which assumed mocks would just work on os_release()

Change-Id: Ifa495c37adeb24aa98e4e5e181b90cbbd5c0cddb
Related-Bug: #1659575
2017-04-03 17:59:54 +01:00
Matt Rae
f832f1073d Add support of a linuxbridge bridge in data-port config
When configuring data-port parameter with "ovs-bridge:linuxbridge"
a veth pair will be created to connect these two bridges. Name of
these virtual interfaces will be "veth-ovsbridge_name" and
"veth-linuxbridge_name".

Problem: When deploying neutron-openvswitch charm on a node contain
only one interface, we are not able to connect an ovs Bridge to
the physical interface because it is assigned to juju Bridge.

Change-Id: I5be72b9cc5948f5f791d522d1b46fd27e7303613
Closes-Bug:#1635067
2017-03-17 10:22:00 -07:00
James Page
790819c237 Update SR-IOV support for >= Mitaka
SR-IOV network for OpenStack release later than Mitaka requires the
use of the neutron-sriov-agent to support management of SR-IOV PF
and VF interface state by Neutron - said interfaces are still
consumed directly by nova-compute/libvirt via PCI device allocation
scheduling for instances.

Add new configuration options to the neutron-openvswitch charm to
support enablement of the SR-IOV agent; this could have been done
automatically from data presented from neutron-api, but its possible
that cloud deployments may only have subsets of compute nodes that
are SR-IOV enabled in terms of hardware.

Enabling this option ('enable-sriov') will install and configure
the neutron-sriov-agent; configuration of SR-IOV PF's are made
using the 'sriov-numvfs', which by default automatically configures
all SR-IOV devices on every machine to the maximum number of VF's
supported by the device.  This option can be used to configure
devices at an individual level as well.

Finally, neutron needs to understand what underlying provider
network each SR-IOV device maps to - this is configured using the
sriov-device-mappings configuration option.

Change-Id: Ie185fd347ddc1b11e9ed13cefaf44fb7c8546ab0
2017-02-07 14:55:32 +01:00
Liam Young
d57a6e9a4e Do not create MTU upstart scripts on xenial+
MTU scripts are no longer needed as MAAS 1.9 can set the mtu and
bring up the interfaces.

The charm has no systemd versions of the 'os-charm-phy-mic-mtu'
and 'ext-port' scripts either so for xenial to set mtu sizes
on physical nics use MAAS 1.9 and appropriate network config

Change-Id: I3aa4d2a80a08dd605d4ae08d53f35282017e1009
Partial-Bug: 1566786
2017-01-05 13:51:29 +00:00
Tytus Kurek
297b7eae98 Add support for 'availability_zone' parameter.
I've added support for 'availability_zone' parameter. I've added
'dhcp_agent.ini' template and implemented the parameter to be consumed
via 'neutron-plugin' relation settings.

Change-Id: I015a6dfcf89800043bd7dbf02b07da07d8a7d728
Closes-Bug: 1595937
2016-12-09 14:02:56 +00:00
Liam Young
4463c334ca Restart openvswitch-vswitch when requested
Restart requests can be sent by related charms. A request to restart
services did not previously restart openvswitch. This change adds the
ability to restart it.

Closes-Bug: 1628093
Change-Id: I0f57d84e2cdaa103c18a1cdacd996f9421fba46c
2016-09-27 15:20:04 +00:00
James Page
7e4bd68494 Add support for application version
Juju 2.0 provides support for display of the version of
an application deployed by a charm in juju status.

Insert the os_application_version_set function into the
existing assess_status function - this gets called after
all hook executions, and periodically after that, so any
changes in package versions due to normal system updates
will also be reflected in the status output.

This review also includes a resync of charm-helpers to
pickup hookenv and contrib.openstack support for this
feature.

Change-Id: Ia91a2de062fbc13fdb2b366217278bb96fc648fa
2016-09-20 12:32:57 +01:00
Jenkins
130c778842 Merge "Add neutron-control interface" 2016-09-09 14:09:06 +00:00
Liam Young
a92b6fb881 Add neutron-control interface
Add neutron-control interface to allow charms to send triggers to
restart neutron services managed by this charm

Change-Id: I0e44f7cab99db4fb9b5d2764859e16b30705e6fe
2016-08-31 10:40:07 +00:00
Corey Bryant
1495b034b8 Install ipset package when deploying from source.
Change-Id: I52f128ec919d9f58f7a568b9a5aa39767db89f95
2016-08-12 19:14:37 +00:00
Corey Bryant
faaf51e7ba Add systemd init support for deploy from source
systemd is used instead of upstart by default since Ubuntu 15.10
(Wily).  This adds systemd init file support for nova services
that are deployed from source.

Change-Id: I7d031e86853a3fb8b91501dc6bbd7f5f1b67701d
2016-07-13 19:25:46 +00:00
James Page
ed83413331 Re-license charm as Apache-2.0
All contributions to this charm where made under Canonical
copyright; switch to Apache-2.0 license as agreed so we
can move forward with official project status.

Change-Id: I7bd44dc15ad951bf2536e5ee10de01ec592b8970
2016-07-01 17:36:39 +01:00
Corey Bryant
9ad5cf9637 Add defaults for openstack-origin-git config option
openstack-origin-git currently only supports YAML that specifies
the git repositories to deploy from.

This adds support for default openstack-origin-git values. The
default values supported are: icehouse, kilo, liberty, mitaka,
and master.  For example: openstack-origin-git=master.

Change-Id: I032cb58283d54a9ccfcc268a7fd70b460a03aa58
2016-06-20 09:42:16 -04:00
Liam Young
236bb562f1 Restart services when trigger from principle
Check to see if a restart trigger has been sent by the principle,
if it has then right the trigger uuid in to the neutron.conf to
trigger a service restart

Change-Id: I19649cb73dad94f4fe24412c0b8c37a28f30047d
Partial-Bug: 1571634
2016-04-19 05:47:04 +00:00
Alex Kavanagh
1dfe139242 Modify add_bridge_ports(...) to include port up and permisc code
This fixes bug#1570411 where the add_bridge_port(...) function was
modified to include a port type but missed off port up and promisc
features.

Change-Id: I2a304270be97ed1eae5a7ceeb5777514460d8b4f
Closes-Bug: #1570411
2016-04-15 12:18:13 +00:00
James Page
acd617f4ca Add support for DPDK userspace networking
Add full support for DPDK; this includes a number of configuration
options to allow the number of cores and memory allocated per
NUMA node to be changed.  By default, the first core and 1024MB of
RAM of each NUMA node will be configured for DPDK use.

When DPDK is enabled, OVS bridges are configured as datapath type
'netdev' rather than type 'system' to allow use of userspace
DPDK packet processing; Security groups are also disabled, as
iptables based rules cannot be applied against userspace sockets.

DPDK device binding is undertaken using /etc/dpdk/interfaces and
the dpdk init script provided as part of the DPDK package; device
resolution is determined using the data-port configuration option
using the <bridge:<mac address> format - MAC addresses are used
to resolve underlying PCI device names for binding with DPDK.

It's assumed that hugepage memory configuration is either done as
part of system boot as kernel command line options (set via MAAS)
or using the hugepages configuration option on the nova-compute
charm.

Change-Id: Ieb2ac522b07e495f1855e304d31eef59c316c0e4
2016-04-07 12:42:16 +01:00
Alex Kavanagh
a9b41dfbed Enhanced pause/resume for maintenance mode
Add in pause/resume feature for maintenance mode along with tests.
Sync charmhelpers with support for the maintenance mode feature.

Change-Id: I075459e56ce34e78f5206d116208165aa43aae21
2016-03-30 19:57:58 +00:00
James Page
fb8c6021b3 Deal with neutron changes forthcoming 2016-02-23 14:32:45 +00:00
James Page
f7c430f9d0 Ensure that metadata agent packages are not uninstalled if dvr is enabled but local dhcp is not 2015-11-12 09:33:27 +00:00
Liam Young
bbecca866a Added workload status 2015-10-07 10:41:12 +00:00