26424 Commits

Author SHA1 Message Date
elajkat
58082a8232 Doc: Refresh NDP proxy doc
Actualize NDP proxy command for merged OSC, and rewrite some sentences.

Change-Id: I92ea4b63984fee1197dcda19d6ecc5608c0f650f
2022-09-08 09:54:28 +00:00
yangjianfeng
d600b3d433 Forbid enable ndp proxy when external netwrok has no IPv6 address scope
In neutron, user can create multiple ports with same IPv6 address if
the network has no IPv6 address scope. This maybe result in some
security issues.

This can be exploited by a malicious tenant via creating a subnet with
a prefix that covers an address that is already in use and take over
(part of) the traffic flowing towards that address. The success of the
attack depends on winning the race of who answers the NDP query first,
but still a 50% chance of capturing traffic seems dangerous. The attack
works not only against other addresses served by NDP proxy, but also
against other hosts that may exist, potentially even the gateway for
the external network.

So, we should use `IPv6 address scope` to ensure the IPv6 address is
unique when we want to use `ndp proxy` feature.

Depends-on: https://review.opendev.org/#/c/855997
Closes-Bug: #1987410
Change-Id: I0fa431a91a7679e409386a357a01c31ec5ad0cfd
2022-09-06 18:45:45 +08:00
Zuul
12b21e235e Merge "utils: add option to generate dhcp device id per segmentation" 2022-09-02 09:49:46 +00:00
Zuul
cddc28ef4f Merge "dhcp/rpc: retrieve network details with segments" 2022-09-02 09:49:41 +00:00
Zuul
c8e8851e5c Merge "ovs: use a local vlan per network/segmentation" 2022-09-02 09:49:36 +00:00
Zuul
49e980e0ca Merge "ovs: make vlanmanager to handle more vlan mapping per network" 2022-09-02 09:37:33 +00:00
Sahid Orentino Ferdjaoui
8185319248 utils: add option to generate dhcp device id per segmentation
This will be used in future when dhcp will handle different
segmentation ids.

Partial-Bug: #1956435
Partial-Bug: #1764738
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: Ie005285ed667041732950a6aa226b8151d608afe
2022-09-01 14:48:54 +02:00
Sahid Orentino Ferdjaoui
7ceb935da8 dhcp/rpc: retrieve network details with segments
When segment plugin is enabled, we should return segments details as
they are part of network.

Partial-Bug: #1956435
Partial-Bug: #1764738
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: I1dab155bc812f8764d22e78ebb7d80aaaad65515
2022-09-01 14:48:54 +02:00
Sahid Orentino Ferdjaoui
7a1e253851 ovs: use a local vlan per network/segmentation
This is using changes introduced before to support for a network more
than one vlan.

Partial-Bug: #1956435
Partial-Bug: #1764738
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: Ifd61e379c3cef3589803c96a276da9827051f660
2022-09-01 14:48:54 +02:00
Sahid Orentino Ferdjaoui
6ec0bc70a7 ovs: make vlanmanager to handle more vlan mapping per network
This change is updating the vlanmanager data structure to handle for a
given network more than one vlan mapping. This is a prerequisite work
needed to progress on accepting several segments per network per
host.

The work done here is trying to avoid changing logic in the
current implementation. Unit test should not have value updated,
but probably signatures changed.

Partial-Bug: #1956435
Partial-Bug: #1764738
Signed-off-by: Sahid Orentino Ferdjaoui <sahid.ferdjaoui@industrialdiscipline.com>
Change-Id: Ic3c147136549b17aea0fe78e930a41a5b33ab9d8
2022-09-01 14:48:08 +02:00
Zuul
4b83bf462d Merge "Migration revert plan" 2022-08-31 16:40:35 +00:00
Rodolfo Alonso Hernandez
1b8d794a35 Format the protocol number to be passed to pyroute2
When a new IP route is created, before passing the route protocol,
find if it is a string and if this string is on the pyroute2 defined
protocols. In this case, pass the protocol number.

In the same way, when the IP route is returned, if the protocol is a
number, convert it to the corresponding protocol string.

Closes-Bug: #1988037
Change-Id: I4ca66d86705a55b2b63083c229629c16b6136283
2022-08-29 12:44:14 +02:00
Zuul
7dfe41ab8f Merge "Update NDP proxy documentation" 2022-08-26 20:51:50 +00:00
Zuul
2f47d2bb55 Merge "Bump revision number of objects when description is changed" 2022-08-26 16:17:37 +00:00
Dr. Jens Harbott
7587d0dede Update NDP proxy documentation
- Use only the documentation prefix in examples
- Update some formatting and wording
- Add a reference in the OVN gaps document

Signed-off-by: Dr. Jens Harbott <harbott@osism.tech>
Change-Id: I2acf762008ce44b6a792c615c153071e1c10e0b3
2022-08-26 12:09:20 +02:00
Zuul
76b6388d4b Merge "Allow operator to disable usage of random-fully" 2022-08-26 08:42:03 +00:00
David Hill
bbefe5285e Allow operator to disable usage of random-fully
In some specific use case, the cloud operator expects the source port
of a packet to stay the same across all masquerading layer up to the
destination host.   With the implementation of the random-fully code,
this behavior was changed as source_port is always rewritten no matter
which type of architecture / network CIDRs is being used in the backend.
This setting allows a user to fallback to the original behavior of the
masquerading process which is to keep the source_port consistent across
all layers.  The initial random-fully fix  prevents packet drops when
duplicate tuples are generated from two different namespace when the
source_ip:source_port goes toward the same destination so enabling this
setting would allow this issue to show again.   Perhaps a right approach
here would be to fix this "racey" situation in the kernel by perhaps
using the mac address as a seed to the tuple ...

Change-Id: Idfe5e51007b9a3eaa48779cd01edbca2f586eee5
Closes-bug: #1987396
2022-08-25 16:48:45 -04:00
Zuul
d4790238cd Merge "Allow shared net to be added on router" 2022-08-24 23:19:48 +00:00
Zuul
a2249b3cd3 Merge "[OVN] Remove ACLs with remote SG during deletion of SG" 2022-08-24 17:32:38 +00:00
Arnaud Morin
8619c104b8 Allow shared net to be added on router
This will subnets from shared networks to be added on routers using:
$ openstack router add subnet router_id subnet_id

Without this, neutron user must use a multi-router solution, which is
not convenient at all.

Closes-Bug: #1975603
Related-Bug: #1757482

Signed-off-by: Arnaud Morin <arnaud.morin@ovhcloud.com>
Change-Id: I50f07d41428e57e6bed9be16980a6c605b7d130e
2022-08-24 17:23:14 +02:00
Zuul
67aab582dc Merge "Script to remove duplicated port bindings" 2022-08-24 00:54:47 +00:00
Zuul
47f30c4af9 Merge "[OVN] Remove session check in `update_network_postcommit`" 2022-08-23 11:58:59 +00:00
Zuul
a3a4030a52 Merge "Migrate "download_gerrit_change" to use "cliff"" 2022-08-23 10:32:10 +00:00
Rodolfo Alonso Hernandez
3202a5c19e [OVN] Remove session check in `update_network_postcommit`
Since [1], when a segment is deleted because the network is before,
the segment event handler method ``_handle_segment_change`` does not
call ``_notify_mechanism_driver_for_segment_change`` and thus the
check performed in ``OVNMechanismDriver.update_network_postcommit``
is not needed anymore.

[1]https://review.opendev.org/c/openstack/neutron/+/786373

Closes-Bug: #1739798
Change-Id: I4bb22a0a0a233609a4d23af55a050356049eb214
2022-08-23 07:56:52 +00:00
Zuul
b045046cd4 Merge "Migrate "migrate_names" to use "cliff"" 2022-08-23 01:25:25 +00:00
Zuul
7a743ad1d9 Merge "ovn: Don't fail db sync if new IP allocation fails for metadata" 2022-08-22 10:45:32 +00:00
Zuul
f1926c086a Merge "[OVN][QoS] Add minimum bandwidth rule support to ML2/OVN" 2022-08-22 10:04:30 +00:00
Zuul
466ec11492 Merge "[S-RBAC] Remove definitions of not used roles" 2022-08-22 09:42:10 +00:00
Zuul
e5e2024a36 Merge "[S-RBAC] Rename ProjectAdmin* unit tests to Admin*" 2022-08-19 23:31:49 +00:00
Zuul
3833bc7494 Merge "[S-RBAC] Use ADMIN rule instead of PROJECT_ADMIN in the new policies" 2022-08-19 23:31:43 +00:00
Zuul
7928db3321 Merge "[S-RBAC] Remove system scope from the API policies" 2022-08-19 23:31:37 +00:00
Jakub Libosvar
d237a2a830 ovn: Don't fail db sync if new IP allocation fails for metadata
There is a scenario where IP allocation pool is depleted but OVN
metadata port got removed its IP manually. The DB sync script will
attempt to allocate a new IP address if DHCP is enabled in the subnet.
Since the pool has no available IP addresses an exception is raised and
the whole db sync stops.

This patch simply catches the exception, logs and error and continues
syncing other resources.

Closes-bug: #1987135
Signed-off-by: Jakub Libosvar <libosvar@redhat.com>
Change-Id: Iaa7b0d7ceb244a38fddd7676066683bf2ca72341
2022-08-19 20:24:03 +00:00
Zuul
b0a257fd33 Merge "Add vpnaas to extensions supported by ovn" 2022-08-19 14:53:50 +00:00
Slawek Kaplonski
406601debe [S-RBAC] Remove definitions of not used roles
According to latest agreement about Secure RBAC [1] we are not using
PROJECT_ADMIN and SYSTEM_{ADMIN,MEMBER,READER} roles at all, at least
for now.
So there's no point to keep definitions of those roles in the code and
this patch removes them.

[1] https://review.opendev.org/c/openstack/governance/+/847418

Change-Id: I7ecfa39615375f71902d6fed4f3c82f9049c4c61
2022-08-19 11:39:09 +02:00
Slawek Kaplonski
a23f41071e [S-RBAC] Rename ProjectAdmin* unit tests to Admin*
This change reflects latest agreement from [1] that instead of
ProjectAdmin role there will be "legacy" Admin role which behaves as
"old" Admin basically.

[1] https://review.opendev.org/c/openstack/governance/+/847418

Change-Id: I11fe3293aef95f0096935c98e05b40f8d912bc09
2022-08-19 11:26:53 +02:00
Slawek Kaplonski
211d2d9561 [S-RBAC] Use ADMIN rule instead of PROJECT_ADMIN in the new policies
According to the new guidelines accepted in [1] for now there should be
only one ADMIN role and it should have access to everything (like ADMIN
in old rules).
This patch replaces usage of PROJECT_ADMIN to ADMIN and adjusts unit
tests to reflect that change as now ADMIN user have access to all
resources, no matter if it belongs to the own or other project.

[1] https://review.opendev.org/c/openstack/governance/+/847418

Change-Id: Ib88967b492af517931d42600da687d447bd55705
2022-08-19 11:17:04 +02:00
Slawek Kaplonski
32e16bf466 [S-RBAC] Remove system scope from the API policies
According to the new guidelines accepted in [1] for now all new default
API policy rules should have "project" scope only.
This patch adjusts neutron policies according to [1].

[1] https://review.opendev.org/c/openstack/governance/+/847418

Change-Id: I1e923cc268d80087120a9c4d8a7aa4f2780cd82f
2022-08-19 11:16:44 +02:00
Zuul
b551516e30 Merge "Doc: New bug tags: pyroute2 and stable" 2022-08-18 19:08:18 +00:00
Zuul
a0cdb83ff2 Merge "Use neutron-lib method is_session_active" 2022-08-18 14:39:17 +00:00
Zuul
197d0be323 Merge "[OVN] Try to bind ports only to the ovn-controller agents" 2022-08-18 13:37:02 +00:00
Zuul
09207ba731 Merge "Don't retrieve SG port bindings when deleting a SG" 2022-08-18 08:37:47 +00:00
Rodolfo Alonso Hernandez
c5b76a8393 Script to remove duplicated port bindings
A new script to remove the duplicated port bindings was added. This
script will list all ``ml2_port_bindings`` records in the database,
finding those ones with the same port ID. Then the script removes
those ones with status=INACTIVE. This script is useful to remove
those leftovers that remain in the database after a failed live
migration.

"dry_run" mode is possible if selected in "[cli_script] dry_run"
boolean config option. The duplicated port bindings are printed in
the shell but not deleted.

Related-Bug: #1979072

Change-Id: I0de5fbb70eb852f82bd311616557985d1ce89bbf
2022-08-18 08:13:56 +00:00
Slawek Kaplonski
eda45de839 [OVN] Try to bind ports only to the ovn-controller agents
Patch [1] added getting ovn agents from the agents cache and check
if agent is alive to bound port to it.
Small issue with it was that it could check e.g. ovn metadata agent from
the host as it was only filtering agents by the host on which they are.

This patch adds filter on the agent_type so only ovn-controller agents
are taken from the cache.

[1] https://review.opendev.org/c/openstack/neutron/+/825428

Related-Bug: #1958501
Change-Id: If065204d7521c480656a22fb078bbe6273b5fc70
2022-08-18 09:59:13 +02:00
elajkat
e2ccc12489 Doc: New bug tags: pyroute2 and stable
Change-Id: I27b76daa4bbbad09eee6891fbd63692c1977c431
2022-08-18 09:30:53 +02:00
Zuul
3e8f2325d6 Merge "Fix some pylint indentation warnings" 2022-08-17 16:07:29 +00:00
Zuul
d0ab555329 Merge "`Session.autocommit` parameter is removed" 2022-08-17 15:48:53 +00:00
Zuul
dcf38781a3 Merge "Fix deprecation warnings in pkg_resources" 2022-08-15 19:32:20 +00:00
Zuul
4ee55ec0e1 Merge "Fix a deprecation warning about escape sequence" 2022-08-15 15:20:38 +00:00
Zuul
08c7fbbf5f Merge "Fix deprecation warnings about oslo.context" 2022-08-15 13:53:39 +00:00
Zuul
129429c93f Merge "[ovn] Specify port type if it's a router port when updating" 2022-08-13 16:02:00 +00:00