Allow multiple in-network services in chain to be on 1 vRouter

Problem:

If 2 in-network service instances that are part of the same chain get
instantiated on the same compute node, service chaining does not work
correctly.  ServiceChain routes for only one of the service instances
get adverrtised as L3VPN routes.  This is the case for both the left
and right routing instances of each service instance.

Cause:

The root cause is a design issue in the service chaining code in the
case of multiple in-network services. The RD for ServiceChain routes
gets generated based on IP Fabric address of the agent advertising
the connected route and the VRF id of the agent in default RI for the
left and right VNs of the servcie chain. Since the VRF id used is from
the default RI and not the service RI, the RD for ServiceChain routes
from both instances is the same.  Hence we end up with 2 paths for the
same L3VPN routes instead of 2 different L3VPN routes.  Consequently,
only one of the patsh gets advertised to other peers via BGP.

Fix:

Fix is to generate the RD for ServiceChain routes based on VRF id of
the agent for the service routing instance into which the ServiceChain
route gets added.  Also take care of race conditions where the CN may
have received the connected route from agent, but the agent has not
yet subscribed to the service chain routing instance. This is done by
updating all ServiceChain routes for a service routing instance when
an agent subscribes or ubsubscribes to it.

Pending:

If a connected route is originated from XMPP, CN needs to only use the
XMPP route to generate a path for the ServiceChain route.  Information
from BGP routes advertised by other CNs as a result of exporting the
XMPP route should not be used to generate path for ServiceChain route.
This will be addressed via a separate commit.

Change-Id: I214ace1966f9bb4ca16c1fe80799a4c0d15926de
Partial-Bug: 1374114
Merge vmware-dev branch.

Merged following commits
1 : 48d5fec322cd3feb71403d9c391211a1c65ae284,
    Support for src-mac based vm-port assignment
2 : 1dabbc0e7bf031de50b1d988f3ebbc4ba9624d94 and
    Fix merge issues
3 : c02c0c72dde35b51fba5a88f440af4b71e2a4d6e
    Additional changes to Agent for Contrail to work with VMWare vCenter.

Change-Id: I41058106869c4e552ccb5ef1ec0591a40bb08c79
Fix concurrency issue in updating DBEntry flags

Fixes bug: #1375226

Cause:
DBEntry flag is updated from two mutually non-exclusive task. This results in corrupting the flags and unexpected free/delete on entry.
The problem is caused while setting "OnRemoveQ" flag on DBEntry as it can be done from any task context.

Fix:
Move OnRemoveQ out of DBEntry flags and make it as atomic bool variable.
Add assert to catch the case where route gets deleted with active paths
Add assert to catch the case where path is inserted to a deleted route
Added new test for repeated route update(from a agent with different nexthop) which discovered this bug.

Change-Id: I5df04f89f00959799a921e9db37388c0eb56334e
Merge "Allow multiple in-network services in chain to be on 1 vRouter"
Merge "Fix concurrency issue in updating DBEntry flags"
Improvement to introspect for StaticRoutes

Include information about paths for the nexthop route.

Change-Id: I730ccb446bdf4d9a29539bceb7761d04e31d6c59
Add support for ibgp-auto-mesh in schema transformer

Change-Id: Ic27d3f14c4a0666c893afa9801975c2daeed8ca1
Closes-Bug: 1379558
Changes to trigger flow re-compute on route Add/Delete

Maintain references to the routes which were ignored due to more specific
route in flow processing, which will be used to trigger flow re-compute
when route is deleted or an new more specific route is avialable.

Update test-cases to accomodate changes.
Added test-case for route add.

Change-Id: I6d263f86018b1e8e5ebb93dffee424c7e9cddcad
HA flag incorrectly set for instance-ip in LBAAS

Instance-ip should be set with active-standby flag. But because of a
change in neutron plugin to set the max-instances to 2 ha-flag was
overwritten to active-active. Removed the code dependency for ha-flag
on max-instances if ha-mode is specified.

Change-Id: I7a0970a6559a062cd13651416658c982bf7554b7
Closes-Bug: #1380763
Implement introspect for show route summary

This is useful for debugging when there's a relatively large number
of routes spread over many tables. The normal show route introspect
output has too much information, making it dofficult to find table
of interest.

Further, after bug 1325652 gets fixed, normal show route introspect
won't show all tables anymore.

Change-Id: Ifc987e23094035d27b7ce79071d2c5ada52828b0
Related-Bug: 1325652
Merge "Add support for ibgp-auto-mesh in schema transformer"
Make ibgp_auto_mesh True by default in schema transformer

Change-Id: I9fef1e9137e4c0a3d07aa76f93890648cf7cc381
Closes-Bug: 1379558
Merge "HA flag incorrectly set for instance-ip in LBAAS"
Merge "Implement introspect for show route summary"
Making contrail config services read multiple config files if provided.

contrail config services such as contrail-api, contrail-schema, contrail-svc-monitor reads
authentication details from one config file. We currently populate the authentication
section [keystone] in their irespective config file say contrail-api.conf, schema_transformer.conf etc.

Modified them to take multiple --conf_file option and read all of them, This way we can skip
auth config in the config services in case of deployment scenarios where openstack is not the orchestrator.

Change-Id: Ib26841e32320cfff1df98723d186700f88b4f1f0
Partial-Bug: 1378497
Added various properties to physical router and logical interface

Change-Id: I1a8465d86a38c6086cdb281161db10e9c9254760
Closes-Bug: 1380481
Merge "Added various properties to physical router and logical interface"
Add command line arguments to provision.py and provision_control.py to set or not set ibgp-auto-mesh.
If the argument is not specified, the value is not changed.

Change-Id: Ifdb073040f2b9f67dfed7130ffabc1f54c78808a
Closes-Bug: 1379558
Merge "Changes to trigger flow re-compute on route Add/Delete"