Resets a simple application server.
Operation description
You can reset a simple application server to re-install its applications or operating system and re-initialize the server. You can reset a simple application server by resetting the current system or changing the image.
- Reset the current system: You can re-install the operating system without changing the image.
- Change the image: You can select another Alibaba Cloud image or a custom image to re-install the operating system.
Precautions
-
Resetting the system or changing the image of a simple application server clears the disk data on the server. Back up the data as needed.
-
After you reset a simple application server, monitoring may fail. In this case, you can use one of the following methods to install the CloudMonitor agent on the server:
- Connect to the server: For more information, see Manually install the CloudMonitor agent for C++ on an ECS instance.
- Use Command Assistant: For more information, see Use Command Assistant. You can obtain the command that can be used to install CloudMonitor from the "Common commands" section of the Use Command Assistant topic.
Limits
-
Snapshots that are created before the reset are retained, but the snapshots cannot be used to restore the disks of the server.
-
You cannot reset simple application servers that were created from custom images that contain data of data disks.
-
If you reset a simple application server by replacing the existing image with a custom image, the following limits apply:
-
The custom image must reside in the same region as the current server.
-
The custom image cannot be created based on the current server. If you want to restore the data on the server, you can use a snapshot of the server to restore disk data.
-
If your simple application server resides in a region outside the Chinese mainland, you cannot switch the operating system of the server between Windows Server and Linux. You cannot use a Windows Server custom image to reset a Linux simple application server. Similarly, you cannot use a Linux custom image to reset a Windows Server simple application server. You can switch the operating systems of simple application servers only between Windows Server versions or between Linux distributions.
-
The following limits apply to the disks attached to the simple application server:
- If the custom image contains a system disk and a data disk but only a system disk is attached to the simple application server, you cannot use the custom image to reset the simple application server.
- If the system disk size of the custom image is greater than the system disk size of the simple application server, you cannot directly use the custom image to reset the simple application server.
- Only if the system disk size of the simple application server is greater than or equal to the system disk size of the custom image, you can use the custom image to reset the simple application server. To increase the system disk size of your server, you can upgrade the server configuration. For more information, see Upgrade a simple application server.
- If the data disk size of the custom image is greater than the data disk size of the simple application server, you cannot use the custom image to reset the simple application server.
-
Debugging
Authorization information
The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action
policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:
- Operation: the value that you can use in the Action element to specify the operation on a resource.
- Access level: the access level of each operation. The levels are read, write, and list.
- Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
- The required resource types are displayed in bold characters.
- If the permissions cannot be granted at the resource level,
All Resources
is used in the Resource type column of the operation.
- Condition Key: the condition key that is defined by the cloud service.
- Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
Operation | Access level | Resource type | Condition key | Associated operation |
---|---|---|---|---|
swas-open:ResetSystem | update | *Instance acs:swas-open:{#regionId}:{#accountId}:instance/{#InstanceId} |
| none |
Request parameters
Parameter | Type | Required | Description | Example |
---|---|---|---|---|
InstanceId | string | Yes | The ID of the simple application server. | ace0706b2ac4454d984295a94213**** |
RegionId | string | Yes | The region ID. You can call the ListRegions operation to query the most recent region list. | cn-hangzhou |
ImageId | string | No | The ID of the destination image. If you do not specify this parameter, the current image is reset. | 794c230fd3e64ea19f83f4d7a0ad**** |
ClientToken | string | No | The client token that you want to use to ensure the idempotence of the request. You can use the client to generate the token, but you must make sure that the token is unique among different requests. The token can contain only ASCII characters and cannot exceed 64 characters in length. For more information, see Ensure idempotence | 123e4567-e89b-12d3-a456-426655440000 |
Response parameters
Examples
Sample success responses
JSON
format
{
"RequestId": "20758A-585D-4A41-A9B2-28DA8F4F534F"
}
Error codes
HTTP status code | Error code | Error message |
---|---|---|
400 | InvalidImageId.NotSupport | The specified ImageId does not support the operation. |
404 | InvalidInstanceId.NotFound | The specified InstanceId does not exist. |
404 | InvalidImageId.NotFound | The specified ImageId does not exist. |
500 | InternalError | An error occurred while processing your request. |
For a list of error codes, visit the Service error codes.
Change history
Change time | Summary of changes | Operation |
---|---|---|
2023-09-18 | API Description Update. The Error code has changed | View Change Details |