Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
41 changes: 41 additions & 0 deletions dev/image-set-properties.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,41 @@
#!/usr/bin/bash
# Set image properties correctly for Slurm Appliance images
#
# Usage:
# dev/image-set-properties.sh $IMAGE_NAME_OR_ID

set -euo pipefail

image=${1?param missing - image name or ID}
echo getting image format ...
format=$(openstack image show -c disk_format -f value "${image}")

echo setting constant properties ...
set -x
openstack image set \
--property hw_machine_type=q35 \
--property hw_architecture=x86_64 \
--property hw_vif_multiqueue_enabled=true \
--property hw_firmware_type=uefi \
--property os_distro=rocky \
--property os_type=linux \
--property os_admin_user=rocky \
"$image"

set +x
if [[ "$format" = raw ]]; then
echo setting raw properties...
set -x
openstack image set \
--property hw_scsi_model=virtio-scsi \
--property hw_disk_bus=scsi \
"$image"
else
echo setting qcow2 properties
set -x
openstack image set \
--property hw_scsi_model=virtio-scsi \
--property hw_disk_bus=scsi \
--property hw_scsi_model=virtio \
"$image"
fi
12 changes: 12 additions & 0 deletions docs/image-build.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,10 +128,22 @@ For either a site-specific fat-image build or an extra-build:
then delete the failed volume, select cancelling the build when Packer asks,
and then retry. This is [OpenStack bug 1823445](https://bugs.launchpad.net/cinder/+bug/1823445).

The image name and UUID will be output near the end of a build, e.g.:

```shell
==> openstack.openhpc: Waiting for image openhpc-251017-1156-046b6133 (image id: 86ac2073-0a86-4fbf-935c-f1b6e6392e90) to become ready...
```

6. The built image will be automatically uploaded to OpenStack. By default it
will have a name prefixed `openhpc` and including a timestamp and a shortened
Git hash.

7. Set the image properties. From the repository root run:

```shell
dev/image-set-properties.sh $IMAGE_NAME_OR_ID
```

## Build Process

In summary, Packer creates an OpenStack VM, runs Ansible on that, shuts it down, then creates an image from the root disk.
Expand Down
Loading