Introduction
Depending on your environment you can follow one of the options to create RHCOS (CoreOS) image in PowerVC
Option-1
- Download the RHCOS image from the following link on a system with public internet access. You'll need a way to transfer this image to a RHEL VM that you'll create in the next step.
- Login to PowerVC and create a RHEL 8.x VM having an additional empty volume with minimum size of 120G. Please make a note of the new volume name.
- Login to the VM and execute the following steps
- Install
wget
,qemu-img
,parted
andgzip
packages - Transfer the downloaded RHCOS image to this VM
- Extract the image
$ gunzip rhcos-openstack.ppc64le.qcow2.gz
- Convert the CoreOS qcow2 image to raw image
$ qemu-img convert -f qcow2 -O raw rhcos-openstack.ppc64le.qcow2 rhcos-latest.raw
- Identify the disk device representing the additional empty volume attached to the VM
$ disk_device_list=$(sudo parted -l 2>&1 | grep -E -v "$readonly" | grep -E -i "ERROR:" |cut -f2 -d: | grep -v "Can't" | xargs -i echo "Disk.{}:|" | xargs echo | tr -d ' ' | rev | cut -c2- | rev) $ empty_disk_device=$(sudo fdisk -l | grep -E "$disk_list" | sort -k5nr | head -n 1 | tail -n1 | cut -f1 -d: | cut -f2 -d' ') $ echo "$empty_disk_device"'
-
Dump the raw image to the newly added disk
$ dd if=rhcos-latest.raw of=${empty_disk_device} bs=4M
where${empty_disk_device}
is the device representing the attached volume -
Detach the volume, from the VM
-
Go to PowerVC UI->images and select create for creating a new image
-
Specify
image name
and choosePowerVM
for Hypervisor type,RHEL
for Operating system andlittleEndian
for Endianness -
Select Add Volume and search for the specific volume name (where you dd-ed the RHCOS image ) and set Boot set to yes.
-
Create the image by clicking on create
Option-2
Creating and importing RHCOS OVA image
- Download the RHCOS image from the following link on a system with public internet access. You'll need a way to transfer this image to a RHEL VM that you'll create in the next step.
- Login to PowerVC and create a RHEL 8.x VM
- Use the script https://github.com/ocp-power-automation/infra/blob/master/scripts/images/convert_qcow2_ova.py and convert the RHCOS qcow2 image to an OVA formatted image.
- Follow the steps mentioned in PowerVC docs to import the OVA image.