About cookies on this site Our websites require some cookies to function properly (required). In addition, other cookies may be used with your consent to analyze site usage, improve the user experience and for advertising. For more information, please review your options. By visiting our website, you agree to our processing of information as described in IBM’sprivacy statement. To provide a smooth navigation, your cookie preferences will be shared across the IBM web domains listed here.
Tutorial
Creating OVA images for Red Hat OpenShift Container Platform on IBM Power Virtual Servers
Create and upload OVA files as boot images for RHEL and RHCOS
On this page
Introduction
A Red Hat® OpenShift® cluster in IBM® Power® Virtual Server requires two images:
- A Red Hat Enterprise Linux (RHEL) 9.4 or later image – This is used by the bastion node
- Red Hat Enterprise Linux CoreOS image – This is used on the OpenShift cluster nodes
This tutorial shows how to create OVA formatted images for both RHEL and Red Hat Enterprise Linux CoreOS, and upload them to IBM Cloud Object Storage. You can then import these images as boot images in your IBM Power Virtual Server service. Note that the image disk should be a minimum of 120 gB in size.
It should be noted that RHEL and CentOS Stream images are now available from the Power virtual server Image catalog. We recommend using one of these catalog images instead of building your own.
In addition, Red Hat Enterprise Linux CoreOS OVA images are now provided by Red Hat. For instructions on importing the appropriate pre-built Red Hat Enterprise Linux CoreOS image, refer to the blog, Import Pre-Built Red Hat Enterprise Linux CoreOS Images in to PowerVS. However, if you do need a customized image, either continue with this tutorial or follow the more scripted approach in the tutorial, Creating OVA images using a CentOS instance in IBM Power Systems Virtual Servers.
Prerequisites
Make sure that the following prerequisites are met before you begin creating the OVA images:
- Access to shell on an IBM Power® logical partition (LPAR) running RHEL 9.x or CentOS Stream 9 with internet connectivity and minimum 250 gB of free disk space. This LPAR should have package repositories configured. You can also provision a CentOS Stream 9 instance on Power Virtual server and use it for the steps described in this tutorial.
- RHEL subscription ID and password (not required if using CentOS).
- IBM Cloud API key.
Estimated time
It requires approximately 15-20 minutes for creating the OVA image and uploading them to IBM Cloud Object Storage. Another 15-20 minutes to import the OVA image to the Power Virtual Server instance.
Creating and uploading OVA files as boot images
Open a terminal on the IBM Power logical partition (LPAR) and perform the following steps to create and upload OVA files as boot images for RHEL and Red Hat Enterprise Linux CoreOS:
Install the following packages:
sudo dnf install -y qemu-img cloud-utils-growpartDownload the latest pvsadm helper tool from https://github.com/ppc64le-cloud/pvsadm/releases
sudo curl -sL https://github.com/ppc64le-cloud/pvsadm/releases/download/v0.1.15/pvsadm-linux-ppc64le -o /usr/local/bin/pvsadm sudo chmod +x /usr/local/bin/pvsadm pvsadm version pvsadm image –helpDownload the Qcow2 images.
Download the RHEL (or CentOS) and Red Hat Enterprise Linux CoreOS Qcow2 images.
Note:
- Although the RHEL image is named as KVM guest image, it works for both KVM and IBM PowerVM® systems.
- The pvsadm tool supports only official RHEL/CentOS cloud images and Red Hat Enterprise Linux CoreOS images.
Convert the Qcow2 image to OVA format.
Run the
pvsadmcommand in the given format:pvsadm image qcow2ova --image-name <image-name> --image-url <image-url> --image-dist <image-dist> --image-size <size-of-image> --rhn-user <rhel-user> --rhn-password <rhel-password> --os-password <os-password> --temp-dir <temp-directory>Examples:
pvsadm image qcow2ova --image-name rhel-94-09032024 --image-url ./rhel-9.4-ppc64le-kvm.qcow2.gz --image-dist rhel --image-size 11 --rhn-user john@example.com --rhn-password someValidPassword --os-password sOmeComplexpassword pvsadm image qcow2ova --image-name rhel-94-09032024 --image-url ./rhel-9.4-ppc64le-kvm.qcow2.gz --image-dist rhel --image-size 11 --rhn-user john@example.com --rhn-password someValidPassword –-skip-os-password pvsadm image qcow2ova --image-name centos-stream-9-09032024 --image-url ./CentOS-Stream-genericCloud-9-20240819.0.ppc64le.qcow2 --image-dist centos --image-size 11 --os-password sOmeComplexpassword pvsadm image qcow2ova --image-name rhcos-416-09032024 --image-url ./rhcos-4.16.0-ppc64le-openstack.ppc64le.qcow2.gz --image-dist coreos --image-size 16The following table describes the parameters used in the command to convert a Qcow2 image to the OVA format.
Parameter Description --image-nameName of the resultant image (required) --image-urlURL or absolute local file path to the .gz image (required) --image-distImage distribution (supported: rhel, centos, coreos) (required) --image-sizeSize (in gB) of the resultant OVA image (default 11) (optional) --target-disk-sizeSize (in gB) of the target disk volume where OVA will be copied (default 120) (optional) --rhn-userRed Hat subscription username. Required when image distribution is rhel --rhn-passwordRed Hat subscription password. Required when image distribution is rhel --os-passwordRoot user password. Will auto-generate the 12-bit password (applicable only for Red Hat and CentOS distributions) (optional) --skip-os-passwordSkip the root user password (optional) -t,--temp-dirScratch space to use for OVA generation (default "/tmp") (optional) For more options, run the following command:
pvsadm image qcow2ova –helpSample RHEL image output
I0903 08:02:03.921983 106190 qcow2ova.go:179] Autogenerated OS root password is updated in /root/image-build/password.txt I0903 08:02:03.922042 106190 validate.go:40] Checking: platform I0903 08:02:03.922049 106190 validate.go:40] Checking: user I0903 08:02:03.922055 106190 validate.go:40] Checking: image-name I0903 08:02:03.922066 106190 validate.go:40] Checking: tools I0903 08:02:03.922119 106190 tools.go:43] qemu-img found at /usr/bin/qemu-img I0903 08:02:03.922162 106190 tools.go:43] growpart found at /usr/bin/growpart I0903 08:02:03.922169 106190 validate.go:40] Checking: diskspace I0903 08:02:03.922182 106190 diskspace.go:50] free: 66g, need: 61g I0903 08:02:03.939681 106190 qcow2ova.go:252] Converting Qcow2(/tmp/qcow2ova1133581790/rhel-9.4-ppc64le-kvm.qcow2) image to raw(/tmp/qcow2ova1133581790/ova-img-dir/rhel-94-09032024-disk.raw) format I0903 08:02:16.729139 106190 qcow2ova.go:257] Conversion completed I0903 08:02:16.729181 106190 qcow2ova.go:259] Resizing the image /tmp/qcow2ova1133581790/ova-img-dir/rhel-94-09032024-disk.raw to 11g Image resized. I0903 08:02:17.231176 106190 qcow2ova.go:264] Resize completed I0903 08:02:17.231199 106190 qcow2ova.go:266] Preparing the image /dev/loop0 3 CHANgED: partition=3 start=2107392 old: size=18864128 end=20971519 new: size=20961247 end=23068638 xfs meta-data=/dev/loop0p3 isize=512 agcount=4, agsize=589504 blks = sectsz=512 attr=2, projid32bit=1 = crc=1 finobt=1, sparse=1, rmapbt=0 = reflink=1 bigtime=1 inobtcount=1 nrext64=0 data = bsize=4096 blocks=2358016, imaxpct=25 = sunit=0 swidth=0 blks naming =version 2 bsize=4096 ascii-ci=0, ftype=1 log =internal log bsize=4096 blocks=16384, version=2 = sectsz=512 sunit=0 blks, lazy-count=1 realtime =none extsz=4096 blocks=0, rtextents=0 data blocks changed from 2358016 to 2620155 /dev/loop0p2 mv: cannot stat '/etc/resolv.conf': No such file or directory nameserver 9.9.9.9 Registering to: subscription.rhsm.redhat.com:443/subscription The system has been registered with ID: fc108c9d-f1e0-47c8-b21f-e2f0acf2b5d7 [..snip..] Installed: DynamicRM-2.0.7-7.ppc64le devices.chrp.base.ServiceRM-3.3.2.1-24011.ppc64le ksh-3:1.0.6-3.el9.ppc64le perl-File-Copy-2.34-481.el9.noarch perl-autouse-1.11-481.el9.noarch perl-lib-0.65-481.el9.ppc64le perl-locale-1.09-481.el9.noarch rsct.basic-3.3.2.1-24011.ppc64le rsct.core-3.3.2.1-24011.ppc64le rsct.core.utils-3.3.2.1-24011.ppc64le rsct.opt.storagerm-3.3.2.1-24011.ppc64le src-3.3.2.1-24011.ppc64le Complete! [..snip..] Installed: device-mapper-multipath-0.8.7-27.el9.ppc64le device-mapper-multipath-libs-0.8.7-27.el9.ppc64le libaio-0.3.111-13.el9.ppc64le Complete! generating initramfs for kernel version: 5.14.0-427.13.1.el9_4.ppc64le generating initramfs for kernel version: 5.14.0-427.33.1.el9_4.ppc64le generating grub configuration file ... Adding boot menu entry for UEFI Firmware Settings ... done Unregistering from: subscription.rhsm.redhat.com:443/subscription System has been unregistered. All local data removed mv: cannot stat '/etc/resolv.conf.orig': No such file or directory I0903 08:09:19.071787 106190 qcow2ova.go:271] Preparation completed I0903 08:09:19.071827 106190 qcow2ova.go:273] Creating an OVA bundle I0903 08:09:46.614649 106190 qcow2ova.go:278] OVA bundle creation completed: /tmp/qcow2ova1133581790/rhel-94-09032024.ova I0903 08:09:46.614684 106190 qcow2ova.go:280] Compressing an OVA file I0903 08:10:22.030171 106190 qcow2ova.go:286] OVA file Compression completed Successfully converted Qcow2 image to OVA format, find at /root/image-build/rhel-94-09032024.ova.gz OS root password: sOmeComplexpasswordSample Red Hat Enterprise Linux CoreOS output
I0903 07:58:43.304035 106114 validate.go:40] Checking: platform I0903 07:58:43.304089 106114 validate.go:40] Checking: user I0903 07:58:43.304103 106114 validate.go:40] Checking: image-name I0903 07:58:43.304116 106114 validate.go:40] Checking: tools I0903 07:58:43.304160 106114 tools.go:43] qemu-img found at /usr/bin/qemu-img I0903 07:58:43.304196 106114 tools.go:43] growpart found at /usr/bin/growpart I0903 07:58:43.304208 106114 validate.go:40] Checking: diskspace I0903 07:58:43.304224 106114 diskspace.go:50] free: 67g, need: 66g I0903 07:59:02.524102 106114 qcow2ova.go:252] Converting Qcow2(/tmp/qcow2ova1278991043/disk.qcow2) image to raw(/tmp/qcow2ova1278991043/ova-img-dir/rhcos-416-09032024-disk.raw) format I0903 07:59:04.872828 106114 qcow2ova.go:257] Conversion completed I0903 07:59:04.872861 106114 qcow2ova.go:259] Resizing the image /tmp/qcow2ova1278991043/ova-img-dir/rhcos-416-09032024-disk.raw to 16g Image resized. I0903 07:59:09.752865 106114 qcow2ova.go:264] Resize completed I0903 07:59:09.752898 106114 qcow2ova.go:266] Preparing the image I0903 07:59:09.752916 106114 prepare.go:182] No image preparation required for the coreos. I0903 07:59:09.752936 106114 qcow2ova.go:271] Preparation completed I0903 07:59:09.752954 106114 qcow2ova.go:273] Creating an OVA bundle I0903 07:59:44.544617 106114 qcow2ova.go:278] OVA bundle creation completed: /tmp/qcow2ova1278991043/rhcos-416-09032024.ova I0903 07:59:44.544647 106114 qcow2ova.go:280] Compressing an OVA file I0903 08:00:43.548466 106114 qcow2ova.go:286] OVA file Compression completed Successfully converted Qcow2 image to OVA format, find at /root/image-build/rhcos-416-09032024.ova.gz OS root password:Upload the image to IBM Cloud Object Storage using the following command.
export IBMCLOUD_API_KEY=<IBM_CLOUD_API_KEY> pvsadm image upload --bucket <bucket-name> --file <image-name>.ova.gz --cos-instance-name <cos-instance-name>Example:
pvsadm image upload --bucket ocp4-images-bucket --file rhel-94-09032024.ova.gz --cos-instance-name ocp4-on-powerWhere:
Parameter Description -b,--bucketName of the Cloud Object Storage instance bucket (required) -f,--fileThe path to the file that needs to be uploaded (required) -o,--cos-object-nameName of the Cloud Object Storage object (Default: filename from --file|-f option) (optional) -n,--cos-instance-nameName of the Cloud Object Storage instance to be used (required if not using region) -r,--bucket-regionCloud Object Storage bucket region. (default "us-south") (required if not using instance-name`)For more options, run the following command:
pvsadm image upload –helpSample output when uploading RHEL OVA image
pvsadm image upload --bucket ocp4-images-bucket --file rhel-94-09032024.ova.gz --cos-instance-name ocp4-on-power I0809 06:10:00.174921 61654 upload.go:152] Found bucket ocp4-images-bucket in the ocp4-on-power instance E0809 06:10:01.986844 61654 s3client.go:190] object rhel-94-09032024.ova.gz not found in ocp4-images-bucket bucket I0809 06:10:01.986881 61654 s3client.go:269] uploading the file rhel-94-09032024.ova.gz Uploading: Total read(bytes):1076564776 progress:100% I0809 08:09:12.779203 61654 s3client.go:306] Upload completed successfully in 60.074163 seconds to location https://s3.us-south.cloud-object-storage.appdomain.cloud/ocp4-images-bucket/rhel-94-09032024.ova.gzSample output when uploading Red Hat Enterprise Linux CoreOS OVA image
pvsadm image upload --bucket ocp4-images-bucket --file rhcos-416-09032024.ova.gz --bucket-region us-south I0906 05:02:57.574755 158269 upload.go:152] Found bucket ocp4-images-bucket in the ocp4-on-power instance E0906 05:02:59.109159 158269 s3client.go:190] object rhcos-416-09032024.ova.gz not found in ocp4-images-bucket bucket I0906 05:02:59.109172 158269 s3client.go:269] uploading the file rhcos-416-09032024.ova.gz Uploading: Total read(bytes):2710002034 progress:100% I0906 05:04:14.336598 158269 s3client.go:306] Upload completed successfully in 75.227130 seconds to location https://s3.us-south.cloud-object-storage.appdomain.cloud/ocp4-images-bucket/rhcos-416-09032024.ova.gzImport the image into the Power Virtual Server instances.
As a best practice please name the image using the following pattern
<distro>-<xy>-<timestamp>, where distro is eitherrhel,centosorrhcosandxyis the release version such as94(for 9.4),416(for 4.16) and timestamp is of the format -ddmmyyyyormmddyyyy. Take a look at the values of thepvs-image-name argumentin the examples below for concrete examples.Run the following command:
export IBMCLOUD_API_KEY=<IBM_CLOUD_API_KEY> pvsadm image import --workspace-name <instance-name> --bucket <bucket-name> --object <object-name> --pvs-image-name <image-name> --bucket-region <region>Example:
pvsadm image import --workspace-name rdr-ocp-cicd-toronto01 -b ocp4-images-bucket --object rhel-94-09032024.ova.gz --pvs-image-name rhel-94-09032024 --bucket-region us-south pvsadm image import --workspace-name rdr-ocp-cicd-toronto01 -b ocp4-images-bucket --object rhcos-416-09032024.ova.gz --pvs-image-name rhcos-416-09032024 --bucket-region us-southWhere:
Parameter Description -n,--workspace-nameName of the Power Virtual Server instance (required) --pvs-image-nameName of the Power Virtual Server imported image (required) --objectCloud storage image file name(required) -b,--bucketCloud storage bucket name (required) -r,--bucket-regionCloud storage bucket region (required) For more options, run the following command:
pvsadm image import –helpSample output
pvsadm image import --workspace-name rdr-ocp-cicd-toronto01 -b ocp4-images-bucket --object rhel-94-09032024.ova.gz --pvs-image-name rhel-94-09032024 --bucket-region us-south I0906 05:55:38.223239 159478 import.go:187] Importing image rhel-94-09032024. Please wait... I0906 05:57:50.201147 159478 import.go:206] Image import is in-progress, current state: running I0906 05:59:49.993668 159478 import.go:206] Image import is in-progress, current state: running I0906 06:01:49.983638 159478 import.go:206] Image import is in-progress, current state: running I0906 06:03:50.269742 159478 import.go:206] Image import is in-progress, current state: running I0906 06:05:49.954124 159478 import.go:200] Image imported successfully, took 10m3.304806294s I0906 06:05:52.005719 159478 import.go:224] Image import for rhel-94-09032024 is currently in active state, Please check the progress in the IBM cloud UINote: You can check the progress of the imported image in the IBM Cloud UI.
Summary
In this tutorial, we have successfully created the RHEL and Red Hat Enterprise Linux CoreOS OVA image from the respective Qcow2 images, uploaded the images to the Cloud Object Storage instance, and imported the images in IBM Power Virtual Server. You are now all set for deploying OpenShift.