Convert the Image Format
Last Updated:2020-07-20
Image Format Conversion
The qemu-img tool supports the format conversion of raw, cow, qcow, vdi, vmdk, cloop, dmg, bochs, vpc, vvfat and qcow2.
The following takes the "vmdk to raw as an example to describe convert into raw format:
qemu-img convert -f vmdk -O raw centos.vmdk centos.raw
The following takes the "vmdk to qcow2" as an example to describe convert into qcow2 format:
qemu-img convert -f vmdk -O qcow2 -o compat=0.10 centos.vmdk centos.raw
Parameter Instruction:
1.-f represents the source image file and its format.
2.-O (upper case) represents the format of destination image.
3.-o (lower case) is the parameter required during the conversion into qcow2 format. The parameter compat=0.10 indicates that the destination image (qcow2) is of the compatible version.
qcow2 Compatibility Conversion
If you want to implement the compatibility conversion before you import the qcow2 image, run the following command:
qemu-img amend -f qcow2 -o compat=0.10 image_name.qcow2