Dissociates a high-availability virtual IP address (HAVIP) from an Elastic Compute Service (ECS) instance in a virtual private cloud (VPC).
When you call this operation, note that:
- The ECS instance must be in the Running or Stopped state.
- The HAVIP must be in the Available or InUse state.
Debugging
Request parameters
Parameter | Type | Required | Example | Description |
---|---|---|---|---|
Action | String | Yes | UnassociateHaVip |
The operation that you want to perform. Set the value to UnassociateHaVip. |
HaVipId | String | Yes | havip-2zeo05qre24nhrqpy**** |
The ID of the HAVIP that you want to disassociate from the ECS instance. |
InstanceId | String | Yes | i-faf344422ffsfad**** |
The ID of the ECS instance from which you want to disassociate the HAVIP. |
RegionId | String | Yes | cn-shanghai |
The region ID of the HAVIP. You can call the DescribeRegions operation to query region IDs. |
ClientToken | String | No | 0c593ea1-3bea-11e9-b96b-88e9fe637760 |
The client token that is used to guarantee the idempotence of the request. You can use the client to generate a value that is unique among different requests. ClientToken supports only ASCII characters. It can contain up to 64 ASCII characters. |
Force | String | No | True |
Specifies whether to forcibly disassociate the HAVIP.
Note If you set this parameter to False, you cannot disassociate the HAVIP from a primary ECS instance.
|
Response parameters
Parameter | Type | Example | Description |
---|---|---|---|
RequestId | String | C44F62BE-9CE7-4277-B117-69243F3988BF |
The request ID. |
Examples
Sample requests
https://vpc.aliyuncs.com/?Action=UnassociateHaVip
&HaVipId=havip-2zeo05qre24nhrqpy****
&InstanceId=i-faf344422ffsfad****
&RegionId=cn-shanghai
&<Common request parameters>
Sample success responses
XML
format
<UnassociateHaVipResponse>
<RequestId>C44F62BE-9CE7-4277-B117-69243F3988BF</RequestId>
</UnassociateHaVipResponse>
JSON
format
{
"RequestId": "C44F62BE-9CE7-4277-B117-69243F3988BF"
}
Error codes
HttpCode | Error code | Error message | Description |
---|---|---|---|
404 | InvalidHaVipId.NotFound | The specified HaVip does not exist in the specified region. | The error message returned because the specified HAVIP does not exist in the specified region. Check whether the region is correct. |
404 | InvalidInstanceId.NotFound | The specified Instance does not exist in the specified region. | The error message returned because the instance does not exist in the specified region. |
400 | IncorrectHaVipStatus | HaVip can be operated by this action only when it's status is InUse. | The error message returned because the operation can be performed only when the HAVIP is in the InUse state. |
400 | IncorrectInstanceStatus | ECS instance can be operated by this action only when it's status is Running or Stopped. | The error message returned because the operation can be performed only when the ECS instance is in the Running or Stopped state. |
400 | ResourceNotAssociated | The HaVip and ECS instance are not associated. | The error message returned because the HAVIP is not associated with the ECS instance. |
400 | Forbidden.UnassociateMaster | Unassociating a master instance is not allowed unless the parameter Force is True. | The error message returned because the Force parameter is set to False. |
500 | InternalError | The request processing has failed due to some unknown error. | The error message returned because unknown errors have occurred. |
For a list of error codes, visit the API Error Center.