Chapter 11. Creating VMDK images for RHEL for Edge
You can create a .vmdk image for RHEL for Edge by using the RHEL image builder. You can create an edge-vsphere image type with Ignition support, to inject the user configuration into the image at an early stage of the boot process. Then, you can load the image on vSphere and boot the image in a vSphere VM. The image is compatible with ESXi 7.0 U2, ESXi 8.0 and later. The vSphere VM is compatible with version 19 and 20.
11.1. Creating a blueprint with the Ignition configuration Copy linkLink copied to clipboard!
Create a blueprint for the .vmdk image and customize it with the customizations.ignition section. With that, you can create your image and, at boot time, the operating system will inject the user configuration to the image.
Prerequisites
You have created an Ignition configuration file. For example:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
Create a blueprint in the Tom’s Obvious, Minimal Language (TOML) format, with the following content:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Where:
-
The
nameis the name anddescriptionis the description for your blueprint. -
The
versionis the version number according to the Semantic Versioning scheme. -
The
modulesandpackagesdescribe the package name and matching version glob to be installed into the image. For example, the packagename = "open-vm-tools". Notice that currently there are no differences between packages and modules. -
The
groupsare packages groups to be installed into the image. For examplegroups = "anaconda-tools"group package. If you do not know the modules and groups, leave them empty. -
The
customizations.usercreates a username and password to log in to the VM. The
customizations.ignition.firstbootcontains the URL where the Ignition configuration file is being served.NoteBy default, the
open-vm-toolspackage is not included in theedge-vsphereimage. If you need this package, you must include it in the blueprint customization.
-
The
Import the blueprint to the image builder server:
composer-cli blueprints push <blueprint-name>.toml
# composer-cli blueprints push <blueprint-name>.tomlCopy to Clipboard Copied! Toggle word wrap Toggle overflow List the existing blueprints to check whether the created blueprint is successfully pushed and exists:
composer-cli blueprints show <blueprint-name>
# composer-cli blueprints show <blueprint-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow Check whether the components and versions listed in the blueprint and their dependencies are valid:
composer-cli blueprints depsolve <blueprint-name>
# composer-cli blueprints depsolve <blueprint-name>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
11.2. Creating a VMDK image for RHEL for Edge Copy linkLink copied to clipboard!
To create a RHEL for Edge .vmdk image, use the 'edge-vsphere' image type in the RHEL image builder command-line interface.
Prerequisites
-
You created a blueprint for the
.vmdkimage. -
You served an OSTree repository of the commit to embed it in the image. For example,
http://10.0.2.2:8080/repo. For more details, see Setting up a web server to install RHEL for Edge image.
Procedure
Start the compose of a
.vmdkimage:composer-cli compose start start-ostree <blueprint-name> edge-vsphere --<url>
# composer-cli compose start start-ostree <blueprint-name> edge-vsphere --<url>Copy to Clipboard Copied! Toggle word wrap Toggle overflow The --<url> is the URL of your repo, for example:
http://10.88.0.1:8080/repo.A confirmation that the composer process has been added to the queue appears. It also shows a Universally Unique Identifier (UUID) number for the image created. Use the UUID number to track your build. Also, keep the UUID number handy for further tasks.
Check the image compose status:
composer-cli compose status
# composer-cli compose statusCopy to Clipboard Copied! Toggle word wrap Toggle overflow The output displays the status in the following format:
<UUID> RUNNING date <blueprint-name> <blueprint-version> edge-vsphere
$ <UUID> RUNNING date <blueprint-name> <blueprint-version> edge-vsphereCopy to Clipboard Copied! Toggle word wrap Toggle overflow After the compose process finishes, download the resulting image file:
composer-cli compose image <UUID>
# composer-cli compose image <UUID>Copy to Clipboard Copied! Toggle word wrap Toggle overflow
11.3. Uploading VMDK images and creating a RHEL virtual machine in vSphere Copy linkLink copied to clipboard!
Upload the .vmdk image to VMware vSphere by using the govc import.vmdk CLI tool and boot the image in a VM.
Prerequisites
-
You created an
.vmdkimage by using RHEL image builder and downloaded it to your host system. -
You installed the
govc import.vmdkCLI tool. You configured the
govc import.vmdkCLI tool client.You must set the following values in the environment:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow
Procedure
-
Navigate to the directory where you downloaded your
.vmdkimage. Launch the image on vSphere by executing the following steps:
Import the
.vmdkimage in to vSphere:govc import.vmdk ./composer-api.vmdk foldername
$ govc import.vmdk ./composer-api.vmdk foldernameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Create the VM in vSphere without powering it on:
Copy to Clipboard Copied! Toggle word wrap Toggle overflow Power-on the VM:
govc vm.power -on vmname
govc vm.power -on vmnameCopy to Clipboard Copied! Toggle word wrap Toggle overflow Retrieve the VM IP address:
HOST=$(govc vm.ip vmname)
HOST=$(govc vm.ip vmname)Copy to Clipboard Copied! Toggle word wrap Toggle overflow Use SSH to log in to the VM, using the username and password you specified in your blueprint:
ssh admin@HOST
$ ssh admin@HOSTCopy to Clipboard Copied! Toggle word wrap Toggle overflow