Chapter 9. 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. 9.1. Creating a blueprint with the Ignition configuration 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: Procedure Create a blueprint in the Tom's Obvious, Minimal Language (TOML) format, with the following content: Where: The name is the name and description is the description for your blueprint. The version is the version number according to the Semantic Versioning scheme. The modules and packages describe the package name and matching version glob to be installed into the image. For example, the package name = "open-vm-tools" . Notice that currently there are no differences between packages and modules. The groups are packages groups to be installed into the image. For example groups = "anaconda-tools" group package. If you do not know the modules and groups, leave them empty. The customizations.user creates a username and password to log in to the VM. The customizations.ignition.firstboot contains the URL where the Ignition configuration file is being served. Note By default, the open-vm-tools package is not included in the edge-vsphere image. If you need this package, you must include it in the blueprint customization. Import the blueprint to the image builder server: List the existing blueprints to check whether the created blueprint is successfully pushed and exists: Check whether the components and versions listed in the blueprint and their dependencies are valid: steps Use the blueprint you created to build your .vmdk image. 9.2. Creating a VMDK image for RHEL for Edge 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 .vmdk image. 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 .vmdk image: 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: The output displays the status in the following format: After the compose process finishes, download the resulting image file: steps Upload the .vmdk image to vSphere. 9.3. Uploading VMDK images and creating a RHEL virtual machine in vSphere 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 .vmdk image by using RHEL image builder and downloaded it to your host system. You installed the govc import.vmdk CLI tool. You configured the govc import.vmdk CLI tool client. You must set the following values in the environment: Procedure Navigate to the directory where you downloaded your .vmdk image. Launch the image on vSphere by executing the following steps: Import the .vmdk image in to vSphere: Create the VM in vSphere without powering it on: Power-on the VM: Retrieve the VM IP address: Use SSH to log in to the VM, using the username and password you specified in your blueprint:

Commands:
{ "ignition":{ "version":"3.3.0" }, "passwd":{ "users":[ { "groups":[ "wheel" ], "name":"core", "passwordHash":"USD6USDjfuNnO9t1Bv7N" } ] } }
name = "vmdk-image" description = "Blueprint with Ignition for the vmdk image" version = "0.0.1" packages = ["open-vm-tools"] modules = [] groups = [] distro = "" [[customizations.user]] name = "admin" password = "admin" groups = ["wheel"] [customizations.ignition.firstboot] url = http:// <IP_address> :8080/ config.ig
composer-cli blueprints push <blueprint-name> .toml
composer-cli blueprints show <blueprint-name>
composer-cli blueprints depsolve <blueprint-name>
composer-cli compose start start-ostree <blueprint-name> edge-vsphere -- <url>
composer-cli compose status
<UUID> RUNNING date <blueprint-name> <blueprint-version> edge-vsphere
composer-cli compose image <UUID>
GOVC_URL GOVC_DATACENTER GOVC_FOLDER GOVC_DATASTORE GOVC_RESOURCE_POOL GOVC_NETWORK
govc import.vmdk ./composer-api.vmdk foldername
govc vm.create -net="VM Network" -net.adapter=vmxnet3 -disk.controller=pvscsi -on=false -m=4096 -c=2 -g=rhel9_64Guest -firmware=efi vm_name govc vm.disk.attach -disk=" foldername /composer-api.vmdk" govc vm.power -on -vm vm_name -link=false vm_name
govc vm.power -on vmname
HOST=USD(govc vm.ip vmname )
ssh admin@HOST