From: Andrew Grimberg Date: Mon, 18 Oct 2021 23:51:39 +0000 (-0700) Subject: Fix: Correct boot source options for OpenStack X-Git-Tag: v0.68.1~1 X-Git-Url: https://gerrit.linuxfoundation.org/infra/gitweb?a=commitdiff_plain;h=94dd7d90835137e420ca5e6ae6fbf1647fa73b0f;p=releng%2Fglobal-jjb.git Fix: Correct boot source options for OpenStack If a VOLUME_SIZE option is not defined in the base cloud configuration then the default OpenStack boot selection should be 'image' not 'volumeFromImage' otherwise we are unable to properly take advantage of all options provided by an OpenStack cloud. Change-Id: I76ae042d598c9f7fa1868d4ea6a3566f8c6b8115 Signed-off-by: Andrew Grimberg --- diff --git a/jenkins-admin/create_jenkins_clouds_openstack_yaml.py b/jenkins-admin/create_jenkins_clouds_openstack_yaml.py index a1464a5d..d3424698 100755 --- a/jenkins-admin/create_jenkins_clouds_openstack_yaml.py +++ b/jenkins-admin/create_jenkins_clouds_openstack_yaml.py @@ -93,9 +93,10 @@ jenkins: slaveOptions: availabilityZone: {{ availability_zone }} bootSource: - volumeFromImage: + {{ image_type }}: name: {{ image_name }} - volumeSize: {{ volume_size }} +{%- if image_type == "volumeFromImage" %} + volumeSize: {{ volume_size }}{% endif %} fsRoot: {{ fs_root }} hardwareId: {{ hardware_id }} {%- if is_sandbox is defined %} @@ -201,6 +202,11 @@ for index, _ in enumerate(cloud_config_final): value = lookuptable[value] section_cloud[key] = value + if "volume_size" not in section_cloud: + section_cloud.update(image_type="image") + else: + section_cloud.update(image_type="volumeFromImage") + j2_template = Template(maintemplate) print(j2_template.render(section_cloud)) diff --git a/releasenotes/notes/default_openstack_boot-76a655138ca488b9.yaml b/releasenotes/notes/default_openstack_boot-76a655138ca488b9.yaml new file mode 100644 index 00000000..a8f7a6cc --- /dev/null +++ b/releasenotes/notes/default_openstack_boot-76a655138ca488b9.yaml @@ -0,0 +1,5 @@ +--- +fixes: + - | + The OpenStack JCasC yaml converter has learned how to properly + differentiate between volumeFromImage and image boot sources.