Extend template to set up additional values:
- use_cow_images
- force_raw_images
- snapshot_image_format
- images_type
Prod-Related: PROD-34639
Change-Id: I172e8e7d97786f059dad4586d3bf27fa86b89dce
diff --git a/README.rst b/README.rst
index ce885a6..845b30a 100644
--- a/README.rst
+++ b/README.rst
@@ -33,6 +33,10 @@
vif_plugging_timeout: 300
vif_plugging_is_fatal: false
instance_build_timeout: 600
+ use_cow_images: False
+ force_raw_images: True
+ snapshot_image_format: qcow2
+ images_type: default
concurrency:
lock_path: '/var/lib/nova/tmp'
consoleauth:
diff --git a/nova/files/ocata/nova-controller.conf.Debian b/nova/files/ocata/nova-controller.conf.Debian
index 7bef3bf..ba3b26b 100644
--- a/nova/files/ocata/nova-controller.conf.Debian
+++ b/nova/files/ocata/nova-controller.conf.Debian
@@ -378,6 +378,9 @@
# backing files will not be used.
# (boolean value)
#use_cow_images=true
+{%- if controller.use_cow_images is defined and controller.use_cow_images|string|lower in ['true','false'] %}
+use_cow_images = {{ controller.use_cow_images|lower }}
+{%- endif %}
#
# Force conversion of backing images to raw format.
@@ -392,6 +395,9 @@
# * ``compute_driver``: Only the libvirt driver uses this option.
# (boolean value)
#force_raw_images=true
+{%- if controller.force_raw_images is defined and controller.force_raw_images|string|lower in ['true','false'] %}
+force_raw_images = {{ controller.force_raw_images|lower }}
+{%- endif %}
#
# Name of the mkfs commands for ephemeral device.
@@ -6399,6 +6405,9 @@
# (string value)
# Allowed values: raw, qcow2, vmdk, vdi
#snapshot_image_format=<None>
+{%- if controller.snapshot_image_format is defined and controller.snapshot_image_format in ['raw','qcow2','vmdk','vdi'] %}
+snapshot_image_format = {{ controller.snapshot_image_format }}
+{%- endif %}
#
# Override the default disk prefix for the devices attached to an instance.
@@ -6533,6 +6542,9 @@
# (string value)
# Allowed values: raw, flat, qcow2, lvm, rbd, ploop, default
#images_type=default
+{%- if controller.images_type is defined and controller.images_type in ['raw','flat','qcow2','lvm','rbd','ploop','default'] %}
+images_type = {{ controller.images_type }}
+{%- endif %}
#
# LVM Volume Group that is used for VM images, when you specify images_type=lvm
diff --git a/nova/files/pike/nova-controller.conf.Debian b/nova/files/pike/nova-controller.conf.Debian
index f172c79..60b747e 100644
--- a/nova/files/pike/nova-controller.conf.Debian
+++ b/nova/files/pike/nova-controller.conf.Debian
@@ -388,6 +388,9 @@
# backing files will not be used.
# (boolean value)
#use_cow_images=true
+{%- if controller.use_cow_images is defined and controller.use_cow_images|string|lower in ['true','false'] %}
+use_cow_images = {{ controller.use_cow_images|lower }}
+{%- endif %}
#
# Force conversion of backing images to raw format.
@@ -402,6 +405,9 @@
# * ``compute_driver``: Only the libvirt driver uses this option.
# (boolean value)
#force_raw_images=true
+{%- if controller.force_raw_images is defined and controller.force_raw_images|string|lower in ['true','false'] %}
+force_raw_images = {{ controller.force_raw_images|lower }}
+{%- endif %}
#
# Name of the mkfs commands for ephemeral device.
@@ -6476,6 +6482,9 @@
# (string value)
# Allowed values: raw, qcow2, vmdk, vdi
#snapshot_image_format=<None>
+{%- if controller.snapshot_image_format is defined and controller.snapshot_image_format in ['raw','qcow2','vmdk','vdi'] %}
+snapshot_image_format = {{ controller.snapshot_image_format }}
+{%- endif %}
#
# Override the default disk prefix for the devices attached to an instance.
@@ -6613,6 +6622,9 @@
# (string value)
# Allowed values: raw, flat, qcow2, lvm, rbd, ploop, default
#images_type=default
+{%- if controller.images_type is defined and controller.images_type in ['raw','flat','qcow2','lvm','rbd','ploop','default'] %}
+images_type = {{ controller.images_type }}
+{%- endif %}
#
# LVM Volume Group that is used for VM images, when you specify images_type=lvm
diff --git a/nova/files/queens/nova-controller.conf.Debian b/nova/files/queens/nova-controller.conf.Debian
index a861933..ba57f84 100644
--- a/nova/files/queens/nova-controller.conf.Debian
+++ b/nova/files/queens/nova-controller.conf.Debian
@@ -384,6 +384,9 @@
# backing files will not be used.
# (boolean value)
#use_cow_images = true
+{%- if controller.use_cow_images is defined and controller.use_cow_images|string|lower in ['true','false'] %}
+use_cow_images = {{ controller.use_cow_images|lower }}
+{%- endif %}
#
# Force conversion of backing images to raw format.
@@ -398,6 +401,9 @@
# * ``compute_driver``: Only the libvirt driver uses this option.
# (boolean value)
#force_raw_images = true
+{%- if controller.force_raw_images is defined and controller.force_raw_images|string|lower in ['true','false'] %}
+force_raw_images = {{ controller.force_raw_images|lower }}
+{%- endif %}
#
# Name of the mkfs commands for ephemeral device.
@@ -6700,6 +6706,9 @@
# vmdk - <No description provided>
# vdi - <No description provided>
#snapshot_image_format = <None>
+{%- if controller.snapshot_image_format is defined and controller.snapshot_image_format in ['raw','qcow2','vmdk','vdi'] %}
+snapshot_image_format = {{ controller.snapshot_image_format }}
+{%- endif %}
#
# Override the default disk prefix for the devices attached to an
@@ -7027,6 +7036,9 @@
# ploop - <No description provided>
# default - <No description provided>
#images_type = default
+{%- if controller.images_type is defined and controller.images_type in ['raw','flat','qcow2','lvm','rbd','ploop','default'] %}
+images_type = {{ controller.images_type }}
+{%- endif %}
#
# LVM Volume Group that is used for VM images, when you specify
diff --git a/tests/pillar/control_cluster.sls b/tests/pillar/control_cluster.sls
index 16a9cc2..0bbfb06 100644
--- a/tests/pillar/control_cluster.sls
+++ b/tests/pillar/control_cluster.sls
@@ -14,6 +14,10 @@
workers: 8
instance_build_timeout: 600
secure_proxy_ssl_header: HTTP_X_FORWARDED_PROTO
+ use_cow_images: False
+ force_raw_images: True
+ snapshot_image_format: qcow2
+ images_type: default
bind:
private_address: 127.0.0.1
public_address: 127.0.0.1