Use call to report state when ovs_agent starts up

Make sure to report ovs_agent state when starting up, otherwise
ovs_agent start_time would not be updated and thus l2pop does
not send fdb entries.

Change-Id: Idd770a85a9eabff112d9613e75d8bb524020234a
Closes-Bug: #1347452
Update DVR Binding when router_id changes

In this patch I modified update_dvr_port_binding to update the
binding if router_id changes.
When a new router namespace is created on a host, sync_router
will call _ensure_host_set_on_port that will update the DVR binding.
With the current code update_dvr_port_binding won't update the
binding if there's an existing binding unless the binding
vif_type is VIF_TYPE_BINDING_FAILED . There's a race when
the router namespace is destroyed and then recreated on the same
host.
The DVR binding is deleted only when the message
update_device_down is processed. If this message is processed
after the update_dvr_port_binding triggered by the namespace creation,
update_dvr_port_binding won't update the binding. When the router
interface will be detected as UP, no DVR binding will be found.

Closes-bug: #1358554
Change-Id: I37fd4ed67dc2019b57e36d082b584c517d8f67a8
Big Switch: Check for 'id' in port before lookup

Check for the presence of the 'id' key before trying
to do a lookup based on the value. This is necessary
because a 'fields' param to get_port(s) may exclude
the 'id' field before the host_id lookup.

Closes-Bug: #1358668
Change-Id: If30567d5deaeabd2de6c6287fac7a81695a41cc5
Add unit tests covering single operations to ODL

This commit adds the remaining test cases (create and update
operations) to fully cover sync_single_resource. It also defines the
filter_* methods as static or class methods and removes their duplicate
arguments.

Change-Id: I6b6153ea577bd685576690559b1c389490ee525d
Closes-Bug: #1325184
Fixes Hyper-V agent issue on Hyper-V 2008 R2

The vmutils.HyperVUtils class used on versions of Hyper-V prior of 2012
is missing the "remove_all_security_rules" method.

Change-Id: Ib14e643c400b230c912589f9480acf59d6e7b147
Closes-Bug: #1360817
Remove status initialization from plugin's create_firewall

This is overwritten by the DB class method, so here is
not necessary.

Change-Id: I7bda448dab81992c8fb6ef8d771138ff070360ba
Make log level in linux.utils.execute configurable

Function linux.utils.execute always logs failures on error level.
Some callers use this function to check resource existance and
interpret failure as normal flow. Log level is made configurable
for such cases.

Change-Id: I8e4cd7b42234426f8fe58d353a64e898f02f8998
Closes-bug: 1339045
Fixed template of IPsecSiteConnectionNotFound message

Closes bug 1361044

Change-Id: I667f066e6187e953d467428e9990fa76adfc365b
Cisco VPN with in-band CSR (interim solution)

Currently, the Cisco VPN drivers use two routers for the proof of concept
solution. A Neutron router provides access to the public and private
subnets, and a Cisco CSR (out-of-band) provides the VPN tunneling.

The end goal is to integrate the Cisco VPN drivers with the Cisco L3
routing plugin being developed (as a separate blueprint), allowing an
in-band CSR to be used as a Neutron router for VPN functionality.

This commit provides an incremental approach to that goal, by modifying
the Cisco VPN drivers to be able to dynamically obtain CSR info from
an INI file, instead of statically reading the INI file at start-up.

A CSR VM can be created out-of-band (or in-band using Nova) and the INI
file can be updated with the router info. Then, the Cisco VPN driver
can use that information (dynamically) to create IPSec connections.

Once the Cisco L3 router plugin is available, the INI file will be
removed, and two calls to the plugin will be used to obtain the needed
router information, for an integrated solution.

The main advantages are:
    - Dynamically use the CSR for VPN.
    - Less manual intervention and setup.
    - Easy migration to final solution.
    - No dependency on the Cisco L3 router plugin implementation.

Note 1: The INI unit tests are moved from device driver to service
        driver and modified.

Note 2: I added a unit test for deleting IPSec site-to-site connection,
        which was missing (pass).

Note 3: For more details on the change, you can view this Google Doc:
        http://goo.gl/DXir8c

Change-Id: I307fc79952e3e12a0f77679ac1fc2b314fa63684
Partially-Implements: blueprint cisco-vpnaas-with-cisco-csr-router
Remove binding:profile update from Mellanox ML2 MD

Remove temporary work-around that populates physical_network in
binding:profile. Now when both neutron and nova use binding:vif_details
to pass attributes to plug neutron port, this work-around is not nequired.
Remove related temporary code from ML2 plugin.

Change-Id: Ib37203af396f31080b1b27b500a571c20917f5a4
Closes-Bug: 1360762
Layer 3 service plugin to support hardware based routing

Change-Id: Ie8e97a6d4fde0bda7cf049696e1384586492f676
Implements: blueprint brocade-l3-svi-service-plugin
Subnets with prefix length 0 are invalid

This patch changes the API behaviour to return a 400 error
when a subnet with /0 prefix length is specified.

This kind of subnet hardly make any sense, and also cannot
possibly work when DHCP is enabled.

Change-Id: I8f822f14b91475dcf86ea44ee607013e61cbb6f7
Closes-Bug: #1362651
Add endpoint_type parameter to MetaInterfaceDriver

Previously MetaInterfaceDriver communicates with neutron-server
via 'publicURL' because it uses python-neutronclient without
endpoint_type and 'publicURL' is the default.
It causes error when a user intends to use internal or admin URL
for communication between MetaInterfaceDriver and neutron-server.

Change-Id: Id321d5a16a08a4bda618f98bb1eb7cb1b0b9eb08
Closes-bug: #1354285
Don't spawn metadata-proxy for non-isolated nets

If the configuation option "enable_isolated_metadata = True" for the
DHCP agent is set, the neutron-ns-metadata-proxy process is spawned
for all networks, regardless if they are isolated or not. In case
the network is not isolated (ie. connected to a neutron router), the
L3 agent also spawns a proxy process, and the DHCP's proxy is left
unused. This patch adds a check prior to the spawning of new proxies:
if a network is not isolated, no proxy is spawned.

Change-Id: I9bdb8c3d37997b22435bca33ec47a67db08efa51
Closes-bug: #1361545
Fix a bug in Mellanox plugin RPC caused by secgroup RPC refactoring

SecurityGroupsRpcCallback RPC refactoring patch (commit 2781fce238)
moves get_port_from_device method from plugin RPC callback class to
plugin layer, but Mellanox plugin RPC callback was forgot to update
and as a result RPC calls from agents to Mellanox plugin fails.

Change-Id: I1aa82ac00c16a53a59a93087f0ca4ef281ee3f2b
Related-Bug: #1359416
Clarify message when no probes are cleared

Log number of probes which were deleted by
using neutron-debug probe-clear
Closes-Bug: #1333103

Change-Id: I5b53f0c4651c6df491d414d7d65f98c4a84a5987
Big Switch: Bind IVS ports in ML2 driver

Add support to bind IVS ports in the Big Switch ML2
mechanism driver. The backend controller will be checked
to determine if a host is connected using the Indigo vswitch.
If so, the mechanism driver will mark it as bound since
it will be provisioned by the backend controller.

Implements: blueprint bsn-ml2-bind-ivs
Change-Id: Ic481fc31c8c123899fddf8185c32f127dff53b7a
Big Switch: Separate L3 functions into L3 service

Separate the L3 functions from the core Big Switch
plugin into an L3 service plugin. This is will allow
the L3 functions to be used in ML2 deployments that
use the Big Switch ML2 driver.

DocImpact

Implements: blueprint bsn-l3-service-plugin
Change-Id: I889db0047fb9a85f02d1fb95b9c099e9243a5bb5
Skip functional l3 agent test

Since this test merged there have been periodic failures that
seem to be related to SystemExit being raised.  Skipping for now
to give us time to fix.

Change-Id: Ia857835102a9c4c74820cf5eb3c529a3c2fb421e
Related-bug: 1364171
Implements ProcessMonitor to watch over external processes

This class takes care of all the spawned external processes,
taking the administrator configured action in the case of any
of the external processes die unexpectedly.

Implements: blueprint agent-child-processes-status

Change-Id: I6bc7a415dde5723dac07589859796c2ffeef5b54