17.3. Creating and automatically uploading VMDK images to vSphere using image builder 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
rootor theweldrgroup. - You have opened RHEL image builder in a browser.
- You have created a blueprint.
- You have a vSphere Account.
Procedure
- For the blueprint you created, click the Images tab .
Click Create Image to create your customized image.
The Image type window opens.
In the Image type window:
-
From the dropdown menu, select the Type: VMware vSphere (
.vmdk). - Check the Upload to VMware checkbox to upload your image to vSphere.
- Optional: Set the size of the image you want to instantiate. The minimal default size is 2 GB.
- Click Next.
-
From the dropdown menu, select the Type: VMware vSphere (
In the Upload to VMware window, under Authentication, enter the following details:
- Username: username of the vSphere account.
- Password: password of the vSphere account.
In the Upload to VMware window, under Destination, enter the following details about the image upload destination:
- Image name: a name for the image.
- Host: The URL of your VMware vSphere.
- Cluster: The name of the cluster.
- Data center: The name of the data center.
- Data store: The name of the Data store.
- Click Next.
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
- Create a Virtual Machine (VM) from the image you uploaded and log in to it.
- Access VMware vSphere Client.
- Search for the image in the Cluster on the vSphere instance you specified.
- Select the image you uploaded.
- Right-click the selected image.
Click
New Virtual Machine.A New Virtual Machine window opens.
In the New Virtual Machine window, provide the following details:
-
Select
New Virtual Machine. - Select a name and a folder for your VM.
- Select a computer resource: choose a destination computer resource for this operation.
- Select storage: For example, select NFS-Node1
-
Select compatibility: The image should be
BIOSonly. -
Select a guest operating system: For example, select
LinuxandRed Hat Fedora (64-bit). - 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:
- Ready to complete: Review the details and click Finish to create the image.
-
Select
Navigate to the VMs tab.
- From the list, select the VM you created.
- Click the Start button on the panel. A new window appears, showing the VM image loading.
- Log in with the credentials you created for the blueprint.
You can verify if the packages you added to the blueprint are installed. For example:
$ rpm -qa | grep firefox