Ports within ip_local_port_range can be used by the local side
of connections. Avoid using them as there should be no downside
from using narrower port range thanks to ExclusiveResource
allocators.
Change-Id: I30e8e40073117e63bf9a99f13000d83a87e64f29
Closes-Bug: #1551288
This adds a check to the ML2 create and update port methods which
are called by other services to manipulate ports. This check prevents
them from passing in a context that is already part of an ongoing DB
session because we do not want DB rollbacks to be allowed after the
ML2 plugin calls postcommit methods on drivers.
This also adds a temporary hack to set an attribute on the context
to skip this check to accomadate two L3 code-paths and a subnet
code-path that have port manipulations entangled in transactions.
This attribute will ultimately be removed once these paths are
refactored.
Closes-Bug: #1540844
Change-Id: I5aa099c2264636336ab0b76c0826b506e2dc44b6
The _ symbol should have been imported explicitly. Actually, there is no
use case for translatable messages in unit tests, it's just a waste of
translator time to mark it as such. The patch removes the translation
marker for good.
Change-Id: I76bef710a1030dcb4eb35778ebf44ed600016f17
Closes-Bug: #1611400
This patch will add devref for relocating db models and
it also explains why that change is required. It will also
add a directory named models under tree neutron/db/.
Change-Id: I160cecb76fb736307e5937122c84cdc0546207b6
Related-Bug: #1597913
This patch follows up on the Nova work that allows Neutron to pass an
OVS 'bridge_name' in a port's vif_details [1] and the os-vif work that
ensures the OVS bridge passed in as 'bridge_name' (or the config default
of 'br-int') is created [2].
If the port is a trunk's parent port, then bridge_name will be set to a
generated trunk bridge name for vlan-aware VMs. Otherwise, the
bridge_name field will remain empty.
Note: until Nova integrates os-vif [3] and uses a release that contains
the change in [2], the trunk bridge will not actually be created by
Nova/os-vif. It is expected to be integrated for the Newton release.
Until then, this Nova-equivalent patch can be used for testing
purposes [4].
[1] https://review.openstack.org/#/c/260700/
[2] https://review.openstack.org/#/c/330818/
[3] https://review.openstack.org/#/c/269672/
[4] https://review.openstack.org/#/c/332474/
Partially-implements: blueprint vlan-aware-vms
Change-Id: Iad72d163bc406df65866f6d962abcb78596828e7
Db retriable error by precommit can be recovered with upper layer by
retry instead of converting into ML2MechanismDriverError.
Raise retriable db error instead of swallowing it and let upper layer to
retry.
Due to concurrency, db error by precommit is sometimes inevitable.
precommit may issue db transactions depending on mechanism driver, Some
operations on e.g. subnet, routers, touches many other resources (e.g. ip
allocation, ports) in single db transaction as well. And background
operation by mechanism driver (e.g. background sync, monitoring
resources periodically, etc) may touch those db tables with other
order.
Change-Id: Ifc670c1eb5801934bf46fdc23a7721ce4c2cfa6c
Closes-Bug: #1609184
Closes-Bug: #1609149
If a CSNAT port update fails when a subnet is added,
it will leave the regular updated router port in the
changed state since it's a separate port update with
a separate transaction. So when the CSNAT update fails
we need explicitly undo the 1st update with another update.
Closes-Bug: #1609693
Change-Id: If979aebbebf6da77f3fcec0cc7ec8b27e388aba4
Many deprecations are triggered early (on imports, for example)
before the warnings are enabled by the WarningsFixture in the
base test class.
To make sure all DeprecationWarning messages are emitted we enable
them via the PYTHONWARNINGS environment variable.
Change-Id: I93d9447b5f26ba474d4c283a3df49cf4461c715d
NOTE: All subprojects should do this too.
If an HA router is deleted and it's the last one a tenant has, the HA
network is deleted as it's no longer needed. The same should occur when
migrating the last HA router of a tenant from HA to Legacy.
Closes-Bug: #1610645
Change-Id: Ib27224c028bef98b78a5cea91e62ea98a2847008
The _DeprecateSubset helper was developed during Mitaka, but it will
be used for many versions. The version information should not be
hard-coded. Instead we emit deprecation messages without any version
information.
Example warning before this patch:
DeprecationWarning: IPV6_MODES in version 'mitaka' and will be
removed in version 'newton': moved to neutron_lib.constants
After:
DeprecationWarning: IPV6_MODES: moved to neutron_lib.constants
Change-Id: Iaae5b58a406d4021ff22e8a28e30ae4f746ce211
This helps debug the causes of retriable exceptions.
The exception is only logged at debug level so it won't
look like a real error.
Change-Id: Ic58494992ead79f11a83b75c222b1d38047e1367
Router namespace absence may lead to infinite loop in l3 agent trying
to delete the router.
This patch adds checks before going into namespace to prevent RuntimeError
and following infinite loop.
Closes-Bug: #1606844
Change-Id: Iae95ccb8eeb06d0fd5fc7d71e63408b3f843b371
Interface should be correctly removed from ironic when port-delete.
Nova should receive notify when baremetal port deleted.
Change-Id: I3d53bff8278dabafd929ecbea0b4b3b441c9e1cf
Partial-Bug: #1606229
Patch [1] is incomplete for deleting conntrack entries with
remote_ip set. This patch fixes the defect.
[1]: I44d6bd0c2465294b557fd01566b72e016d34bba3
Change-Id: I31c579dbe28e4e8e824912b695eaba9475cf0095
Closes-Bug: #1570171
In routed provider networks, a network can be divided by segments and
each segment will have its own DHCP agent. AutoScheduling for networks
exists. This patchset is for enabling auto scheduling for routed
networks.
Change-Id: I7d9f01dbd6d9c216474ee47c968919c1826787f7
Partially-implements: blueprint routed-networks
assert_ping() was changed recently to be async-friendly, but
the change caused the drop of a single packet to throw an
error. Since occasionally the first packet is lost due to
address resolution (ARP) we can't use it for checking liveness
of an IP.
Restored assert_ping() and moved updated code to
assert_async_ping() since that is a special-case.
Change-Id: Ibe69417a0d819d4cd87e2f487c08fd126b1024e2
At present there is no clear way to distinguish when the snat_namespace
object is initialized and when the actual namespace is created.
There is no way to check if the namespace already existed. The
code was only checking at the snat_namespace object instead of its
existence.
This patch addresses the issue by adding in an exists method to the
namespace object to identify the existence of the namespace in the
given agent.
This would allow us to check for the existence of the namespace,
and also allow us to identify the stale snat namespace and
delete the namespace when the gateway is cleared as the agent restarts.
This also applies for conditions when the router is manually moved
from one agent to another agent while the agent is dead. When the
agent wakes up it would clean up the stale snat namespace.
Change-Id: Icb00297208813436c2a9e9a003275462293ad643
Closes-Bug: #1557909