Converting the disk image to QCOW2 format

Convert the raw DD image to QCOW2(QEMU Copy On Write version 2) format for use with Red Hat OpenShift Virtualization.

Before you begin

Ensure that you have:

  • A raw DD image file created from the z/VM disk
  • The qemu-img package installed
  • Sufficient storage space for the QCOW2 image

About this task

QCOW2 is the preferred disk image format for OpenShift Virtualization. It provides better compression and snapshot capabilities compared to raw images.

Procedure

  1. Convert the raw image to QCOW2 format by running the following command:
    qemu-img convert -f raw -O qcow2 -p source_image.img destination_image.qcow2

    Parameters:

    • -f raw: Source format (raw disk image)
    • -O qcow2: Output format (QCOW2)
    • -p: Display progress information

  2. Verify the converted image by running the following command:
    qemu-img info destination_image.qcow2

    Example output:

    image: zvm_guest_disk.qcow2
    file format: qcow2
    virtual size: 50 GiB (53687091200 bytes)
    disk size: 12.3 GiB
    cluster_size: 65536
    Format specific information:
        compat: 1.1
        compression type: zlib
        lazy refcounts: false
        refcount bits: 16
        corrupt: false
        extended l2: false

Results

A QCOW2 disk image is created that is ready for upload to OpenShift Virtualization. The QCOW2 format typically results in a smaller file size compared to the raw image due to compression.