Adding Image Sources
An image source records where a virtual machine image is stored — a container registry, an HTTP server or an S3 bucket — and which projects may use it. It is a platform resource (VirtualMachineImageTemplate), shared by all clusters. Virtual machines can import their system disk straight from an image source, or an administrator can import it once into a cluster as an image instance, from which virtual machines are cloned.
The platform supports X86_64 and ARM64 (Alpha) images.
Procedure
-
Access Administrator.
-
In the left navigation bar, click Virtualization > Images > Image Source.
-
Click Add Image Source.
-
Refer to the instructions below to configure the relevant parameters.
-
Click Add.
Note:
- An image server whose HTTPS certificate is self-signed or issued by a private CA cannot be used directly from an image source: CDI needs the CA certificate, which only an image instance carries. Add an image instance from the image source with its CA Certificate, and create virtual machines from the image instance. When you choose such an image source in the Create Virtual Machine form, the form reminds you of this.
- An image source that requires authentication, or an S3 image source, can be imported as an image instance only in a namespace, where the credential Secret lives; see Image Instances in a Namespace.
Default specification
An image source can declare the instance type and preference virtual machines created from the image should use, with the four instancetype.kubevirt.io/default-* labels. An image source is shared by all clusters while instance types and preferences belong to a cluster, so the console does not offer these settings: declare them in YAML, and use only names that exist on every cluster where the image is used. Editing an image source in the console keeps these labels.
The image sources supplied with the platform declare the instance type u1.small, and on X86_64 the preference rhel.7 (CentOS 7) or ubuntu (Ubuntu 20.04).
The labels are used as follows:
- An image instance added from the image source carries them over.
- When you create a virtual machine from the image source, the instance type and preference are preselected in the Model area. A name that does not exist on the cluster is not preselected, and the form says so.
Using the API
Apply it on the global cluster: