• Native OpenStack API

noa
  1. Help Center
  2. Native OpenStack API
  3. API Reference
  4. OpenStack Cinder API v3
  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 disk, stop all servers where the shared disk has been attached before calling this API.

URI

  • URI format

    POST /v3/{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 the operation to export the disk data as an image. For details, see Parameters in the os-volume_upload_image field.

  • 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.

    • If 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

    error

    string

    Specifies the error message returned when an error occurs. For details, see Parameters in the error field.

  • Parameters in the os-volume_upload_image field

    Parameter

    Type

    Description

    status

    string

    Specifies the disk status after the image is exported. The correct 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 disk type.

    container_format

    string

    Specifies the container type of the exported image.

    size

    Integer

    Specifies the disk size, in GB.

    disk_format

    string

    Specifies the format of the exported image.

    id

    string

    Specifies the disk ID.

    display_description

    string

    Specifies the disk description.

    updated_at

    string

    Specifies the time when the disk was updated.

    Time format: UTC YYYY-MM-DDTHH:MM:SS

  • 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 disk type.

    deleted

    Boolean

    Specifies whether to delete the disk type.

    is_public

    Boolean

    Specifies whether the disk type is public.

    extra_spec

    map<string, string>

    Specifies the specifications of the disk type.

    description

    Integer

    Specifies the description of the disk type.

    created_at

    string

    Specifies the time when the disk type was created.

    Time format: UTC YYYY-MM-DDTHH:MM:SS

    updated_at

    string

    Specifies the time when the disk type was updated.

    Time format: UTC YYYY-MM-DDTHH:MM:SS

    deleted_at

    string

    Specifies the time when the disk type was deleted.

    Time format: UTC YYYY-MM-DDTHH:MM:SS

  • Parameters in the error field

    Parameter

    Type

    Description

    message

    string

    Specifies the error message returned when an error occurs.

    code

    string

    Specifies the error code returned when an error occurs.

    For details about the error code, see Error Codes.

  • 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.