Merge "Remove obsolete alerts"
diff --git a/.kitchen.yml b/.kitchen.yml
index 4391444..5a730e3 100644
--- a/.kitchen.yml
+++ b/.kitchen.yml
@@ -61,7 +61,7 @@
 
 suites:
 <% for os_version in ['mitaka','newton','ocata','pike', 'queens', 'rocky'] %>
-  - name: compute_cluster
+  - name: compute_cluster_<%=os_version%>
     provisioner:
       pillars-from-files:
         nova.sls: tests/pillar/compute_cluster.sls
@@ -72,7 +72,7 @@
             compute:
               version: <%=os_version%>
 
-  - name: control_cluster
+  - name: control_cluster_<%=os_version%>
     provisioner:
       pillars-from-files:
         nova.sls: tests/pillar/control_cluster.sls
diff --git a/README.rst b/README.rst
index a290d34..1d3daa9 100644
--- a/README.rst
+++ b/README.rst
@@ -32,6 +32,7 @@
         dhcp_domain: novalocal
         vif_plugging_timeout: 300
         vif_plugging_is_fatal: false
+        instance_build_timeout: 600
         consoleauth:
           token_ttl: 600
         bind:
diff --git a/nova/controller.sls b/nova/controller.sls
index 68a9bb4..6e9a4cb 100644
--- a/nova/controller.sls
+++ b/nova/controller.sls
@@ -428,8 +428,9 @@
     - sls: nova.db.offline_sync
 
 nova_controller_map_instances:
-  novang.map_instances:
+  novav21.instances_mapped_to_cell:
   - name: 'cell1'
+  - timeout: {{ controller.get('mapped_instances_interval', 60) }}
   {%- if grains.get('noservices') %}
   - onlyif: /bin/false
   {%- endif %}
@@ -486,4 +487,4 @@
 
 {%- endif %}
 
-{%- endif %}
+{%- endif %}
\ No newline at end of file
diff --git a/nova/files/pike/nova-compute.conf.Debian b/nova/files/pike/nova-compute.conf.Debian
index a43729a..2d3f8dd 100644
--- a/nova/files/pike/nova-compute.conf.Debian
+++ b/nova/files/pike/nova-compute.conf.Debian
@@ -1028,7 +1028,11 @@
 # * Any positive integer in seconds: Enables the option.
 #  (integer value)
 # Minimum value: 0
-#instance_build_timeout=0
+{%- if compute.instance_build_timeout is defined %}
+instance_build_timeout = {{ compute.instance_build_timeout }}
+{%- else %}
+#instance_build_timeout = 0
+{%- endif %}
 
 #
 # Interval to wait before un-rescuing an instance stuck in RESCUE.
diff --git a/nova/files/pike/nova-controller.conf.Debian b/nova/files/pike/nova-controller.conf.Debian
index 8b59db2..910b0de 100644
--- a/nova/files/pike/nova-controller.conf.Debian
+++ b/nova/files/pike/nova-controller.conf.Debian
@@ -1008,7 +1008,11 @@
 # * Any positive integer in seconds: Enables the option.
 #  (integer value)
 # Minimum value: 0
-#instance_build_timeout=0
+{%- if controller.instance_build_timeout is defined %}
+instance_build_timeout = {{ controller.instance_build_timeout }}
+{%- else %}
+#instance_build_timeout = 0
+{%- endif %}
 
 #
 # Interval to wait before un-rescuing an instance stuck in RESCUE.
diff --git a/nova/files/queens/nova-compute.conf.Debian b/nova/files/queens/nova-compute.conf.Debian
index 645cc4d..d1763dd 100644
--- a/nova/files/queens/nova-compute.conf.Debian
+++ b/nova/files/queens/nova-compute.conf.Debian
@@ -1108,7 +1108,11 @@
 # * Any positive integer in seconds: Enables the option.
 #  (integer value)
 # Minimum value: 0
+{%- if compute.instance_build_timeout is defined %}
+instance_build_timeout = {{ compute.instance_build_timeout }}
+{%- else %}
 #instance_build_timeout = 0
+{%- endif %}
 
 #
 # Interval to wait before un-rescuing an instance stuck in RESCUE.
@@ -3734,97 +3738,11 @@
 
 [cache]
 
-#
-# From nova.conf
-#
 {%- if compute.cache is defined %}
-backend = oslo_cache.memcache_pool
-enabled = true
-memcache_servers={%- for member in compute.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
+{%- set _data = compute.cache %}
+{%- include "oslo_templates/files/queens/oslo/_cache.conf" %}
 {%- endif %}
 
-# Prefix for building the configuration dictionary for the cache
-# region. This should not need to be changed unless there is another
-# dogpile.cache region with the same configuration name. (string
-# value)
-#config_prefix = cache.oslo
-
-# Default TTL, in seconds, for any cached item in the dogpile.cache
-# region. This applies to any cached method that doesn't have an
-# explicit cache expiration time defined for it. (integer value)
-#expiration_time = 600
-
-# Cache backend module. For eventlet-based or environments with
-# hundreds of threaded servers, Memcache with pooling
-# (oslo_cache.memcache_pool) is recommended. For environments with
-# less than 100 threaded servers, Memcached (dogpile.cache.memcached)
-# or Redis (dogpile.cache.redis) is recommended. Test environments
-# with a single instance of the server can use the
-# dogpile.cache.memory backend. (string value)
-# Possible values:
-# oslo_cache.memcache_pool - <No description provided>
-# oslo_cache.dict - <No description provided>
-# oslo_cache.mongo - <No description provided>
-# oslo_cache.etcd3gw - <No description provided>
-# dogpile.cache.memcached - <No description provided>
-# dogpile.cache.pylibmc - <No description provided>
-# dogpile.cache.bmemcached - <No description provided>
-# dogpile.cache.dbm - <No description provided>
-# dogpile.cache.redis - <No description provided>
-# dogpile.cache.memory - <No description provided>
-# dogpile.cache.memory_pickle - <No description provided>
-# dogpile.cache.null - <No description provided>
-#backend = dogpile.cache.null
-
-# Arguments supplied to the backend module. Specify this option once
-# per argument to be passed to the dogpile.cache backend. Example
-# format: "<argname>:<value>". (multi valued)
-#backend_argument =
-
-# Proxy classes to import that will affect the way the dogpile.cache
-# backend functions. See the dogpile.cache documentation on changing-
-# backend-behavior. (list value)
-#proxies =
-
-# Global toggle for caching. (boolean value)
-#enabled = false
-
-# Extra debugging from the cache backend (cache keys,
-# get/set/delete/etc calls). This is only really useful if you need to
-# see the specific cache-backend get/set/delete calls with the
-# keys/values.  Typically this should be left set to false. (boolean
-# value)
-#debug_cache_backend = false
-
-# Memcache servers in the format of "host:port".
-# (dogpile.cache.memcache and oslo_cache.memcache_pool backends only).
-# (list value)
-#memcache_servers = localhost:11211
-
-# Number of seconds memcached server is considered dead before it is
-# tried again. (dogpile.cache.memcache and oslo_cache.memcache_pool
-# backends only). (integer value)
-#memcache_dead_retry = 300
-
-# Timeout in seconds for every call to a server.
-# (dogpile.cache.memcache and oslo_cache.memcache_pool backends only).
-# (integer value)
-#memcache_socket_timeout = 3
-
-# Max total number of open connections to every memcached server.
-# (oslo_cache.memcache_pool backend only). (integer value)
-#memcache_pool_maxsize = 10
-
-# Number of seconds a connection to memcached is held unused in the
-# pool before it is closed. (oslo_cache.memcache_pool backend only).
-# (integer value)
-#memcache_pool_unused_timeout = 60
-
-# Number of seconds that an operation will wait to get a memcache
-# client connection. (integer value)
-#memcache_pool_connection_get_timeout = 10
-
-
 [cells]
 #
 # DEPRECATED: Cells options allow you to use cells v1 functionality in
diff --git a/nova/files/queens/nova-controller.conf.Debian b/nova/files/queens/nova-controller.conf.Debian
index f430fdf..948084c 100644
--- a/nova/files/queens/nova-controller.conf.Debian
+++ b/nova/files/queens/nova-controller.conf.Debian
@@ -1099,7 +1099,11 @@
 # * Any positive integer in seconds: Enables the option.
 #  (integer value)
 # Minimum value: 0
+{%- if controller.instance_build_timeout is defined %}
+instance_build_timeout = {{ controller.instance_build_timeout }}
+{%- else %}
 #instance_build_timeout = 0
+{%- endif %}
 
 #
 # Interval to wait before un-rescuing an instance stuck in RESCUE.
@@ -3736,96 +3740,11 @@
 
 [cache]
 
-#
-# From nova.conf
-#
 {%- if controller.cache is defined %}
-backend = oslo_cache.memcache_pool
-enabled = true
-memcache_servers={%- for member in controller.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
+{%- set _data = controller.cache %}
+{%- include "oslo_templates/files/queens/oslo/_cache.conf" %}
 {%- endif %}
 
-# Prefix for building the configuration dictionary for the cache
-# region. This should not need to be changed unless there is another
-# dogpile.cache region with the same configuration name. (string
-# value)
-#config_prefix = cache.oslo
-
-# Default TTL, in seconds, for any cached item in the dogpile.cache
-# region. This applies to any cached method that doesn't have an
-# explicit cache expiration time defined for it. (integer value)
-#expiration_time = 600
-
-# Cache backend module. For eventlet-based or environments with
-# hundreds of threaded servers, Memcache with pooling
-# (oslo_cache.memcache_pool) is recommended. For environments with
-# less than 100 threaded servers, Memcached (dogpile.cache.memcached)
-# or Redis (dogpile.cache.redis) is recommended. Test environments
-# with a single instance of the server can use the
-# dogpile.cache.memory backend. (string value)
-# Possible values:
-# oslo_cache.memcache_pool - <No description provided>
-# oslo_cache.dict - <No description provided>
-# oslo_cache.mongo - <No description provided>
-# oslo_cache.etcd3gw - <No description provided>
-# dogpile.cache.memcached - <No description provided>
-# dogpile.cache.pylibmc - <No description provided>
-# dogpile.cache.bmemcached - <No description provided>
-# dogpile.cache.dbm - <No description provided>
-# dogpile.cache.redis - <No description provided>
-# dogpile.cache.memory - <No description provided>
-# dogpile.cache.memory_pickle - <No description provided>
-# dogpile.cache.null - <No description provided>
-#backend = dogpile.cache.null
-
-# Arguments supplied to the backend module. Specify this option once
-# per argument to be passed to the dogpile.cache backend. Example
-# format: "<argname>:<value>". (multi valued)
-#backend_argument =
-
-# Proxy classes to import that will affect the way the dogpile.cache
-# backend functions. See the dogpile.cache documentation on changing-
-# backend-behavior. (list value)
-#proxies =
-
-# Global toggle for caching. (boolean value)
-#enabled = false
-
-# Extra debugging from the cache backend (cache keys,
-# get/set/delete/etc calls). This is only really useful if you need to
-# see the specific cache-backend get/set/delete calls with the
-# keys/values.  Typically this should be left set to false. (boolean
-# value)
-#debug_cache_backend = false
-
-# Memcache servers in the format of "host:port".
-# (dogpile.cache.memcache and oslo_cache.memcache_pool backends only).
-# (list value)
-#memcache_servers = localhost:11211
-
-# Number of seconds memcached server is considered dead before it is
-# tried again. (dogpile.cache.memcache and oslo_cache.memcache_pool
-# backends only). (integer value)
-#memcache_dead_retry = 300
-
-# Timeout in seconds for every call to a server.
-# (dogpile.cache.memcache and oslo_cache.memcache_pool backends only).
-# (integer value)
-#memcache_socket_timeout = 3
-
-# Max total number of open connections to every memcached server.
-# (oslo_cache.memcache_pool backend only). (integer value)
-#memcache_pool_maxsize = 10
-
-# Number of seconds a connection to memcached is held unused in the
-# pool before it is closed. (oslo_cache.memcache_pool backend only).
-# (integer value)
-#memcache_pool_unused_timeout = 60
-
-# Number of seconds that an operation will wait to get a memcache
-# client connection. (integer value)
-#memcache_pool_connection_get_timeout = 10
-
 
 [cells]
 #
diff --git a/nova/files/rocky/nova-compute.conf.Debian b/nova/files/rocky/nova-compute.conf.Debian
index ed0aceb..62d8503 100644
--- a/nova/files/rocky/nova-compute.conf.Debian
+++ b/nova/files/rocky/nova-compute.conf.Debian
@@ -3223,88 +3223,11 @@
 
 
 [cache]
-
-#
-# From nova.conf
-#
-
 {%- if compute.cache is defined %}
-# Global toggle for caching. (boolean value)
-enabled = true
-
-# Cache backend module. For eventlet-based or environments with hundreds of
-# threaded servers, Memcache with pooling (oslo_cache.memcache_pool) is
-# recommended. For environments with less than 100 threaded servers, Memcached
-# (dogpile.cache.memcached) or Redis (dogpile.cache.redis) is recommended. Test
-# environments with a single instance of the server can use the
-# dogpile.cache.memory backend. (string value)
-# Possible values:
-# oslo_cache.memcache_pool - <No description provided>
-# oslo_cache.dict - <No description provided>
-# oslo_cache.mongo - <No description provided>
-# oslo_cache.etcd3gw - <No description provided>
-# dogpile.cache.memcached - <No description provided>
-# dogpile.cache.pylibmc - <No description provided>
-# dogpile.cache.bmemcached - <No description provided>
-# dogpile.cache.dbm - <No description provided>
-# dogpile.cache.redis - <No description provided>
-# dogpile.cache.memory - <No description provided>
-# dogpile.cache.memory_pickle - <No description provided>
-# dogpile.cache.null - <No description provided>
-backend = oslo_cache.memcache_pool
-
-# Memcache servers in the format of "host:port". (dogpile.cache.memcache and
-# oslo_cache.memcache_pool backends only). (list value)
-memcache_servers = {%- for member in compute.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
+{%- set _data = compute.cache %}
+{%- include "oslo_templates/files/" ~ compute.version ~ "/oslo/_cache.conf" %}
 {%- endif %}
 
-# Prefix for building the configuration dictionary for the cache region. This
-# should not need to be changed unless there is another dogpile.cache region
-# with the same configuration name. (string value)
-#config_prefix = cache.oslo
-
-# Default TTL, in seconds, for any cached item in the dogpile.cache region. This
-# applies to any cached method that doesn't have an explicit cache expiration
-# time defined for it. (integer value)
-#expiration_time = 600
-
-# Arguments supplied to the backend module. Specify this option once per
-# argument to be passed to the dogpile.cache backend. Example format:
-# "<argname>:<value>". (multi valued)
-#backend_argument =
-
-# Proxy classes to import that will affect the way the dogpile.cache backend
-# functions. See the dogpile.cache documentation on changing-backend-behavior.
-# (list value)
-#proxies =
-
-# Extra debugging from the cache backend (cache keys, get/set/delete/etc calls).
-# This is only really useful if you need to see the specific cache-backend
-# get/set/delete calls with the keys/values.  Typically this should be left set
-# to false. (boolean value)
-#debug_cache_backend = false
-
-# Number of seconds memcached server is considered dead before it is tried
-# again. (dogpile.cache.memcache and oslo_cache.memcache_pool backends only).
-# (integer value)
-#memcache_dead_retry = 300
-
-# Timeout in seconds for every call to a server. (dogpile.cache.memcache and
-# oslo_cache.memcache_pool backends only). (floating point value)
-#memcache_socket_timeout = 3.0
-
-# Max total number of open connections to every memcached server.
-# (oslo_cache.memcache_pool backend only). (integer value)
-#memcache_pool_maxsize = 10
-
-# Number of seconds a connection to memcached is held unused in the pool before
-# it is closed. (oslo_cache.memcache_pool backend only). (integer value)
-#memcache_pool_unused_timeout = 60
-
-# Number of seconds that an operation will wait to get a memcache client
-# connection. (integer value)
-#memcache_pool_connection_get_timeout = 10
-
 
 [cells]
 #
diff --git a/nova/files/rocky/nova-controller.conf.Debian b/nova/files/rocky/nova-controller.conf.Debian
index 717df93..bf72a10 100644
--- a/nova/files/rocky/nova-controller.conf.Debian
+++ b/nova/files/rocky/nova-controller.conf.Debian
@@ -3218,88 +3218,11 @@
 
 
 [cache]
-
-#
-# From nova.conf
-#
-
 {%- if controller.cache is defined %}
-# Global toggle for caching. (boolean value)
-enabled = true
-
-# Cache backend module. For eventlet-based or environments with hundreds of
-# threaded servers, Memcache with pooling (oslo_cache.memcache_pool) is
-# recommended. For environments with less than 100 threaded servers, Memcached
-# (dogpile.cache.memcached) or Redis (dogpile.cache.redis) is recommended. Test
-# environments with a single instance of the server can use the
-# dogpile.cache.memory backend. (string value)
-# Possible values:
-# oslo_cache.memcache_pool - <No description provided>
-# oslo_cache.dict - <No description provided>
-# oslo_cache.mongo - <No description provided>
-# oslo_cache.etcd3gw - <No description provided>
-# dogpile.cache.memcached - <No description provided>
-# dogpile.cache.pylibmc - <No description provided>
-# dogpile.cache.bmemcached - <No description provided>
-# dogpile.cache.dbm - <No description provided>
-# dogpile.cache.redis - <No description provided>
-# dogpile.cache.memory - <No description provided>
-# dogpile.cache.memory_pickle - <No description provided>
-# dogpile.cache.null - <No description provided>
-backend = oslo_cache.memcache_pool
-
-# Memcache servers in the format of "host:port". (dogpile.cache.memcache and
-# oslo_cache.memcache_pool backends only). (list value)
-memcache_servers = {%- for member in controller.cache.members %}{{ member.host }}:11211{% if not loop.last %},{% endif %}{%- endfor %}
+{%- set _data = controller.cache %}
+{%- include "oslo_templates/files/" ~ controller.version ~ "/oslo/_cache.conf" %}
 {%- endif %}
 
-# Prefix for building the configuration dictionary for the cache region. This
-# should not need to be changed unless there is another dogpile.cache region
-# with the same configuration name. (string value)
-#config_prefix = cache.oslo
-
-# Default TTL, in seconds, for any cached item in the dogpile.cache region. This
-# applies to any cached method that doesn't have an explicit cache expiration
-# time defined for it. (integer value)
-#expiration_time = 600
-
-# Arguments supplied to the backend module. Specify this option once per
-# argument to be passed to the dogpile.cache backend. Example format:
-# "<argname>:<value>". (multi valued)
-#backend_argument =
-
-# Proxy classes to import that will affect the way the dogpile.cache backend
-# functions. See the dogpile.cache documentation on changing-backend-behavior.
-# (list value)
-#proxies =
-
-# Extra debugging from the cache backend (cache keys, get/set/delete/etc calls).
-# This is only really useful if you need to see the specific cache-backend
-# get/set/delete calls with the keys/values.  Typically this should be left set
-# to false. (boolean value)
-#debug_cache_backend = false
-
-# Number of seconds memcached server is considered dead before it is tried
-# again. (dogpile.cache.memcache and oslo_cache.memcache_pool backends only).
-# (integer value)
-#memcache_dead_retry = 300
-
-# Timeout in seconds for every call to a server. (dogpile.cache.memcache and
-# oslo_cache.memcache_pool backends only). (floating point value)
-#memcache_socket_timeout = 3.0
-
-# Max total number of open connections to every memcached server.
-# (oslo_cache.memcache_pool backend only). (integer value)
-#memcache_pool_maxsize = 10
-
-# Number of seconds a connection to memcached is held unused in the pool before
-# it is closed. (oslo_cache.memcache_pool backend only). (integer value)
-#memcache_pool_unused_timeout = 60
-
-# Number of seconds that an operation will wait to get a memcache client
-# connection. (integer value)
-#memcache_pool_connection_get_timeout = 10
-
 
 [cells]
 #
diff --git a/nova/upgrade/upgrade/init.sls b/nova/upgrade/upgrade/init.sls
index 31f23f8..061e474 100644
--- a/nova/upgrade/upgrade/init.sls
+++ b/nova/upgrade/upgrade/init.sls
@@ -9,5 +9,7 @@
  - nova.upgrade.service_stopped
  - nova.upgrade.pkgs_latest
  - nova.upgrade.render_config
+{%- if controller.get('enabled', False) %}
  - nova.db.offline_sync
+{%- endif %}
  - nova.upgrade.service_running
diff --git a/tests/pillar/compute_cluster.sls b/tests/pillar/compute_cluster.sls
index 378de4f..53ff9c6 100644
--- a/tests/pillar/compute_cluster.sls
+++ b/tests/pillar/compute_cluster.sls
@@ -14,6 +14,7 @@
     vnc_keymap: en-gb
     resume_guests_state_on_host_boot: True
     preallocate_images: space
+    instance_build_timeout: 600
     bind:
       vnc_address: 127.0.0.1
       vnc_port: 6080
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 397d659..ab37b5f 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -12,6 +12,7 @@
     ram_allocation_ratio: 1.5
     disk_allocation_ratio: 1.0
     workers: 8
+    instance_build_timeout: 600
     bind:
       private_address: 127.0.0.1
       public_address: 127.0.0.1