ResetInstances

1. API Description

This API (ResetInstances) is used to reinstall the operating system on multiple instances.

Preparation

  • Query images: Call DescribeImages to obtain the operating system image information required for reinstallation.

circle-info

Note

  • If the imageId parameter is specified, the instance will be reinstalled using the specified image; otherwise, it will be reinstalled using the current image of the instance.

  • Reinstallation across operating system types (osType) is not supported. For example, reinstalling from linux to windows.

  • The boot disk size of the instance must be greater than or equal to the size of the target image. Otherwise, the operation will be rejected.

  • The boot disk will be formatted and reset; ensure there are no important files on the boot disk.

  • You can set either a password or a keyId, but not both.

  • System reinstallation can only be performed when the instance is in a powered-off state.

  • Windows and Generic do not support SSH login using key_id.

  • After reinstallation, the instance enters the DEPLOYING state. If the instance's latest state changes to RUNNING, the operation is successful. If it changes to REINSTALL_FAILED, the operation is failed; please contact the administrator. The instance state can be queried via the DescribeInstancesStatus API.

2. Input Parameters

The following request parameter list only provides API request parameters.

Parameter Name
Required
Type
Description

instanceIds

Yes

Array of String

The instance IDs to be reinstalled.

password

No

String

The new password for the instance.

You can set either a password or a keyId, but not both; Windows and Generic images support neither option.

The password must contain the following three character types: uppercase and lowercase letters: [a-zA-Z], digits: 0-9, and special characters: ~!@$^*-_=+

keyId

No

String

SSH key pair ID.

You can set either a password or a keyId, but not both; Windows and Generic images support neither option.

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.

Example: key-YWD2QFOl.

imageId

No

String

Specify a valid image ID.

To obtain valid image ID, you can call DescribeImagesarrow-up-right and look for imageId in the response.

If not specified, the instance will be reinstalled using the current image.

timezone

No

String

Time zone configuration for the operating system.

enableAgent

No

Boolean

Whether QGA is enabled or not.

Default value: false

instanceName

No

String

The modified instance name.

2–63 characters in length.

Only letters, numbers, hyphens (-), and periods (.) are allowed.

userData

No

String

Initialization command.

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.

instanceIds

Array of String

List of instance IDs for which the reinstallation operation failed.

4. Code Example

Batch reinstall instances.

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