• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. Nova
  5. Server Actions
  6. Creating an Image

Creating an Image

Function Description

This interface is used to create an image using an ECS. After the creation, you can use this image to create ECSs.

Images created using ECSs are stored on storage nodes as snapshots.

URI

  • URI format

    POST /v2/{tenant_id}/servers/{server_id}/action

    POST /v2.1/{tenant_id}/servers/{server_id}/action

  • Parameter description

    Parameter

    Mandatory

    Description

    tenant_id

    Yes

    Specifies the tenant or project ID.

    server_id

    Yes

    Specifies the ECS ID.

Restrictions

  1. ECSs in error state cannot be used to create images.
  2. If an image created using an ECS is used to create a new ECS, the new ECS must be located in the same AZ as the original ECS.
  3. After an image created using an ECS is deleted, the associated snapshots will not be automatically deleted (this function is implemented by native OpenStack). You must manually delete such snapshots.
  4. The image created using an ECS cannot be used to create data disks.
  5. The images created using the interface described in this section (URI: POST /v2/{tenant_id}/servers/{server_id}/action or POST /v2.1/{tenant_id}/servers/{server_id}/action) cannot be exported to OBS buckets. If such images must be exported, use the extended IMS interface (POST /v2/cloudimages/action). For details, see section "Creating an Image" in Image Management Service API Reference.

Extension Description

N/A

Request

Table 1 Request parameter

Parameter

Type

Mandatory

Description

createImage

Dict

Yes

Creates an image using an ECS.

Table 2 createImage field description

Parameter

Type

Mandatory

Description

name

String

Yes

Specifies the image name with a length greater than 0 bytes and less than 243 bytes.

metadata

Dict

No

Specifies the image attribute with a length greater than 0 bytes and less than 255 bytes.

Response

N/A

Example Request

POST /v2/9c53a566cb3443ab910cf0daebca90c4/servers/47e9be4e-a7b9-471f-92d9-ffc83814e07a/action
POST /v2.1/9c53a566cb3443ab910cf0daebca90c4/servers/47e9be4e-a7b9-471f-92d9-ffc83814e07a/action
{
   "createImage" : {
        "name" : "new-image-name",
        "metadata": {
            "ImageType": "Gold",
            "ImageVersion": "2.0"
        }
    }
}

Example Response

N/A

Returned Value

See General Request Returned Values.