xref: /cloud-hypervisor/docs/custom-image.md (revision 337cbf3d339f9d4258ff50713565cd946b6f3c0b)
1# How to create a custom Ubuntu image
2
3In the context of adding more utilities to the Ubuntu cloud image being used
4for integration testing, this quick guide details how to achieve the proper
5modification of an official Ubuntu cloud image.
6
7## Image generation script
8
9This [script](../scripts/build-custom-image.sh) can be used to generate a custom image (needs to be modified per architecture/distribution image)
10
11## Switch CI to use the new image
12
13### Upload to Azure storage
14
15A command like the following can be used to upload the image:
16
17`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>`
18
19### Update integration tests
20
21Last step is about updating the integration tests to work with this new image.
22The key point is to identify where the Linux filesystem partition is located,
23as we might need to update the direct kernel boot command line, replacing
24`/dev/vda1` with the appropriate partition number.
25
26Update all references to the previous image name to the new one.
27
28## NVIDIA image for VFIO bare-metal CI
29
30Uncomment "VFIO_CUSTOM_IMAGE" in the script listed above to generate the custom image used for the VFIO worker.