Chapter 17. Preparing and uploading VMDK custom images to vSphere


You can create custom images and update them, either manually or automatically, to the VMware vSphere cloud by using RHEL image builder.

With RHEL image builder, you can create customized system images in the Open Virtualization Format (OVA), and automatically upload these images to the VMware vSphere client.

The OVA (.ova) is a .vmdk image with additional metadata about the virtual hardware, which contains a minimal template to make it easier to import images into vSphere. The .ovf (Open Virtualization Format) package is part of the vSphere .ova image. After RHEL image builder finishes importing the .ova image in the vSphere client, you can configure it with any additional hardware, such as network, disks, and CD-ROMs.

You can import the Open virtualization format (.ova) image by using either the vSphere GUI or the govc client. To upload the image by using the govc client, see Uploading VMDK images and creating a RHEL virtual machine in vSphere.

Prerequisites

  • You opened the RHEL image builder app from the web console in a browser.
  • You created a blueprint.

Procedure

  1. In the RHEL image builder dashboard, click the Blueprint tab.
  2. On the blueprint table, find the blueprint you want to build an image.
  3. On the right side of the chosen blueprint, click Create Image. The Create image dialog wizard opens.
  4. On the Image output page, complete the following steps:

    1. From the Select a blueprint list, select the image type you want.
    2. From the Image output type list, select the image output type you want.
    3. Optional: Check Upload to VMware checkbox to upload the image directly to VMware.
    4. Enter a size for the image.
    5. Click Next.
  5. On the Upload to VMware page, enter the following information:

    1. Image name: Enter the image name.
    2. Host: Enter the VMware vSphere instance URL where the image file will be uploaded.
    3. Cluster: Enter the cluster name page to which the image will be uploaded.
    4. Datacenter: The data center name to which the image will be uploaded.
    5. Datastore: The data store name to which the image will be uploaded.
    6. Folder: Folder name to which the image will be uploaded.
    7. Click Next.
  6. On the Review page, review the details about the image creation and click Create.

    The image creation starts, showing the progress of this image creation and the subsequent upload to the VMware vSphere client.

With RHEL image builder, you can create customized VMware vSphere system images, either in the Open virtualization Format (.ova) or in the Virtual Disk (.vmdk) format.

You can upload customized images to the VMware vSphere client. You can upload the .vmdk or .ova image to VMware vSphere using the govc import.vmdk CLI tool. The vmdk you create contains the cloud-init package installed, and you can use it to provision users by using user data, for example.

Note

Uploading vmdk images by using the VMware vSphere GUI is not supported.

Prerequisites

  • You created a blueprint with username and password customizations.
  • You created a VMware vSphere image either in the .ova or the .vmdk format by using RHEL image builder and downloaded it to your host system.
  • You installed and configured the govc CLI tool to be able to use the import.vmdk command.

Procedure

  1. Configure the following values in the user environment with the GOVC environment variables:

    GOVC_URL
    GOVC_DATACENTER
    GOVC_FOLDER
    GOVC_DATASTORE
    GOVC_RESOURCE_POOL
    GOVC_NETWORK
    Copy to Clipboard Toggle word wrap
  2. Navigate to the directory where you downloaded your VMware vSphere image.
  3. Launch the VMware vSphere image on vSphere by following the steps:

    1. Import the VMware vSphere image into vSphere:

      $ govc import.vmdk ./api.vmdk <folder-name>
      Copy to Clipboard Toggle word wrap
      • For the .ova format:

        $ govc import.ova ./api.ova <folder-name>
        Copy to Clipboard Toggle word wrap
    2. Create the VM in vSphere without powering it on:

      govc vm.create \
      -net.adapter=vmxnet3 \
      -m=4096 -c=2 -g=rhel8_64Guest \
      -firmware=efi -disk="<folder-name>/api.vmdk” \
      -disk.controller=scsi -on=false \
       vmname
      Copy to Clipboard Toggle word wrap

      For the .ova format, replace the line -firmware=efi -disk="folder_name/api.vmdk” with -firmware=efi -disk=”<folder-name>/api.ova”

    3. Power-on the VM:

      $ govc vm.power -on <vm-name>
      Copy to Clipboard Toggle word wrap
    4. Retrieve the VM IP address:

      $ govc vm.ip <vm-name>
      Copy to Clipboard Toggle word wrap
    5. Use SSH to log in to the VM, using the username and password you specified in your blueprint:

      $ ssh admin@ <vm-ip-address>
      Copy to Clipboard Toggle word wrap
      Note

      If you copied the .vmdk image from your local host to the destination using the govc datastore.upload command, using the resulting image is not supported. There is no option to use the import.vmdk command in the vSphere GUI and as a result, the vSphere GUI does not support the direct upload. The .vmdk image is not usable from the vSphere GUI.

You can build VMware images by using the RHEL image builder GUI tool and automatically push the images directly to your vSphere instance. This avoids the need to download the image file and push it manually.

The vmdk that you create contains the cloud-init package installed, and you can use it to provision users by using user data, for example. To build .vmdk images by using RHEL image builder and push them directly to the vSphere instances service provider, follow the steps:

Prerequisites

  • You are a member of the root or the weldr group.
  • You have opened RHEL image builder in a browser.
  • You have created a blueprint.
  • You have a vSphere Account.

Procedure

  1. For the blueprint you created, click the Images tab .
  2. Click Create Image to create your customized image.

    The Image type window opens.

  3. In the Image type window:

    1. From the dropdown menu, select the Type: VMware vSphere (.vmdk).
    2. Check the Upload to VMware checkbox to upload your image to vSphere.
    3. Optional: Set the size of the image you want to instantiate. The minimal default size is 2 GB.
    4. Click Next.
  4. In the Upload to VMware window, under Authentication, enter the following details:

    1. Username: username of the vSphere account.
    2. Password: password of the vSphere account.
  5. In the Upload to VMware window, under Destination, enter the following details about the image upload destination:

    1. Image name: a name for the image.
    2. Host: The URL of your VMware vSphere.
    3. Cluster: The name of the cluster.
    4. Data center: The name of the data center.
    5. Data store: The name of the Data store.
    6. Click Next.
  6. In the Review window, review the details of the image creation and click Finish.

    You can click Back to modify any incorrect details.

    RHEL image builder adds the compose of a RHEL vSphere image to the queue, and creates and uploads the image to the Cluster on the vSphere instance you specified.

    After the process is complete, you can see the Image build complete status.

Verification

  1. Create a Virtual Machine (VM) from the image you uploaded and log in to it.
  2. Access VMware vSphere Client.
  3. Search for the image in the Cluster on the vSphere instance you specified.
  4. Select the image you uploaded.
  5. Right-click the selected image.
  6. Click New Virtual Machine.

    A New Virtual Machine window opens.

    In the New Virtual Machine window, provide the following details:

    1. Select New Virtual Machine.
    2. Select a name and a folder for your VM.
    3. Select a computer resource: choose a destination computer resource for this operation.
    4. Select storage: For example, select NFS-Node1
    5. Select compatibility: The image should be BIOS only.
    6. Select a guest operating system: For example, select Linux and Red Hat Fedora (64-bit).
    7. Customize hardware: When creating a VM, on the Device Configuration button on the upper right, delete the default New Hard Disk and use the drop-down to select an Existing Hard Disk disk image:
    8. Ready to complete: Review the details and click Finish to create the image.
  7. Navigate to the VMs tab.

    1. From the list, select the VM you created.
    2. Click the Start button on the panel. A new window appears, showing the VM image loading.
    3. Log in with the credentials you created for the blueprint.
    4. You can verify if the packages you added to the blueprint are installed. For example:

      $ rpm -qa | grep firefox
      Copy to Clipboard Toggle word wrap
Red Hat logoGithubredditYoutubeTwitter

Learn

Try, buy, & sell

Communities

About Red Hat Documentation

We help Red Hat users innovate and achieve their goals with our products and services with content they can trust. Explore our recent updates.

Making open source more inclusive

Red Hat is committed to replacing problematic language in our code, documentation, and web properties. For more details, see the Red Hat Blog.

About Red Hat

We deliver hardened solutions that make it easier for enterprises to work across platforms and environments, from the core datacenter to the network edge.

Theme

© 2026 Red Hat
Back to top