# Creating a Data Disk Image from an External Image File

#### Scenarios

A data disk image contains only service data. You can create a data disk image using a local image file or an external image file (image file on another cloud platform). Then, you can use the data disk image to create EVS disks and migrate your service data to the cloud.

#### Background

The following figure shows the process of creating a data disk image from an external image file.

Figure 1 Creating a data disk image from an external image file

1. Prepare an external image file. The file must be in VHD, VMDK, QCOW2, RAW, VHDX, QCOW, VDI, QED, ZVHD, or ZVHD2 format. If you want to use an image file in other formats, convert the file into any of the listed formats before importing it to the cloud platform.
2. When uploading the external image file, you must select an OBS bucket with standard storage. For details, see Uploading an External Image File.
3. Create a data disk image. For details, see Procedure.
4. Use the data disk image to create data disks. For details, see Follow-up Procedure.

#### Procedure

1. Access the IMS console.

   1. Log in to the management console.
   2. Under Compute, click Image Management Service.

      The IMS console is displayed.

2. Create a data disk image.

   1. Click Create Image in the upper right corner.
   2. In the Image Type and Source area, select Data disk image for Type.
   3. Select Image File for Source. Select the bucket storing the image file from the list and then select the image file.
      Figure 2 Creating a data disk image
   4. To register the image file using the Fast Create function, select Enable Fast Create.
      - Currently, this function supports only image files in ZVHD2 or RAW format.
      - For how to convert image file formats and generate bitmap files, see Quickly Importing an Image File.

      After you select Enable Fast Create, select the confirmation information following Image File Preparation if you have prepared the required files.

   5. In the Image Information area, set the following parameters.
      - OS Type: The value can be Windows or Linux.
      - Data Disk: The value ranges from 1 GB to 2048 GB and must be no less than the data disk size in the image file.
      - Name: Enter a name for the image.
      - (Optional) Encryption: If you want to encrypt the image, select KMS encryption and then select the key to be used from the key list.
      - (Optional) Tag: Set a tag key and a tag value for the image to easily identify and manage it.
      - (Optional) Description: Enter description of the image.
   6. Click Create Now.
   7. Confirm the parameters and click Submit.
3. Go back to the Private Images page and view the new data disk image.

   When the image status changes to Normal, the image creation is complete.

#### Follow-up Procedure

If you want to use the created data disk image to create an EVS disk and attach it to an ECS, you can perform either of the following operations:

- Locate the row that contains the created data disk image and click Create Data Disk to create one or multiple data disks. Then attach the data disks to an ECS.
- On the page for creating ECSs, click Create Disk from Data Disk Image and select the data disk image.

  A data disk image can be used to create a data disk for an ECS only once.

Parent topic: Creating a Private Image