• Elastic Volume Service

evs
  1. Help Center
  2. Elastic Volume Service
  3. API Reference
  4. OpenStack Cinder API v2
  5. EVS Disk Actions
  6. Exporting EVS Disk Data as an Image

Exporting EVS Disk Data as an Image

Function

This API is used to export the system disk data or data disk data as an IMS image. The exported image will be displayed in the IMS private image list and can be viewed and used.

Constraints

If the target disk is in the in-use state, stop the server where the disk has been attached before calling this API. If the target disk is a shared EVS disk, stop all servers where the shared disk has been attached before calling this API.

URI

  • URI format

    POST /v2/{project_id}/volumes/{volume_id}/action

  • Parameter description

    Parameter

    Mandatory

    Description

    project_id

    Yes

    Specifies the project ID.

    volume_id

    Yes

    Specifies the EVS disk ID.

Request

  • Parameter description

    Parameter

    Type

    Mandatory

    Description

    os-volume_upload_image

    map<string, map>

    Yes

    Specifies to export the EVS disk data as an image.

  • Parameters in the os-volume_upload_image field

    Parameter

    Type

    Mandatory

    Description

    disk_format

    string

    No

    Specifies the format of the exported image. The default value is vhd.

    image_name

    string

    Yes

    Specifies the name of the exported image.

    force

    Boolean

    No

    Specifies whether to forcibly export the image. The default value is false.

    • When force is set to false and the disk is in the in-use state, the image cannot be forcibly exported.
    • If force is set to true and the disk is in the in-use state, the image can be forcibly exported.

    container_format

    string

    No

    Specifies the container type of the exported image. The default value is bare.

    __os_type

    string

    No

    Specifies the OS type of the exported image. Currently, only windows and linux are supported. The default value is linux.

    NOTE:
    • There are two underscores (_) in front of os and one underscore (_) after os.
    • This parameter setting takes effect only when the __os_type field is not included in volume_image_metadata and the disk status is available.
    • If this parameter is not specified, default value linux is used as the OS type of the image.
  • Example request
    {
        "os-volume_upload_image": {
            "image_name": "sxmatch2", 
            "force": true, 
            "container_format": "bare", 
            "disk_format": "vhd",
            "__os_type": "linux"
        }
    }

Response

  • Parameter description

    Parameter

    Type

    Description

    status

    string

    Specifies the status after the image is exported. The normal value is uploading.

    image_id

    string

    Specifies the ID of the exported image.

    image_name

    string

    Specifies the name of the exported image.

    volume_type

    map<string, string>

    Specifies the information of the EVS disk type.

    container_format

    string

    Specifies the container type of the exported image.

    size

    Integer

    Specifies the EVS disk capacity.

    disk_format

    string

    Specifies the format of the exported image.

    id

    string

    Specifies the EVS disk ID.

    display_description

    string

    Specifies the disk description.

    updated_at

    string

    Specifies the time when the EVS disk information was updated.

  • Parameters in the volume_type field

    Parameter

    Type

    Description

    id

    string

    Specifies the ID of the disk type.

    name

    string

    Specifies the name of the EVS disk type.

    deleted

    Boolean

    Specifies whether to delete the EVS disk type.

    is_public

    Boolean

    Specifies whether the EVS disk type is public.

    extra_spec

    map<string, string>

    Specifies the specifications of the EVS disk type.

    description

    Integer

    Specifies the description of the EVS disk type.

    created_at

    string

    Specifies the time when the EVS disk type was created.

    updated_at

    string

    Specifies the time when the EVS disk type was updated.

    deleted_at

    string

    Specifies the time when the EVS disk type was deleted.

  • Example response
    {
        "os-volume_upload_image": {
            "status": "uploading", 
            "size": 40, 
            "id": "16369c5d-384d-4e64-b37a-56d898769362", 
            "image_id": "c5333daa-fbc8-4d1d-bf79-b0567bb45d15", 
            "image_name": "evs-ims-test1027", 
            "volume_type": {
                "description": "None", 
                "deleted": false, 
                "created_at": "2015-05-24T14:47:22.132268", 
                "updated_at": "2017-07-29T11:29:33.730076", 
                "extra_specs": {
                    "volume_backend_name": "<or> iaas blockstorage_SATA <or> iaas blockstorage_SAS <or> iaas blockstoragesata", 
                    "XX:availability_zone": "kvmxen.dc1"
                }, 
                "is_public": true, 
                "deleted_at": null, 
                "id": "8247b6ed-37f0-4c48-8ef1-f0027fb332bc", 
                "name": "SATA"
            }, 
            "container_format": "bare", 
            "disk_format": "vhd", 
            "display_description": "", 
            "updated_at": "2018-01-11T01:50:25.800931"
        }
    }
    or
    {
        "error": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }
    In the preceding example, error indicates a general error, for example, badRequest or itemNotFound. An example is provided as follows:
    {
        "itemNotFound": {
            "message": "XXXX", 
            "code": "XXX"
        }
    }

Returned Values

  • Normal

    202

Error Codes

For details, see Error Codes.