2020-07-02 15:45:17 +00:00
|
|
|
# How to create a custom Ubuntu image
|
2019-09-10 18:11:39 +00:00
|
|
|
|
2020-07-02 15:45:17 +00:00
|
|
|
In the context of adding more utilities to the Ubuntu cloud image being used
|
|
|
|
for integration testing, this quick guide details how to achieve the proper
|
|
|
|
modification of an official Ubuntu cloud image.
|
2019-09-10 18:11:39 +00:00
|
|
|
|
2024-10-04 20:13:26 +00:00
|
|
|
## Image generation script
|
2020-07-02 15:45:17 +00:00
|
|
|
|
2024-10-22 21:05:50 +00:00
|
|
|
This [script](../scripts/build-custom-image.sh) can be used to generate a custom image (needs to be modified per architecture/distribution image)
|
2020-07-02 15:45:17 +00:00
|
|
|
|
|
|
|
## Switch CI to use the new image
|
|
|
|
|
|
|
|
### Upload to Azure storage
|
|
|
|
|
2024-10-04 20:13:26 +00:00
|
|
|
A command like the following can be used to upload the image:
|
|
|
|
|
|
|
|
`az storage blob upload --account-name cloudhypervisorstorages --container-name '$web' --name jammy-server-cloudimg-amd64-custom-20241017-0.qcow2 --file jammy-server-cloudimg-amd64-custom-20241017-0.qcow2 --sas-token <redacted>`
|
2020-07-02 15:45:17 +00:00
|
|
|
|
|
|
|
### Update integration tests
|
|
|
|
|
|
|
|
Last step is about updating the integration tests to work with this new image.
|
|
|
|
The key point is to identify where the Linux filesystem partition is located,
|
|
|
|
as we might need to update the direct kernel boot command line, replacing
|
|
|
|
`/dev/vda1` with the appropriate partition number.
|
2021-01-06 14:12:35 +00:00
|
|
|
|
|
|
|
Update all references to the previous image name to the new one.
|
2022-11-25 10:04:06 +00:00
|
|
|
|
2024-06-07 15:48:53 +00:00
|
|
|
## NVIDIA image for VFIO bare-metal CI
|
2022-11-25 10:04:06 +00:00
|
|
|
|
2024-10-04 20:13:26 +00:00
|
|
|
Uncomment "VFIO_CUSTOM_IMAGE" in the script listed above to generate the custom image used for the VFIO worker.
|