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
@@ -130,28 +132,9 @@ Changing platform architecture in os_images
130
132
131
133
The target CPU architecture for each image defined in `os_images_list` may be set to any architecture supported by diskimage-builder with the `architecture` parameter.
132
134
133
-
If it is unset, an image with the default diskimage-builder architecture (`x86_64`) will be built and optionally uploaded to Glance, with the Glance image property `cpu_arch` set to `x86_64`.
134
-
135
-
If `architecture` is set for an image, consider also setting `properties.cpu_arch` to an architecture [supported by Glance](https://docs.openstack.org/glance/latest/admin/useful-image-properties.html#image-property-keys-and-values). An example is given below.
136
-
137
-
```yaml
138
-
os_images_list:
139
-
- name: ubuntu
140
-
elements:
141
-
- ubuntu
142
-
packages:
143
-
- biosdevname
144
-
type: qcow2
145
-
- name: ubuntu-aarch64
146
-
architecture: arm64
147
-
elements:
148
-
- ubuntu
149
-
properties:
150
-
cpu_arch: aarch64
151
-
packages:
152
-
- biosdevname
153
-
type: qcow2
154
-
```
135
+
If it is unset, an image with the default diskimage-builder architecture (`x86_64`) will be built and optionally uploaded to Glance, with the Glance image property `cpu_arch` set to `x86_64`. If it is set to `arm64` or `aarch64`, images will be uploaded to Glance with the Glance image property `cpu_arch` set to `aarch64`.
136
+
137
+
If setting to a different `architecture`, consider also setting `properties.cpu_arch` to an architecture [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/upload.yml
+13-4Lines changed: 13 additions & 4 deletions
Original file line number
Diff line number
Diff line change
@@ -116,12 +116,21 @@
116
116
vars:
117
117
# NOTE(m-anson): When architecture isn't defined for an
118
118
# image, assume that we should set cpu_arch: x86_64 as
119
-
# this is the diskimage-builder default.
119
+
# this is the diskimage-builder default. If an architecture
120
+
# of arm64 or aarch64 is defined, set cpu_arch: aarch64. In
121
+
# all other cases, leave it up to the operator to set
122
+
# properties.cpu_arch.
120
123
cpu_arch_properties: >-
121
124
{{
122
-
{}
123
-
if item.0.architecture is defined
124
-
else {"cpu_arch": "x86_64"}
125
+
{} | combine(
126
+
{"cpu_arch": "x86_64"}
127
+
if item.0.architecture is not defined
128
+
else {}
129
+
) | combine(
130
+
{"cpu_arch": "aarch64"}
131
+
if item.0.architecture is defined and item.0.architecture in ["arm64", "aarch64"]
132
+
else {}
133
+
)
125
134
}}
126
135
is_baremetal: "{{ item.0.elements is defined and 'baremetal' in item.0.elements }}"
127
136
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