The functional test for auto_schedule_networks passes even if the
method does nothing. This patch changes the test so it checks that
each expected hosted network is in hosted_net_ids.
This patch ensures log_opt_values is invoked only once, thus
avoiding annoying multiple dumps of options values.
Note that is rpc_workers is greater than 0 a second dump will
be logged. This patch does not address this as REST and RPC
servers are going to be separated as a part of the feature/pecan
work.
Pavel Bondar [Thu, 14 May 2015 11:06:08 +0000 (14:06 +0300)]
Add Pluggable IPAM Backend Part 2
Introduces new Pluggable IPAM backend.
IP/subnet allocation calls are sent to IPAM driver.
Calls to IPAM Driver are considered as call to third-party
environment, so if any action fails, rollback action is called.
Removes associate_neutron_subnet step from interface and reference
driver. It is not needed any more because foreign key relationship
between IPAM subnet and neutron subnet was removed.
So IPAM subnet can store id of neutron subnet,
which is not created yet.
For now only reference IPAM driver is available.
Temporarily disabled test_ipam_pluggable_backend from
gate-neutron-python34. Current patch adds executing
parts of test_db_base_plugin_v2, which is not py34 compatible yet.
Might be enabled back once 204791 is merged.
Fix handling of port-range-min 0 in secgroup RPC and agent
For TCP/UDP protocol, port valid range is 0 to 65535, so for a
security group rule, its valid range is also 0 to 65535. this
patch makes two changes:
1. if a security group rule port_range_min is 0, l2 agent also can
get port_range_min real value 0 when it gets this rule for a
device via RPC.
2. For IptablesFirewallDriver, if port range is [0, xxxx], l2 agent
also need add this rule to iptables.
This patch adds the address scope api tests and
also returns the address scope resource attr map
in the get_extended_resources() function which was
missed in the previous patch
Yalei Wang [Tue, 9 Jun 2015 05:46:57 +0000 (13:46 +0800)]
Add new ovs DB API to inquire interfaces name list in a bridge
In OVS, ports don't equal to interfaces when a bond port created. This patch
add the new API get_iface_name_list to get the interfaces' name, and it's
supplementary to the current get_port_name_list API.
There may be projects that have not being created yet, so revise
the wording a bit to provide clarity that new projects can also
submit for inclusion right off the bat.
sridhargaddam [Fri, 19 Jun 2015 16:17:01 +0000 (16:17 +0000)]
Fix race condition by using lock on enable_radvd
For an HA Router, radvd is spawned only in the Master Node.
KeepalivedStateChangeHandler after receiving the state notification
on the unix domain socket, would either enable/disable the radvd
process depending on the state of the HA Router. In parallel, if
there is a request to add an interface to the router, router.process()
would try to enable radvd in parallel. So there is a possible race
condition as two threads try to enable radvd in parallel. This patch
uses appropriate locking mechanism to prevent this race condition.
There is nothing Linux or agent specific in the function. I need to use
it outside agent code in one of depending patches, hence moving it into
better location while leaving the previous symbol in place, with
deprecation warning, for backwards compatibility.
Henry Gessau [Thu, 25 Jun 2015 17:58:30 +0000 (13:58 -0400)]
Remove deprecated OVS and LB plugin DB tables
Now that the openvswitch and linuxbridge monolithic plugins have been
deprecated and replaced by ML2 mechanism drivers, we can remove their
database tables.
Also remove the migrate_to_ml2.py script which is no longer supported.
Louis Taylor [Mon, 20 Jul 2015 17:20:29 +0000 (17:20 +0000)]
Port help text for dvr_base_mac from neutron.conf
The help text for the option in the current static configuration file
contained additional information which would be lost when we switch to
generating the file. This patch copies it over to the oslo.config help
parameter.
Adds garp_master_repeat and garp_master_refresh to keepalived.conf
This patch aims to solve an issue when, in some cases, the L3 agent might
start before the OVS agent during a node boot process.
At such scenario, the L3 agent will configure the routers before the OVS agent
done syncing with the server and starts processing ovsdb monitor updates.
The result:
1. L3 agent finishes configuring an HA router
2. Keepalived spawned
3. In case of transition to master state, it (keepalived) sends gratuitous ARPs
^---The issue
4. The OVS agent has just finished plugging its ports
Meaning, the gratuitous ARP will be lost, but the router acting as master.
Closes-Bug: #1453855
Following test cases are added:
Common scenarios:
1. No routers scheduled if no agents are present
2. No routers scheduled if it is already hosted
3. No routers scheduled if all agents are down
4. Router scheduled to the agent if router is not yet hosted
5. Router scheduled to the agent even if it already hosts a router
Following scenario specific to least routers scheduler is added:
1. Router is scheduled to agent hosting least routers
For each of Chance and Least Router schedulers auto scheduling is also verified.
Cedric Brandily [Fri, 8 May 2015 21:28:37 +0000 (23:28 +0200)]
Always use BridgeDevice to manage linuxbridges
BridgeDevice[1] class provides methods to manage linuxbridges through
brctl. This change adds some methods to BridgeDevice in order to
always use BridgeDevice to manage linuxbridges and respect DRY
principle.
neutron-db-manage: fix check_migration for branch-less migration directories
I3823900bc5aaf7757c37edb804027cf4d9c757ab introduced support for
multi-branch migration directories in neutron-db-manage. That broke
check_migration for those projects without multiple branches.
The tool should properly handle both types of directories for forseable
future.
Carl Baldwin [Tue, 14 Jul 2015 19:00:45 +0000 (19:00 +0000)]
Use only the lower 16 bits of iptables mark for marking
Since a packet can only have one mark, and we will need to mark a
packet for multiple purposes, we need to use a coordinated bitmask for
the two cases of simple marking that we currently do in Neutron
leaving the other bits for address scopes.
Mike Bayer [Fri, 17 Jul 2015 17:19:57 +0000 (13:19 -0400)]
Add address_scope_db to neutron/models/head.py
The head.py file ensures that all relevant models are
imported when ModelsMigrationSync tests are run in
neutron/tests/functional/db/test_migrations. This is
one of the models that needs to be present else the
"address_scopes" table comes out as missing. The
error is usually concealed by the fact that the module
was imported as a side effect of other tests but
is revealed if one runs test_migrations.py alone.
In Python 3:
>>> None > 0
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
TypeError: unorderable types: NoneType() > int()
This commit does not change the behaviour of the affected code, but fixes the
TypeError that is raised in Python 3.
Some tests have been added to the py34 section of tox.ini, but are currently
commented out: these are tests that work with this patch and a fixed version of
Routes.
shihanzhang [Tue, 30 Jun 2015 02:14:19 +0000 (10:14 +0800)]
Unplug the VIF if dhcp port is deleted
if user delete the dhcp port, dhcp-agent should unplug
the VIF for this dhcp port, then the driver do
'reload_allocations' will raise a exception, dhcp-agent
resync for this network and re-create dhcp port.