xref: /cloud-hypervisor/docs/custom-image.md (revision 56ff396eef591e076e43c7b895c84d3edea8e123)
1b452e8beSSebastien Boeuf# How to create a custom Ubuntu image
2f5a44ea1SSebastien Boeuf
3b452e8beSSebastien BoeufIn the context of adding more utilities to the Ubuntu cloud image being used
4b452e8beSSebastien Boeuffor integration testing, this quick guide details how to achieve the proper
5b452e8beSSebastien Boeufmodification of an official Ubuntu cloud image.
6f5a44ea1SSebastien Boeuf
7d2d3ba4eSRob Bradford## Image generation script
8f5a44ea1SSebastien Boeuf
9*56ff396eSJonas ScholzThis [script](../scripts/build-custom-image.sh) can be used to generate a custom image (needs to be modified per architecture/distribution image)
10f5a44ea1SSebastien Boeuf
11f5a44ea1SSebastien Boeuf## Switch CI to use the new image
12f5a44ea1SSebastien Boeuf
13f5a44ea1SSebastien Boeuf### Upload to Azure storage
14f5a44ea1SSebastien Boeuf
15d2d3ba4eSRob BradfordA command like the following can be used to upload the image:
16d2d3ba4eSRob Bradford
17d2d3ba4eSRob Bradford`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>`
18f5a44ea1SSebastien Boeuf
19f5a44ea1SSebastien Boeuf### Update integration tests
20f5a44ea1SSebastien Boeuf
21f5a44ea1SSebastien BoeufLast step is about updating the integration tests to work with this new image.
22b452e8beSSebastien BoeufThe key point is to identify where the Linux filesystem partition is located,
23b452e8beSSebastien Boeufas we might need to update the direct kernel boot command line, replacing
24b452e8beSSebastien Boeuf`/dev/vda1` with the appropriate partition number.
2521ba3454SRob Bradford
2621ba3454SRob BradfordUpdate all references to the previous image name to the new one.
279f7ccb34SSebastien Boeuf
2842e9632cSJosh Soref## NVIDIA image for VFIO bare-metal CI
299f7ccb34SSebastien Boeuf
30d2d3ba4eSRob BradfordUncomment "VFIO_CUSTOM_IMAGE" in the script listed above to generate the custom image used for the VFIO worker.