You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
*`type`: (optional) image type. Default in DIB is qcow2. Image formats are
64
70
available [here](https://docs.openstack.org/glance/latest/user/formats.html).
65
-
*`force_rebuild`: (optional) boolean flag indicating whether or not the image should always
66
-
be built (even if an existing image that name has been built before). The images on glance
67
-
will be replaced if `os_images_upload` is set to `True`. This defaults to
71
+
*`force_rebuild`: (optional) boolean flag indicating whether or not the image should
72
+
always be built (even if an existing image that name has been built before). The images
73
+
in glance will be replaced if `os_images_upload` is set to `True`. This defaults to
68
74
`os_images_force_rebuild`if left unset.
69
-
*`is_public`: (optional) (deprecated - use `visibility`) whether the image should be set as visible to all
70
-
projects or kept private. Note that if both `is_public` and `visibility` are provided, `is_public` will
71
-
be preferred.
75
+
*`is_public`: (optional) (deprecated - use `visibility`) whether the image should be set
76
+
as visible to all projects or kept private. Note that if both `is_public` and `visibility`
77
+
are provided, `is_public` will be preferred.
72
78
*`visibility`: (optional) Allowed values are 'public', 'private', 'shared'
73
-
or 'community'. Default is 'public'
79
+
or 'community'. Default is 'public'
74
80
*`owner`: (optional) ID of the project that should own the uploaded image.
75
81
*`use_import`: (optional) Whether to use an import workflow instead of direct upload.
76
82
Useful in conjuction with an [interoperable image import](https://docs.openstack.org/glance/latest/admin/interoperable-image-import.html).
@@ -79,6 +85,9 @@ or 'community'. Default is 'public'
79
85
`os_images_common`: A set of elements to include in every image listed.
80
86
Defaults to `cloud-init enable-serial-console stable-interface-names`.
81
87
88
+
`os_images_common_properties`: A dict of Glance image properties to set on all images.
89
+
Defaults to an empty dict, and is overridden by `os_images_list.*.properties`.
90
+
82
91
`os_images_dib_pkg_name`: Optionally customise the name parameter passed
83
92
to the ansible.builtin.pip module when installing diskimage-builder. This can
84
93
be used to install diskimage-builder from version control.
@@ -99,27 +108,50 @@ following parameters:
99
108
100
109
`os_images_upload`: Whether to upload built images to Glance. Defaults to `True`.
101
110
102
-
`os_images_force_rebuild`: Whether or not to force a rebuild of the DIB image. The images on Glance
103
-
will be replaced with the newly built image if `os_images_upload` is set to `True`. Defaults to
104
-
`False`.
111
+
`os_images_force_rebuild`: Whether or not to force a rebuild of the DIB image.
112
+
The images on Glance will be replaced with the newly built image if `os_images_upload`
113
+
is set to `True`. Defaults to `False`.
105
114
106
-
`os_images_public`: (Deprecated - use `os_images_visibility`) Whether uploaded images are public. Defaults to `True` - note this requires admin permissions.
115
+
`os_images_public`: (Deprecated - use `os_images_visibility`) Whether uploaded
116
+
images are public. Defaults to `True` - note this requires admin permissions.
107
117
108
-
`os_images_visibility`: The visibility of images uploaded. One of `community`,`public` or `private`. If unset, defaults to `os_images_public` (requires admin permissions for anything other than `private`)
118
+
`os_images_visibility`: The visibility of images uploaded. One of `community`,
119
+
`public` or `private`. If unset, defaults to `os_images_public` (requires admin
120
+
permissions for anything other than `private`)
109
121
110
-
`os_images_venv`: Path to virtualenv in which to install python dependencies to upload images.
122
+
`os_images_venv`: Path to virtualenv in which to install python dependencies to
123
+
upload images.
111
124
112
125
`os_images_dib_venv`: Path to virtualenv in which to install DIB to build images.
113
126
114
127
`os_images_promote`: Whether or not to promote new images. Defaults to `False`.
115
128
116
-
`os_images_retire`: Whether or not to retire old images. Defaults to `os_image_promote`. May be necessary to set separately if you are promoting a new candidate image for which there is no existing one to retire, for example.
129
+
`os_images_retire`: Whether or not to retire old images. Defaults to `os_image_promote`.
130
+
May be necessary to set separately if you are promoting a new candidate image for which
131
+
there is no existing one to retire, for example.
117
132
118
133
`os_images_build`: Whether or not to build the images.
119
134
120
-
`os_images_name_suffix`: Image suffix which would be removed during image promotion, for exmple: -rc, -dev, -test etc. Mandatory for promotion functionality. Empty by default.
135
+
`os_images_name_suffix`: Image suffix which would be removed during image promotion, for
136
+
exmple: -rc, -dev, -test etc. Mandatory for promotion functionality. Empty by default.
137
+
138
+
`os_images_hide`: Whether or not to hide the images in Glance list. Hiding images is
139
+
available as an option in image retirement/promotion process. Defaults to `False`.
140
+
141
+
Changing platform architecture in os_images
142
+
-------------------------------------------
143
+
144
+
The target CPU architecture for each image defined in `os_images_list` may be set to any
145
+
architecture supported by diskimage-builder with the `architecture` parameter.
146
+
147
+
If it is unset, an image with the default diskimage-builder architecture (`x86_64`) will
148
+
be built and optionally uploaded to Glance, with the Glance image property `cpu_arch` set
149
+
to `x86_64`. If it is set to `arm64` or `aarch64`, images will be uploaded to Glance with
150
+
the Glance image property `cpu_arch` set to `aarch64`.
121
151
122
-
`os_images_hide`: Whether or not to hide the images in Glance list. Hiding images is available as an option in image retirement/promotion process. Defaults to `False`.
152
+
If setting to a different `architecture`, consider also setting `properties.cpu_arch` to an
153
+
architecture
154
+
[supported by Glance](https://docs.openstack.org/glance/latest/admin/useful-image-properties.html#image-property-keys-and-values).
Copy file name to clipboardExpand all lines: roles/os_images/tasks/images.yml
+3-2Lines changed: 3 additions & 2 deletions
Original file line number
Diff line number
Diff line change
@@ -83,8 +83,9 @@
83
83
- name: Generate diskimage-builder images
84
84
vars:
85
85
dib_args: >-
86
-
{% if item.size is defined %}--image-size {{ item.size }}{% endif %} {% if item.type is defined %}-t {{ item.type }}{% endif %} {% if item.packages | default
# NOTE(m-anson): When architecture isn't defined for an
119
+
# image, assume that we should set cpu_arch: x86_64 as
120
+
# this is the diskimage-builder default. If an architecture
121
+
# of arm64 or aarch64 is defined, set cpu_arch: aarch64. In
122
+
# all other cases, leave it up to the operator to set
123
+
# properties.cpu_arch.
124
+
cpu_arch_properties: >-
125
+
{{
126
+
{"cpu_arch": "aarch64"}
127
+
if (item.0.architecture is defined and item.0.architecture in ["arm64", "aarch64"])
128
+
else ({"cpu_arch": "x86_64"} if item.0.architecture is not defined else {})
129
+
}}
118
130
is_baremetal: "{{ item.0.elements is defined and 'baremetal' in item.0.elements }}"
119
131
visibility: "{{ item.0.visibility | default(item.0.is_public | ternary('public', 'private') if item.0.is_public is defined else os_images_visibility) }}"
0 commit comments