This section provides an overview of how the elemental3 command-line interface enables users to customize and extend an image that is based on a specific set of components defined in a release manifest.
For general information about the customization process, refer to the Customization Process section.
For information on how to boot a customized image, refer to the Booting a customized image section.
For real-life examples, refer to the deployment scenario examples in the Cookbook documentation.
The customization process is executed through the elemental3 customize command.
As part of the command, users are expected to provide:
elemental3 customize -h.Please familiarize yourself with both points before attempting to customize your first image.
For further understanding of the customization process, you can also refer to the following sections:
Currently, the image customization process has the following limitations:
x86_64 platforms.Elemental is in active development, and these limitations will be addressed as part of the product roadmap.
NOTE: The user is able to customize Linux-only images by excluding Kubernetes resources and deployments from the configuration directory (regardless of whether this is under
kubernetes/manifests,kubernetes/cluster.yamlorrelease.yaml). This is currently an implicit process, but it is possible that an explicit option for it (e.g. a flag) is added at a later stage.
This section provides a high-level overview of the steps that Elemental’s tooling goes through in order to produce a customized and extended image.
Steps:
release.yaml file of the configuration directory.core platform release manifest.
Starting the customization process can be done either by directly working with the elemental3 binary, or by using the elemental3 container image. Below you can find the minimum set of options for running both use cases.
sudo elemental3 customize --type <raw/iso> --config-dir <path>
IMPORTANT: The above process is long running, as it involves pulling multiple component images over the network. For a quicker execution, use locally pulled container images in combination with the
--localflag.
Unless configured otherwise, after execution, the resulting ready-to-boot image will reside in the configuration directory path and use the image-<timestamp>.<image-type> naming format.
NOTE: You can specify another path for the output using the
--output (-o)option, however, be mindful if running Elemental 3 from a container, as it would require including the mounted configuration directory as a prefix (e.g. –output /config/).
NOTE: This section assumes you have pulled the
elemental3container image and referenced it in theELEMENTAL_IMAGEvariable.
Run the customization process:
podman run -it -v <PATH_TO_CONFIG_DIR>:/config $ELEMENTAL_IMAGE customize --type raw
podman run -it -v <PATH_TO_CONFIG_DIR>:/config $ELEMENTAL_IMAGE customize --type iso
IMPORTANT: The above process is long running, as it involves pulling multiple component images over the network. For a quicker execution, use locally pulled container images in combination with mounting the podman socket to the
elemental3container image and specifying the--localflag:
- Start Podman socket:
systemctl enable --now podman.socket- Run the
elemental3container with the mounted podman socket:podman run -it -v <PATH_TO_CONFIG_DIR>:/config -v /run/podman/podman.sock:/var/run/docker.sock $ELEMENTAL_IMAGE customize --type <raw/iso> --local
Unless configured otherwise, the above process will produce a customized RAW or ISO image under the specified <PATH_TO_CONFIG_DIR> directory.
NOTE: The below RAM and vCPU resources are just reference values, feel free to tweak them based on what your environment needs.
The customized image can be booted as any other regular image. Below you can find an example of how this can be done by using Libvirt to setup a virtual machine from a customized image that has a static network configured for machines with the FE:C4:05:42:8B:01 MAC address.
RAW disk image:
virt-install --name customized-raw \
--ram 16000 \
--vcpus 10 \
--disk path="<customized-image-path>",format=raw \
--osinfo detect=on,name=sle-unknown \
--graphics none \
--console pty,target_type=serial \
--network network=default,model=virtio,mac=FE:C4:05:42:8B:01 \
--virt-type kvm \
--import \
--boot uefi
ISO media:
Create an empty disk.img disk image that will be used as a storage device:
truncate -s 20G disk.img
Boot a VM using the previously created resources, namely the customized.iso, disk.img and local EFI store:
virt-install --name customized-iso \
--ram 16000 \
--vcpus 10 \
--import \
--disk path=disk.img,format=raw \
--cdrom "customized.iso" \
--boot uefi \
--graphics none \
--console pty,target_type=serial \
--network network=default,model=virtio,mac=FE:C4:05:42:8B:01 \
--osinfo detect=on,name=sle-unknown \
--virt-type kvm