initial Neutron OVS support scenarios

Change-Id: Ibac27dd6d1840f31ecb54c6b5e2b74b16f2c3b06
diff --git a/neutron/files/mitaka/neutron-server.conf.Debian b/neutron/files/mitaka/neutron-server.conf.Debian
index 78406d4..b587cba 100644
--- a/neutron/files/mitaka/neutron-server.conf.Debian
+++ b/neutron/files/mitaka/neutron-server.conf.Debian
@@ -25,21 +25,30 @@
 # extensions:/path/to/more/exts:/even/more/exts. The __path__ of
 # neutron.extensions is appended to this, so if your extensions are in there
 # you don't need to specify them here. (string value)
+
+{% if server.backend.engine == "contrail" %}
+
 # TEMPORARY - until neutron v2 contrail package would be supported
 #api_extensions_path = extensions:/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/extensions:/usr/lib/python2.7/dist-packages/neutron_lbaas/extensions
 api_extensions_path = extensions:/usr/lib/python2.7/dist-packages/neutron_plugin_contrail/extensions
+# The core plugin Neutron will use (string value)
+core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2
+
+# TEMPORARY - until neutron v2 contrail package would be supported
+#service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.v2.plugin.LoadBalancerPluginV2
+{% elif server.backend.engine == "ml2" %}
+
+core_plugin = neutron.plugins.ml2.plugin.Ml2Plugin
+
+service_plugins =neutron.services.l3_router.l3_router_plugin.L3RouterPlugin,neutron.services.metering.metering_plugin.MeteringPlugin
+
+{% endif %}
 
 # The type of authentication to use (string value)
 #auth_strategy = keystone
 auth_strategy = keystone
 
-# The core plugin Neutron will use (string value)
-core_plugin = neutron_plugin_contrail.plugins.opencontrail.contrail_plugin.NeutronPluginContrailCoreV2
-
-
 # The service plugins Neutron will use (list value)
-# TEMPORARY - until neutron v2 contrail package would be supported
-#service_plugins = neutron_plugin_contrail.plugins.opencontrail.loadbalancer.v2.plugin.LoadBalancerPluginV2
 # The base MAC address Neutron will use for VIFs. The first 3 octets will
 # remain unchanged. If the 4th octet is not 00, it will also be used. The
 # others will be randomly generated. (string value)
@@ -47,6 +56,7 @@
 
 # How many times Neutron will retry MAC generation (integer value)
 #mac_generation_retries = 16
+mac_generation_retries = 32
 
 # Allow the usage of the bulk API (boolean value)
 #allow_bulk = true
@@ -113,6 +123,7 @@
 # lease times. (integer value)
 # Deprecated group/name - [DEFAULT]/dhcp_lease_time
 #dhcp_lease_duration = 86400
+dhcp_lease_duration = 600
 
 # Domain to use for building the hostnames (string value)
 #dns_domain = openstacklocal
@@ -159,6 +170,7 @@
 # If True, advertise network MTU values if core plugin calculates them. MTU is
 # advertised to running instances via DHCP and RA MTU options. (boolean value)
 #advertise_mtu = true
+advertise_mtu = True
 
 # Neutron IPAM (IP address management) driver to use. If ipam_driver is not set
 # (default behavior), no IPAM driver is used. In order to use the reference
@@ -181,6 +193,7 @@
 # value. Defaults to 1500, the standard value for Ethernet. (integer value)
 # Deprecated group/name - [ml2]/segment_mtu
 #global_physnet_mtu = 1500
+global_physnet_mtu = {{ server.get('global_physnet_mtu', '1500') }}
 
 # Number of backlog requests to configure the socket with (integer value)
 #backlog = 4096
@@ -243,6 +256,7 @@
 # Seconds to regard the agent is down; should be at least twice
 # report_interval, to be sure the agent is down for good. (integer value)
 #agent_down_time = 75
+agent_down_time = 30
 
 # Representing the resource type whose load is being reported by the agent.
 # This can be "networks", "subnets" or "ports". When specified (Default is
@@ -283,6 +297,7 @@
 # a given tenant network, providing high availability for DHCP service.
 # (integer value)
 #dhcp_agents_per_network = 1
+dhcp_agents_per_network = 2
 
 # Enable services on an agent with admin_state_up False. If this option is
 # False, when admin_state_up of an agent is turned False, services on it will
@@ -302,9 +317,11 @@
 # System-wide flag to determine the type of router that tenants can create.
 # Only admin can override. (boolean value)
 #router_distributed = false
+router_distributed = {{ server.get('dvr', 'False') }}
 
 # Driver to use for scheduling router to a default L3 agent (string value)
 #router_scheduler_driver = neutron.scheduler.l3_agent_scheduler.LeastRoutersScheduler
+router_scheduler_driver = neutron.scheduler.l3_agent_scheduler.ChanceScheduler
 
 # Allow auto scheduling of routers to L3 agent. (boolean value)
 #router_auto_schedule = true
@@ -315,6 +332,7 @@
 
 # Enable HA mode for virtual routers. (boolean value)
 #l3_ha = false
+l3_ha = {{ server.get('l3_ha', 'False') }}
 
 # Maximum number of L3 agents which a HA router will be scheduled on. If it is
 # set to 0 then the router will be scheduled on every agent. (integer value)
@@ -568,6 +586,7 @@
 # wait forever. (integer value)
 #client_socket_timeout = 900
 
+nova_url = http://{{ server.compute.host }}:8774/v2
 
 [agent]
 
@@ -593,6 +612,7 @@
 # agent_down_time, best if it is half or less than agent_down_time. (floating
 # point value)
 #report_interval = 30
+report_interval = 10
 
 # Log agent heartbeats (boolean value)
 #log_agent_heartbeats = false
@@ -702,8 +722,11 @@
 # Deprecated group/name - [DEFAULT]/sql_connection
 # Deprecated group/name - [DATABASE]/sql_connection
 # Deprecated group/name - [sql]/connection
+{% if server.backend.engine == "ml2" %}
+connection = {{ server.database.engine }}+pymysql://{{ server.database.user }}:{{ server.database.password }}@{{ server.database.host }}/{{ server.database.name }}
+{% else %}
 connection = sqlite:////var/lib/neutron/neutron.sqlite
-
+{% endif %}
 # The SQLAlchemy connection string to use to connect to the slave database.
 # (string value)
 #slave_connection = <None>
@@ -719,6 +742,7 @@
 # Deprecated group/name - [DATABASE]/sql_idle_timeout
 # Deprecated group/name - [sql]/idle_timeout
 #idle_timeout = 3600
+idle_timeout = 3600
 
 # Minimum number of SQL connections to keep open in a pool. (integer value)
 # Deprecated group/name - [DEFAULT]/sql_min_pool_size
@@ -729,22 +753,26 @@
 # Deprecated group/name - [DEFAULT]/sql_max_pool_size
 # Deprecated group/name - [DATABASE]/sql_max_pool_size
 #max_pool_size = <None>
+max_pool_size = 20
 
 # Maximum number of database connection retries during startup. Set to -1 to
 # specify an infinite retry count. (integer value)
 # Deprecated group/name - [DEFAULT]/sql_max_retries
 # Deprecated group/name - [DATABASE]/sql_max_retries
 #max_retries = 10
+max_retries = -1
 
 # Interval between retries of opening a SQL connection. (integer value)
 # Deprecated group/name - [DEFAULT]/sql_retry_interval
 # Deprecated group/name - [DATABASE]/reconnect_interval
 #retry_interval = 10
+retry_interval = 2
 
 # If set, use this value for max_overflow with SQLAlchemy. (integer value)
 # Deprecated group/name - [DEFAULT]/sql_max_overflow
 # Deprecated group/name - [DATABASE]/sqlalchemy_max_overflow
 #max_overflow = 50
+max_overflow = 20
 
 # Verbosity of SQL debugging information: 0=None, 100=Everything. (integer
 # value)
@@ -780,16 +808,18 @@
 
 
 [keystone_authtoken]
+{% if server.backend.engine == "contrail" %}
+admin_token = {{ server.backend.token }}
+admin_user={{ server.backend.user }}
+admin_password={{ server.backend.password }}
+admin_tenant_name={{ server.backend.tenant }}
+{%- endif %}
 auth_region={{ server.identity.region }}
 auth_protocol=http
 revocation_cache_time = 10
 auth_type = password
 auth_host = {{ server.identity.host }}
 auth_port = 35357
-admin_token = {{ server.backend.token }}
-admin_user={{ server.backend.user }}
-admin_password={{ server.backend.password }}
-admin_tenant_name={{ server.backend.tenant }}
 user_domain_id = {{ server.identity.get('domain', 'default') }}
 project_domain_id = {{ server.identity.get('domain', 'default') }}
 project_name = {{ server.identity.tenant }}
@@ -1368,10 +1398,12 @@
 # heartbeat's keep-alive fails (0 disable the heartbeat). EXPERIMENTAL (integer
 # value)
 #heartbeat_timeout_threshold = 60
+heartbeat_timeout_threshold = 0
 
 # How often times during the heartbeat_timeout_threshold we check the
 # heartbeat. (integer value)
 #heartbeat_rate = 2
+heartbeat_rate = 2
 
 # Deprecated, use rpc_backend=kombu+memory or rpc_backend=fake (boolean value)
 # Deprecated group/name - [DEFAULT]/fake_rabbit
@@ -1529,7 +1561,9 @@
 
 # Default driver to use for quota checks (string value)
 #quota_driver = neutron.db.quota.driver.DbQuotaDriver
+{% if server.backend.engine == "contrail" %}
 quota_driver = neutron_plugin_contrail.plugins.opencontrail.quota.driver.QuotaDriver
+{% endif %}
 
 # Keep in track in the database of current resourcequota usage. Plugins which
 # do not leverage the neutron database should set this flag to False (boolean
@@ -1584,8 +1618,7 @@
 # cipher list format. (string value)
 #ciphers = <None>
 [service_providers]
-service_provider = LOADBALANCER:Opencontrail:neutron_plugin_contrail.plugins.opencontrail.loadbalancer.driver.OpencontrailLoadbalancerDriver:default
-
 {% if server.backend.engine == "contrail" %}
+service_provider = LOADBALANCER:Opencontrail:neutron_plugin_contrail.plugins.opencontrail.loadbalancer.driver.OpencontrailLoadbalancerDriver:default
 {% include "neutron/files/"+server.version+"/ContrailPlugin.ini" %}
 {% endif %}