Dieser Inhalt ist in der von Ihnen ausgewählten Sprache nicht verfügbar.
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.
17.1. Creating and automatically uploading customized RHEL VMDK images by using image builder Link kopierenLink in die Zwischenablage kopiert!
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
-
In the RHEL image builder dashboard, click the
Blueprinttab. - On the blueprint table, find the blueprint you want to build an image.
- On the right side of the chosen blueprint, click Create Image. The Create image dialog wizard opens.
On the Image output page, complete the following steps:
- From the Select a blueprint list, select the image type you want.
- From the Image output type list, select the image output type you want.
- Optional: Check Upload to VMware checkbox to upload the image directly to VMware.
- Enter a size for the image.
- Click Next.
On the Upload to VMware page, enter the following information:
- Image name: Enter the image name.
- Host: Enter the VMware vSphere instance URL where you want to upload the image file.
- Cluster: Enter the cluster name page where you want to upload the image.
- Datacenter: The data center name where you want to upload the image.
- Datastore: The data store name where you want to upload the image.
- Folder: Folder name where you want to upload the image.
- Click Next.
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.
17.2. Uploading VMDK images and creating a RHEL virtual machine in vSphere Link kopierenLink in die Zwischenablage kopiert!
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.
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
.ovaor the.vmdkformat by using RHEL image builder and downloaded it to your host system. -
You installed and configured the
govcCLI tool to be able to use theimport.vmdkcommand.
Procedure
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- Navigate to the directory where you downloaded your VMware vSphere image.
Launch the VMware vSphere image on vSphere by following the steps:
Import the VMware vSphere image into vSphere:
$ govc import.vmdk ./api.vmdk <folder-name>For the
.ovaformat:$ govc import.ova ./api.ova <folder-name>
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 \ vmnameFor the
.ovaformat, replace the line-firmware=efi -disk="folder_name/api.vmdk”with-firmware=efi -disk=”<folder-name>/api.ova”Power-on the VM:
$ govc vm.power -on <vm-name>Retrieve the VM IP address:
$ govc vm.ip <vm-name>Use SSH to log in to the VM, using the username and password you specified in your blueprint:
$ ssh admin@ <vm-ip-address>NoteUsing images copied with the
govc datastore.uploadcommand is not supported. The vSphere GUI does not supportimport.vmdkcommand or direct, so.vmdkimages are not usable from the vSphere GUI.
17.3. Creating and automatically uploading VMDK images to vSphere using image builder GUI Link kopierenLink in die Zwischenablage kopiert!
You can build VMware images by using the RHEL image builder Graphical User Interface (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 and search for the image in the Cluster.
-
Select the image, open its menu, and click
New Virtual Machine. In the New Virtual Machine window, configure the following details:
-
Select
New Virtual Machine, and specify a name and a folder for your VM. -
Select a computer resource and storage. For example, select
NFS-Node1. -
Select compatibility,
BIOSonly, a guest operating system. For example,LinuxandRed Hat Fedora (64-bit). -
In Customize hardware, delete the default New Hard Disk and select an
Existing Hard Diskdisk image:
-
Select
- Review the configuration and click Finish.
- Navigate to the VMs tab, select the VM, and click Start.
- Log in with the credentials you created in the blueprint.
Optional: Verify that the packages you added to the blueprint are installed. For example:
$ rpm -qa | grep firefox