百度智能云

All Product Document

          Cloud Compute Service

          Check the Image Format

          You need to confirm that your image format is raw or qcow2 (v2) before you import an image.

          Install qemu-img.

          1. If the testing platform is of the Ubuntu operating system, run: apt-get install qemu-utils
          2. If the testing platform is of the CentOS operating system, run: yum install qemu-img
          3. Install qemu-img for the Windows system. Download: qemu-img for windows, and select the appropriate version for downloading.

          The steps to install and set qemu-img under the Windows operating system are as follows:

          A. Install qemu-img. The installation path is as follows in this example: C:\Program Files\qemu

          image.png

          B. Configure the environment variables for qemu-img:

          Select "Start" -> "Computer", and then right click "Properties".

          Click "Advanced System Settings" in the left navigation bar.

          Click the "Advanced" tab in the "System Properties" dialog, and then click "Environment Variable".

          image.png

          Locate "Path" in the "System Variable" section of the "Environment Variable" dialog, and then click "Edit". If the variable Path does not exist, click "New".

          image.png

          C. Add the system variable value.

          If it is the "Edit System Variable", add C: \Program Files\qemu in the "Variable Value". The different variable values are separated by semicolons (;).

          image.png

          If it is the "New System Variable", enter "Path" in "Variable Name", and then enter "C: \Program Files\qemu" in “Variable Value".

          image.png

          D. You can enter the command qemu-img in the command prompt to verify whether the environment variable is set successfully after setting. If there is the information output about qemu-img, it indicates the environment variable is set correctly.

          image.png

          Image Format Checking

          You can use the command qemu-img info to check the image format and confirm that the format of imported image file is raw or qcow2.

          Command: qemu-img info image_name

          image.png

          As shown in the figure below, if the file format in the return information is raw or qcow2, it indicates that this image conforms to the standard. If it is not the raw or qcow2 format, convert the format firstly.

          Note: If the test result is qcow2, you need to test the compatibility further.

          qcow2 Image Compatibility Checking

          Replicate your image to the test system. The following take the Linux test system as an example:

          If the Linux operating system is CentOS6:

          Use the command qemu-img info to query the qcow2 version of image. If the output information is shown as follows, it indicates that the qcow2 image file is of the version v2 and the qcow2 compatibility conversion is not required.

          image.png

          If the output information is shown as follows, it indicates that the qcow2 image file is of the higher version (V3) and the degrading operation is required before you import it into Baidu AI Cloud. See Format Conversion for the degrading operation.

          image.png

          If it operates on the platform CentOS7, Ubuntu14/16/18 or debain8/9, use the command qemu-img to view the qcow2 image information.

          As shown in the figure below, if the compat in the return result is 0.10, the qcow2 compatibility conversion is not required.

          image.png

          If the compat in the return result is 1.1, the qcow2 degrading operation is required for the image file.

          image.png

          Previous
          Perform the System Optimization (Linux)
          Next
          Convert the Image Format