Images only in the RAW, QCOW2, or VHD format can be imported to Elastic Compute Service (ECS). If you want to import images in other formats, you must first convert the images to supported formats. This topic describes how to use the qemu-img tool to convert images in other formats to the QCOW2, RAW, or VHD format.

Background information

The qemu-img tool supports the conversion of images in the following formats:
  • Convert images from the RAW, qcow2, qcow1, VMDK, VDI, VHD (VPC), VHDX, or QED format to the VHD format.
  • Convert between RAW and VHD.
For more information, see Convert the image file format

Procedure

  1. Run the following command to install the qemu-img tool:
     yum install qemu-img                    
  2. Run the following command to convert the format of the image:
     qemu-img convert -f VHDX -O vhd rhel.vhdx rhel.vhd                    

    Parameter description:

    • -f: This parameter is followed by the original image format.
    • -O: This parameter must be in uppercase and is followed by the new image format, the name of the original image, and the name of the new image.
    After the conversion is complete, the new image appears in the directory of the original image.