Skip to content

Commit 56d0647

Browse files
committed
Simplify documentation and note architecture/cpu_arch split
1 parent 3315def commit 56d0647

File tree

1 file changed

+27
-19
lines changed

1 file changed

+27
-19
lines changed

roles/os_images/README.md

Lines changed: 27 additions & 19 deletions
Original file line numberDiff line numberDiff line change
@@ -57,6 +57,10 @@ mutually exclusive where each contain:
5757
This is a dict of the form of `KEY: VALUE`.
5858
* `packages`: (optional) list of packages to install in the image.
5959
* `size`: (optional) size to make the image filesystem.
60+
* `architecture`: (optional) image CPU architecture to pass to diskimage-builder `-a`.
61+
If unset, default to the diskimage-builder default architecture: `x86_64`, and upload
62+
Glance images with the `cpu_arch: "x86_64"` image property.
63+
When setting, consider also setting `properties.cpu_arch` to a corresponding value.
6064
* `properties`: (optional) dict of properties to set on the glance image.
6165
Common image properties are available
6266
[here](https://docs.openstack.org/glance/latest/user/common-image-properties.html).
@@ -76,6 +80,9 @@ or 'community'. Default is 'public'
7680
`os_images_common`: A set of elements to include in every image listed.
7781
Defaults to `cloud-init enable-serial-console stable-interface-names`.
7882

83+
`os_images_common_properties`: A dict of Glance image properties to set on all images.
84+
Defaults to an empty dict, and is overridden by `os_images_list.*.properties`.
85+
7986
`os_images_dib_pkg_name`: Optionally customise the name parameter passed
8087
to the ansible.builtin.pip module when installing diskimage-builder. This can
8188
be used to install diskimage-builder from version control.
@@ -121,30 +128,31 @@ will be replaced with the newly built image if `os_images_upload` is set to `Tru
121128
Changing platform architecture in os_images
122129
-------------------------------------------
123130

124-
The `Generate diskimage-builder images` job in the ``os_images`` role can build an
125-
image for a chosen CPU architecture by defining the ``cpu_arch`` image property before
126-
calling the ``os_images`` role. This is an [example](https://github.com/stackhpc/kayobe/blob/18ca11b47af42ce10507516c2f9e34f447d5e39a/ansible/overcloud-host-image-build.yml#L21_)
127-
of a playbook calling the ``os_image`` role & below is an example of how to set the
128-
``cpu_arch`` image property in a configuration like StackHPC-Kayobe-Config:
131+
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+
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.
129136

130137
```yaml
131-
stackhpc_overcloud_dib_host_image:
132-
name: "{{ image_name }}"
133-
elements: "{{ dib_elements }}"
134-
env: "{{ dib_env_vars }}"
135-
packages: "{{ dib_packages }}"
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
136149
properties:
137-
- cpu_arch: "arm64"
150+
cpu_arch: aarch64
151+
packages:
152+
- biosdevname
153+
type: qcow2
138154
```
139155
140-
The ``cpu_arch`` variable will also be set as an image property within the `Upload
141-
cloud tenant images` task in the ``upload.yml`` task.
142-
143-
If left unset the ``cpu_arch`` variable will default to `x86_64` for ``upload.yml``.
144-
However, if not set, the `Generate diskimage-builder images` job will takes the
145-
disk image builder's default.
146-
147-
148156
Dependencies
149157
------------
150158

0 commit comments

Comments
 (0)