For the complete documentation index, see llms.txt. This page is also available as Markdown.

ReinstallInstance

1. API Description

This API (ReinstallInstance) 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 call DescribeInstances and look for instanceId in the response.

imageId

No

String

Valid image ID.

To obtain valid image ID,you can call DescribeImages ,pass in instanceTypeId to retrieve the list of images supported by the current model,and then find the imageId in the response.

You can also not specify an image and install it later through IPMI.

When using iPXE to install OS,pass the value of ipxeUrl ,and leave imageId empty.

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 like 1~!@$^*-_=+ .This password is also used as the password for IPMI login.Please keep it safe.

You must and can only pass the value of either password or keyId .

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.Call DescribeKeyPairs to 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 either password or keyId .

raidConfig

No

Disk array configuration.

partitions

No

Array of Partition

Disk partition configuration.

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

nic

No

NIC configuration.

ipxeUrl

No

String

iPXE URL.

Pass in the value and install your OS via IPMI.

You can choose to install OS using Netboot.See Deploy a Custom Image Using iPXE for more details.

userData

No

String

User Data.

You can specify user data during instance installation. When the instance is launched for the first time, the user data is passed to the server as text and executed. The maximum supported data size is 32 KB.

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.

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

Last updated