• Native OpenStack API

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

Rebuilding an ECS

Function Description

This interface is used to rebuild an ECS.

You can use the original image or another image to rebuild an ECS. This interface supports different OSs.

Notes

This interface is a native OpenStack interface that is not applicable to the ECSs on public cloud service platform. If you are required to reinstall or change an ECS OS, use extension ECS APIs.

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

  • ECSs in the error state cannot be rebuilt.
  • The password cannot be set during the rebuilding.

Extension Description

N/A

Request

Table 1 Request parameter

Parameter

Type

Mandatory

Description

rebuild

Dict

Yes

Rebuilds an ECS.

Table 2 rebuild parameter information

Parameter

Type

Mandatory

Description

name

String

No

Specifies the name of the rebuilt ECS.

The value contains 1 to 254 characters.

metadata

Dict

No

Specifies the metadata of the rebuilt ECS.

imageRef

String

Yes

Specifies the image ID or URL.

adminPass

String

No

Specifies the password for logging in to the rebuilt ECS. This parameter does not take effect.

OS-DCF:diskConfig

String

No

Not supported

preserve_ephemeral

Boolean

No

Specifies whether to retain the temporary disk. This parameter is not supported.

Response

Table 3 Response parameters

Parameter

Type

Mandatory

Description

status

String

Yes

Specifies the ECS status.

Values:

  • ACTIVE
  • REBOOT
  • HARD_REBOOT
  • REBUILD
  • MIGRATING
  • BUILD
  • SHUTOFF
  • RESIZE
  • VERIFY_RESIZE
  • ERROR
  • DELETED

updated

String

Yes

Specifies the time when the ECS was updated last time.

hostId

String

Yes

Specifies the ID of the host on which the ECS is deployed.

addresses

List(Dict)

Yes

Specifies the network attribute of the ECS.

links

List(Dict)

Yes

Specifies the description of the ECS.

image

Dict

Yes

Specifies the ECS image information. For the ECS that boots from a volume, the value is left blank.

flavor

Dict

Yes

Specifies the ECS flavor.

id

String

Yes

Specifies the ECS ID in UUID format.

user_id

String

Yes

Specifies the user UUID of the ECS.

name

String

Yes

Specifies the ECS name.

tenant_id

String

Yes

Specifies the UUID of the tenant who owns the ECS.

OS-DCF:diskConfig

String

Yes

Specifies the diskConfig type. It is an extended attributed.

  • MANUAL: The image space cannot be expanded.
  • AUTO: The image space on the system disk will be automatically expanded to keep the same as that set in the flavor.

accessIPv4

String

Yes

Discarded

accessIPv6

String

Yes

Discarded

progress

String

Yes

Specifies the ECS creation progress.

metadata

Dict

Yes

Specifies the ECS metadata.

Request Example

{
    "rebuild" : {
        "imageRef" : "3ed456f5-3d8f-4383-a6c9-312032afcd1a",
        "name" : "rebuildName",
       "metadata" : {
            "rebuild" : "rebuild vm"
        }
    }
}

Response Example

{
    "server": {
        "tenant_id": "7459f9935ed2422eb9800fea1d4d9378",
        "image": {
            "links": [
                {
                    "rel": "bookmark",
                    "href": "https://172.30.32.132:443/7459f9935ed2422eb9800fea1d4d9378/images/3ed456f5-3d8f-4383-a6c9-312032afcd1a"
                }
            ],
            "id": "3ed456f5-3d8f-4383-a6c9-312032afcd1a"
        },
        "accessIPv4": "",
        "addresses": {
            "443dd9e3-c165-4764-ad92-b17fcf12a3eb": [
                {
                    "addr": "192.168.0.119",
                    "version": 4
                }
            ]
        },
        "metadata": {
            "name": "rebuildName"
        },
        "accessIPv6": "",
        "created": "2016-09-19T01:13:26Z",
        "hostId": "fd16ebd9c2629e8595875cc1e1400fa67f392431d7937fcc9cf37671",
        "adminPass": "qGVjnEjY3ZoY",
        "flavor": {
            "links": [
                {
                    "rel": "bookmark",
                    "href": "https://172.30.32.132:443/7459f9935ed2422eb9800fea1d4d9378/flavors/normal1"
                }
            ],
            "id": "normal1"
        },
        "OS-DCF:diskConfig": "MANUAL",
        "user_id": "ed2965d80d394be0b41e56f50ac650ca",
        "name": "rebuildName",
        "progress": 0,
        "links": [
            {
                "rel": "self",
                "href": "https://172.30.32.132:443/v2/7459f9935ed2422eb9800fea1d4d9378/servers/ea681a24-9b24-4f49-98ef-8e1f73acf19e"
            },
            {
                "rel": "bookmark",
                "href": "https://172.30.32.132:443/7459f9935ed2422eb9800fea1d4d9378/servers/ea681a24-9b24-4f49-98ef-8e1f73acf19e"
            }
        ],
        "id": "ea681a24-9b24-4f49-98ef-8e1f73acf19e",
        "updated": "2016-09-19T07:22:05Z",
        "status": "REBUILD"
    }
}

Returned Values

See General Request Returned Values.