Merge "Change openstack metrics label"
diff --git a/README.rst b/README.rst
index 2812d40..281b710 100644
--- a/README.rst
+++ b/README.rst
@@ -30,6 +30,9 @@
         dhcp_lease_duration: 600
         firewall_driver: iptables_hybrid
         agent_boot_time: 180
+        agent_down_time: 30
+        dhcp_agents_per_network: 2
+        allow_automatic_dhcp_failover: true
         bind:
           address: 172.20.0.1
           port: 9696
@@ -55,6 +58,9 @@
           user: openstack
           password: pwd
           virtual_host: '/openstack'
+          rpc_conn_pool_size: 30
+          rpc_thread_pool_size: 100
+          rpc_response_timeout: 120
         metadata:
           host: 127.0.0.1
           port: 8775
@@ -210,6 +216,7 @@
       gateway:
         enabled: True
         version: mitaka
+        report_interval: 10
         dhcp_lease_duration: 600
         firewall_driver: iptables_hybrid
         message_queue:
@@ -219,6 +226,9 @@
           user: openstack
           password: pwd
           virtual_host: '/openstack'
+          rpc_conn_pool_size: 300
+          rpc_thread_pool_size: 2048
+          rpc_response_timeout: 3600
         local_ip: 192.168.20.20 # br-mesh ip address
         dvr: True # disabled for non DVR use case
         agent_mode: dvr_snat
@@ -250,9 +260,13 @@
           user: openstack
           password: pwd
           virtual_host: '/openstack'
+          rpc_conn_pool_size: 300
+          rpc_thread_pool_size: 2048
+          rpc_response_timeout: 3600
         local_ip: 192.168.20.20 # br-mesh ip address
         dvr: True # disabled for non DVR use case
         agent_mode: dvr
+        report_interval: 10
         external_access: false # Compute node with DVR for east-west only, Network Node has True as default
         metadata:
           host: 127.0.0.1
diff --git a/neutron/files/ocata/neutron-generic.conf b/neutron/files/ocata/neutron-generic.conf
index 8b0492b..f1c7bd0 100644
--- a/neutron/files/ocata/neutron-generic.conf
+++ b/neutron/files/ocata/neutron-generic.conf
@@ -421,6 +421,9 @@
 # Size of RPC connection pool. (integer value)
 # Deprecated group/name - [DEFAULT]/rpc_conn_pool_size
 #rpc_conn_pool_size = 30
+{%- if neutron.message_queue.rpc_conn_pool_size is defined %}
+rpc_conn_pool_size = {{ neutron.message_queue.rpc_conn_pool_size }}
+{%- endif %}
 
 # The pool size limit for connections expiration policy (integer value)
 #conn_pool_min_size = 2
@@ -554,6 +557,9 @@
 
 # Maximum number of (green) threads to work concurrently. (integer value)
 #rpc_thread_pool_size = 100
+{%- if neutron.message_queue.rpc_thread_pool_size is defined %}
+rpc_thread_pool_size = {{ neutron.message_queue.rpc_thread_pool_size }}
+{%- endif %}
 
 # Expiration timeout in seconds of a sent/received message after which it is
 # not tracked anymore by a client/server. (integer value)
@@ -582,7 +588,6 @@
 # priority then the default publishers list taken from the matchmaker. (list
 # value)
 #subscribe_on =
-agent_down_time = 30
 
 # Size of executor thread pool. (integer value)
 # Deprecated group/name - [DEFAULT]/rpc_thread_pool_size
@@ -591,7 +596,7 @@
 
 # Seconds to wait for a response from a call. (integer value)
 #rpc_response_timeout = 60
-rpc_response_timeout=120
+rpc_response_timeout = {{ neutron.message_queue.get('rpc_response_timeout', 120) }}
 
 # A URL representing the messaging driver to use and its full configuration.
 # (string value)
@@ -680,7 +685,7 @@
 # agent_down_time, best if it is half or less than agent_down_time. (floating
 # point value)
 #report_interval = 30
-report_interval = 10
+report_interval = {{ neutron.get('report_interval', 10) }}
 
 # Log agent heartbeats (boolean value)
 #log_agent_heartbeats = false
diff --git a/neutron/files/ocata/neutron-server.conf b/neutron/files/ocata/neutron-server.conf
index e63053e..1d8f095 100644
--- a/neutron/files/ocata/neutron-server.conf
+++ b/neutron/files/ocata/neutron-server.conf
@@ -26,7 +26,7 @@
 # neutron.extensions is appended to this, so if your extensions are in there
 # you don't need to specify them here. (string value)
 #api_extensions_path =
-agent_down_time = 30
+agent_down_time = {{ server.get('agent_down_time', 30) }}
 
 # The type of authentication to use (string value)
 #auth_strategy = keystone
@@ -276,13 +276,16 @@
 
 # Automatically remove networks from offline DHCP agents. (boolean value)
 #allow_automatic_dhcp_failover = true
+{%- if server.allow_automatic_dhcp_failover is defined %}
+allow_automatic_dhcp_failover = {{ server.get('allow_automatic_dhcp_failover', True)|lower }}
+{%- endif %}
 
 # Number of DHCP agents scheduled to host a tenant network. If this number is
 # greater than 1, the scheduler automatically assigns multiple DHCP agents for
 # a given tenant network, providing high availability for DHCP service.
 # (integer value)
 #dhcp_agents_per_network = 1
-dhcp_agents_per_network = 2
+dhcp_agents_per_network = {{ server.get('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
@@ -465,6 +468,9 @@
 # Size of RPC connection pool. (integer value)
 # Deprecated group/name - [DEFAULT]/rpc_conn_pool_size
 #rpc_conn_pool_size = 30
+{%- if server.message_queue.rpc_conn_pool_size is defined %}
+rpc_conn_pool_size = {{ server.message_queue.rpc_conn_pool_size }}
+{%- endif %}
 
 # The pool size limit for connections expiration policy (integer value)
 #conn_pool_min_size = 2
@@ -598,6 +604,9 @@
 
 # Maximum number of (green) threads to work concurrently. (integer value)
 #rpc_thread_pool_size = 100
+{%- if server.message_queue.rpc_thread_pool_size is defined %}
+rpc_thread_pool_size = {{ server.message_queue.rpc_thread_pool_size }}
+{%- endif %}
 
 # Expiration timeout in seconds of a sent/received message after which it is
 # not tracked anymore by a client/server. (integer value)
@@ -634,7 +643,7 @@
 
 # Seconds to wait for a response from a call. (integer value)
 #rpc_response_timeout = 60
-rpc_response_timeout=120
+rpc_response_timeout = {{ server.message_queue.get('rpc_response_timeout', 120) }}
 
 # A URL representing the messaging driver to use and its full configuration.
 # (string value)
@@ -724,7 +733,7 @@
 # agent_down_time, best if it is half or less than agent_down_time. (floating
 # point value)
 #report_interval = 30
-report_interval = 10
+report_interval = {{ server.get('report_interval', 10) }}
 
 # Log agent heartbeats (boolean value)
 #log_agent_heartbeats = false
diff --git a/neutron/files/pike/neutron-generic.conf b/neutron/files/pike/neutron-generic.conf
index 03954cc..7a3f9a8 100644
--- a/neutron/files/pike/neutron-generic.conf
+++ b/neutron/files/pike/neutron-generic.conf
@@ -433,6 +433,9 @@
 # Size of RPC connection pool. (integer value)
 # Deprecated group/name - [DEFAULT]/rpc_conn_pool_size
 #rpc_conn_pool_size = 30
+{%- if neutron.message_queue.rpc_conn_pool_size is defined %}
+rpc_conn_pool_size = {{ neutron.message_queue.rpc_conn_pool_size }}
+{%- endif %}
 
 # The pool size limit for connections expiration policy (integer value)
 #conn_pool_min_size = 2
@@ -566,6 +569,9 @@
 
 # Maximum number of (green) threads to work concurrently. (integer value)
 #rpc_thread_pool_size = 100
+{%- if neutron.message_queue.rpc_thread_pool_size is defined %}
+rpc_thread_pool_size = {{ neutron.message_queue.rpc_thread_pool_size }}
+{%- endif %}
 
 # Expiration timeout in seconds of a sent/received message after which it is
 # not tracked anymore by a client/server. (integer value)
@@ -594,7 +600,6 @@
 # priority then the default publishers list taken from the matchmaker. (list
 # value)
 #subscribe_on =
-agent_down_time = 30
 
 # Size of executor thread pool. (integer value)
 # Deprecated group/name - [DEFAULT]/rpc_thread_pool_size
@@ -603,7 +608,7 @@
 
 # Seconds to wait for a response from a call. (integer value)
 #rpc_response_timeout = 60
-rpc_response_timeout=120
+rpc_response_timeout = {{ neutron.message_queue.get('rpc_response_timeout', 120) }}
 
 # A URL representing the messaging driver to use and its full configuration.
 # (string value)
@@ -696,7 +701,7 @@
 # agent_down_time, best if it is half or less than agent_down_time. (floating
 # point value)
 #report_interval = 30
-report_interval = 10
+report_interval = {{ neutron.get('report_interval', 10) }}
 
 # Log agent heartbeats (boolean value)
 #log_agent_heartbeats = false
diff --git a/neutron/files/pike/neutron-server.conf b/neutron/files/pike/neutron-server.conf
index 5fd1acd..b1a4628 100644
--- a/neutron/files/pike/neutron-server.conf
+++ b/neutron/files/pike/neutron-server.conf
@@ -34,7 +34,7 @@
 # neutron.extensions is appended to this, so if your extensions are in there
 # you don't need to specify them here. (string value)
 #api_extensions_path =
-agent_down_time = 30
+agent_down_time = {{ server.get('agent_down_time', 30) }}
 
 # The type of authentication to use (string value)
 #auth_strategy = keystone
@@ -303,13 +303,16 @@
 
 # Automatically remove networks from offline DHCP agents. (boolean value)
 #allow_automatic_dhcp_failover = true
+{%- if server.allow_automatic_dhcp_failover is defined %}
+allow_automatic_dhcp_failover = {{ server.get('allow_automatic_dhcp_failover', True)|lower }}
+{%- endif %}
 
 # Number of DHCP agents scheduled to host a tenant network. If this number is
 # greater than 1, the scheduler automatically assigns multiple DHCP agents for
 # a given tenant network, providing high availability for DHCP service.
 # (integer value)
 #dhcp_agents_per_network = 1
-dhcp_agents_per_network = 2
+dhcp_agents_per_network = {{ server.get('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
@@ -501,6 +504,9 @@
 # Size of RPC connection pool. (integer value)
 # Deprecated group/name - [DEFAULT]/rpc_conn_pool_size
 #rpc_conn_pool_size = 30
+{%- if server.message_queue.rpc_conn_pool_size is defined %}
+rpc_conn_pool_size = {{ server.message_queue.rpc_conn_pool_size }}
+{%- endif %}
 
 # The pool size limit for connections expiration policy (integer value)
 #conn_pool_min_size = 2
@@ -634,6 +640,9 @@
 
 # Maximum number of (green) threads to work concurrently. (integer value)
 #rpc_thread_pool_size = 100
+{%- if server.message_queue.rpc_thread_pool_size is defined %}
+rpc_thread_pool_size = {{ server.message_queue.rpc_thread_pool_size }}
+{%- endif %}
 
 # Expiration timeout in seconds of a sent/received message after which it is
 # not tracked anymore by a client/server. (integer value)
@@ -670,7 +679,7 @@
 
 # Seconds to wait for a response from a call. (integer value)
 #rpc_response_timeout = 60
-rpc_response_timeout=120
+rpc_response_timeout = {{ server.message_queue.get('rpc_response_timeout', 120) }}
 
 # A URL representing the messaging driver to use and its full configuration.
 # (string value)
@@ -764,7 +773,7 @@
 # agent_down_time, best if it is half or less than agent_down_time. (floating
 # point value)
 #report_interval = 30
-report_interval = 10
+report_interval = {{ server.get('report_interval', 10) }}
 
 # Log agent heartbeats (boolean value)
 #log_agent_heartbeats = false
diff --git a/neutron/files/queens/neutron-generic.conf b/neutron/files/queens/neutron-generic.conf
index 30fa7a8..2461a31 100644
--- a/neutron/files/queens/neutron-generic.conf
+++ b/neutron/files/queens/neutron-generic.conf
@@ -206,10 +206,6 @@
 # From neutron.db
 #
 
-# 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
-
 # Representing the resource type whose load is being reported by the agent.
 # This can be "networks", "subnets" or "ports". When specified (Default is
 # networks), the server will extract particular load sent as part of its agent
@@ -374,7 +370,7 @@
 # agent_down_time, best if it is half or less than agent_down_time. (floating
 # point value)
 #report_interval = 30
-report_interval = 10
+report_interval = {{ neutron.get('report_interval', 10) }}
 
 # Log agent heartbeats (boolean value)
 #log_agent_heartbeats = false
diff --git a/neutron/files/queens/neutron-server.conf b/neutron/files/queens/neutron-server.conf
index bec05f0..6145cd0 100644
--- a/neutron/files/queens/neutron-server.conf
+++ b/neutron/files/queens/neutron-server.conf
@@ -245,6 +245,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 = {{ server.get('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
@@ -282,13 +283,16 @@
 
 # Automatically remove networks from offline DHCP agents. (boolean value)
 #allow_automatic_dhcp_failover = true
+{%- if server.allow_automatic_dhcp_failover is defined %}
+allow_automatic_dhcp_failover = {{ server.get('allow_automatic_dhcp_failover', True)|lower }}
+{%- endif %}
 
 # Number of DHCP agents scheduled to host a tenant network. If this number is
 # greater than 1, the scheduler automatically assigns multiple DHCP agents for
 # a given tenant network, providing high availability for DHCP service.
 # (integer value)
 #dhcp_agents_per_network = 1
-dhcp_agents_per_network = 2
+dhcp_agents_per_network = {{ server.get('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
@@ -411,7 +415,7 @@
 # agent_down_time, best if it is half or less than agent_down_time. (floating
 # point value)
 #report_interval = 30
-report_interval = 10
+report_interval = {{ server.get('report_interval', 10) }}
 
 # Log agent heartbeats (boolean value)
 #log_agent_heartbeats = false
diff --git a/tests/pillar/compute_dvr.sls b/tests/pillar/compute_dvr.sls
index 24ab218..4071003 100644
--- a/tests/pillar/compute_dvr.sls
+++ b/tests/pillar/compute_dvr.sls
@@ -3,6 +3,7 @@
     base_mac: fa:16:3f:00:00:00
     dvr_base_mac: fa:16:3f:a0:00:00
     agent_mode: dvr
+    report_interval: 10
     backend:
       engine: ml2
       tenant_network_types: "flat,vxlan"
@@ -20,6 +21,9 @@
       port: 5672
       user: openstack
       virtual_host: /openstack
+      rpc_conn_pool_size: 300
+      rpc_thread_pool_size: 2048
+      rpc_response_timeout: 3600
     metadata:
       host: 127.0.0.1
       password: password
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 964f3bd..e8cf760 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -10,6 +10,9 @@
     rpc_workers: 2
     dhcp_lease_duration: 86400
     agent_boot_time: 900
+    agent_down_time: 30
+    dhcp_agents_per_network: 3
+    allow_automatic_dhcp_failover: false
     backend:
       engine: contrail
       #contrail_discovery_host
@@ -47,6 +50,9 @@
       user: openstack
       password: password
       virtual_host: '/openstack'
+      rpc_conn_pool_size: 300
+      rpc_thread_pool_size: 2048
+      rpc_response_timeout: 3600
     compute:
       host: 127.0.0.1
       region: RegionOne
diff --git a/tests/pillar/gateway_dvr.sls b/tests/pillar/gateway_dvr.sls
index 2751c75..4c1dae4 100644
--- a/tests/pillar/gateway_dvr.sls
+++ b/tests/pillar/gateway_dvr.sls
@@ -3,6 +3,7 @@
     base_mac: fa:16:3f:00:00:00
     dvr_base_mac: fa:16:3f:a0:00:00
     agent_mode: dvr_snat
+    report_interval: 10
     backend:
       engine: ml2
       tenant_network_types: "flat,vxlan"
@@ -20,6 +21,9 @@
       port: 5672
       user: openstack
       virtual_host: /openstack
+      rpc_conn_pool_size: 300
+      rpc_thread_pool_size: 2048
+      rpc_response_timeout: 3600
     metadata:
       host: 127.0.0.1
       password: password