Uploading an Image (Native OpenStack API)

Function

This API is used to upload a local image to the cloud platform. The image to be uploaded must be smaller than 128 GB.

For more information about how to use external files to create images, see sections "Creating a Private Windows Image Using an External Image File" and "Creating a Private Linux Image Using an External Image File" in Image Management Service User Guide.

The following describes how to use this API:

  1. Prepare the image to be uploaded. The image can be in QCOW2, VMDK, VHD, RAW, VHDX, QED, VDI, QCOW, ZVHD2, or ZVHD format.
  2. Create metadata for the image by performing the operations in Creating Image Metadata (Native OpenStack API). After the API is invoked successfully, save the image ID.
  3. Upload the image file with the image ID obtained in 2.

URI

PUT /v2/images/{image_id}/file

Table 1 lists the parameters in the URI.
Table 1 Parameter description

Parameter

Mandatory

Type

Description

image_id

Yes

String

Specifies the image ID.

  • image_id is the ID of the image you created by invoking the API for creating image metadata. Image upload may fail if you use other image IDs.
  • After this API is invoked, you can check the image status with the image ID. When the image status changes to active, the image is uploaded successfully.

Request

Response

Returned Values