Este conteúdo não está disponível no idioma selecionado.
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:
{ "ignition":{ "version":"3.3.0" }, "passwd":{ "users":[ { "groups":[ "wheel" ], "name":"core", "passwordHash":"$6$jfuNnO9t1Bv7N" } ] } }
Procedure
Create a blueprint in the Tom’s Obvious, Minimal Language (TOML) format, with the following content:
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
Where:
-
The
name
is the name anddescription
is the description for your blueprint. -
The
version
is the version number according to the Semantic Versioning scheme. -
The
modules
andpackages
describe 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
groups
are 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.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.NoteBy default, the
open-vm-tools
package is not included in theedge-vsphere
image. 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
List the existing blueprints to check whether the created blueprint is successfully pushed and exists:
# composer-cli blueprints show <blueprint-name>
Check whether the components and versions listed in the blueprint and their dependencies are valid:
# composer-cli blueprints depsolve <blueprint-name>
Next 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:# composer-cli compose start start-ostree <blueprint-name> edge-vsphere --<url>
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
The output displays the status in the following format:
$ <UUID> RUNNING date <blueprint-name> <blueprint-version> edge-vsphere
After the compose process finishes, download the resulting image file:
# composer-cli compose image <UUID>
Next 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:
GOVC_URL GOVC_DATACENTER GOVC_FOLDER GOVC_DATASTORE GOVC_RESOURCE_POOL GOVC_NETWORK
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:$ govc import.vmdk ./composer-api.vmdk foldername
Create the VM in vSphere without powering it on:
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
Power-on the VM:
govc vm.power -on vmname
Retrieve the VM IP address:
HOST=$(govc vm.ip vmname)
Use SSH to log in to the VM, using the username and password you specified in your blueprint:
$ ssh admin@HOST