ReinstallInstance

1. API Description

This API is used to reinstall the operating system of the specified instance.

Prerequisites

Note

  • If you specify an imageId, the specified image is used. Otherwise, the image used by the current instance is used.

  • Operations on instances in recycle bin or in stalling status are not supported.

  • The system disk will be formatted and reset. Therefore, make sure that no important files are stored on the system disk.

  • If no password is specified, you will get a random password via mailbox.

  • The status of the instance will be INSTALLING during reinstallation. You can use DescribeInstances to query the status of the instance. If the status changes to Running, it means that the instance has been reinstalled successfully; INSTALL_FAILED means the instance has been reinstalled failed. Any operations on the instances are not allowed while creating. Please contact Zenlayer Support if you have failed.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

instanceId

Yes

String

Instance ID.

To obtain the instance ID,you can callDescribeInstancesand look forinstanceIdin the response.

imageId

No

String

Valid image ID. To obtain valid image ID,you can callDescribeImages,pass ininstanceTypeIdto retrieve the list of images supported by the current model,and then find theimageIdin the response.

You can also not specify an image and install it later through IPMI. When using iPXE to install OS,pass the value ofipxeUrl,and leaveimageIdempty.

ipxeUrl

No

String

iPXE URL. Pass in the value and install your OS via IPMI.

You can choose to install OS using Netboot.SeeDeploy a Custom Image Using iPXEfor more details.

hostname

No

String

Instance hostname.

Default value:hostname.

This parameter can contain up to 64 . characters.Only letters,numbers,-and periods(.)are supported.

password

No

String

Instance password.

The parameter must be 8-16 characters,including uppercase letters,lowercase letters,numbers and special characters like1~!@$^*-_=+.This password is also used as the password for IPMI login.Please keep it safe. You must and can only pass the value of eitherpasswordorkeyId.

keyId

No

String

SSH key pair ID.

Your SSH key pair contains several public keys that can be placed on your server.You can access your instance with the private key.CallDescribeKeyPairsto obtain key pair information.

SSH key pairs and passwords cannot to set at the same time.SSH key pairs are not supported for Windows operating system. For example:key-YWD2QFOl You must and can only pass the value of eitherpasswordorkeyId.

raidConfig

No

Disk array configuration.

partitions

No

Array ofPartition

Disk partition configuration. If the operating system is not installed,the partition cannot be set.

nic

No

NIC configuration.

userData

String

用户数据。

在安装实例时可以通过指定用户数据进行配置实例。当实例首次启动时,用户数据将以文本的方式传递到云服务器中,并执行该文本。支持的最大数据大小为 32KB。

3. Output Parameters

Parameter Name
Type
Description

requestId

String

The unique request ID, which is returned for each request. RequestId is required for locating a problem.

4. Code Example

Default reinstallation

Reinstall the operating system of the instance of the instanceId ID with default value.

POST /api/v2/bmc HTTP/1.1
Host: console.zenlayer.com
Content-Type: application/json
X-ZC-Action: ReinstallInstance
<Common Request Params>

Request:
{
    "instanceId": "instanceId"
}

Response:
{
  "requestId": "TC1748D3E-452D-4F74-8485-7AA73718E453",
  "response": {
    "requestId": "TC1748D3E-452D-4F74-8485-7AA73718E453"
  }

5. Developer Resources

Zenlayer Cloud API 2.0 integrates SDKs to make it easier for you to call APIs. More programming languages will be supported.

6. Error Codes

The following only lists the error codes related to the API business logic. For other error codes, see Common Error Codes.​

HTTP Status Code
Error Code
Description

400

INVALID_PARAMETER_HOSTNAME_EXCEED

Invalid hostname length. The specified hostname exceeds the maximum length.

400

INVALID_PARAMETER_HOSTNAME_MALFORMED

Invalid hostname format.

400

INVALID_PARAMETER_INSTANCE_NAME_EXCEED

Invalid instance name length. The specified instance name exceeds the maximum length.

400

INVALID_PARAMETER_INSTANCE_NAME_EXCEED

Invalid instance name format.

404

INVALID_INSTANCE_NOT_FOUND

Instance not found.

404

INVALID_IMAGE_NOT_FOUND

Image not found.

403

INVALID_PARTITION_IMAGE_NOT_SET

Custom partition are only supported for specific operating system.

400

INVALID_PARAMETER_VALUE_PASSWORD_MALFORMED

Invalid password.

400

INVALID_PARAMETER_INSTANCE_LOGIN_CONFLICT

Password login and SSH key login cannot be specified at the same time.

400

INVALID_PARAMETER_SSH_KEY_MALFORMED

Invalid SSH key format. Usually start with rsa.

400

INVALID_RAID_CONFIG_FAST_CUSTOM_CONFLICT

Custom RAID and rapid RAID cannot be specified at the same time.

400

INVALID_INSTANCE_TYPE_RAID_NOT_SUPPORT

RAID level not supported for current instance model.

400

INVALID_PARAMETER_NIC_NAME_CONFLICT

Public NIC name and private NIC name cannot be the same.

400

INVALID_PARAMETER_NIC_NAME_MALFORMED

Invalid public or private NIC name.

400

INVALID_PARTITION_SIZE_NOT_FULL

Invalid partition size. Does not reach the specified capacity.

400

INVALID_PARTITION_DUPLICATE_FILE_PATH

Duplicated file path or drive letters of the partition.

400

INVALID_PARTITION_MISSING_REQUIRED_FILE_PATH

File path (drive letter) is needed.

"c" must be included for Windows, and "/" must be included for Linux.

400

INVALID_PARTITION_MALFORMED

Invalid file type or path format.

400

INVALID_PARTITION_NO_TYPE

Invalid file type.

400

INVALID_PARTITION_INVALID_ORDER

Drive letters must be filled in alphabetical order, such as CDEFG for Windows.

400

INVALID_PARAMETER_VALUE_RAID_DISK_MISMATCH

Disk quantity does not meet the RAID level requirement in custom RAID configuration.

400

INVALID_PARAMETER_VALUE_RAID_DISK_DISORDER

Serial numbers of disks must be filled in order, such as [1,2,3], in custom RAID configuration.

400

INVALID_INSTANCE_TYPE_QUICK_RAID_NOT_SUPPORT

Rapid RAID not supported. Please customize RAID settings.

Last updated