Creates a high-availability virtual IP address (HAVIP).

Debugging

OpenAPI Explorer automatically calculates the signature value. For your convenience, we recommend that you call this operation in OpenAPI Explorer. OpenAPI Explorer dynamically generates the sample code of the operation for different SDKs.

Request parameters

Parameter Type Required Example Description
Action String Yes CreateHaVip

The operation that you want to perform. Set the value to CreateHaVip.

RegionId String Yes cn-hangzhou

The ID of the region where you want to query HAVIPs. You can call the DescribeRegions operation to query region IDs.

VSwitchId String Yes vsw-asdfjlnaue4g****

The ID of the VSwitch to which the HAVIP belongs.

Name String No test

The description of the HAVIP.

The name must be 2 to 128 characters and can contain letters, digits, underscores (_), and hyphens (-). The name must start with a letter.

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.ClientTokensupports only ASCII characters.

It can contain up to 64 ASCII characters.

IpAddress String No 192.xx.xx.10

The IP address of the HAVIP.

The specified IP address must be an idle IP address that falls within the CIDR block of the VSwitch. If this parameter is not set, an idle IP address from the CIDR block of the VSwitch is randomly assigned to the HAVIP.

Description String No This is my HaVip.

The description of the HAVIP.

The description must be 2 to 256 characters in length. It must start with a letter but cannot start withhttp://orhttps://.

Response parameters

Parameter Type Example Description
HaVipId String havip-2zeo05qre24nhrqpy****

The ID of the HAVIP.

IpAddress String 192.xx.xx.10

The IP address of the HAVIP.

RequestId String C44F62BE-9CE7-4277-B117-69243F3988BF

The request ID.

Examples

Sample requests

https://vpc.aliyuncs.com/?Action=CreateHaVip
&RegionId=cn-hangzhou
&VSwitchId=vsw-asdfjlnaue4g
&<Common request parameters>

Sample success responses

XML format

<CreateHaVipResponse>
      <RequestId>4B864C2B-8B72-4544-A461-9A022767E784</RequestId>
      <IpAddress>192.xx.xx.188</IpAddress>
      <HaVipId>havip-hp3kphox7iw0u9h1m****</HaVipId>
</CreateHaVipResponse>

JSON format

{
    "RequestId": "4B864C2B-8B72-4544-A461-9A022767E784",
    "IpAddress": "192.xx.xx.188",
    "HaVipId": "havip-hp3kphox7iw0u9h1m****"
}

Error codes

HttpCode Error code Error message Description
404 InvalidRegionId.NotFound Specified value of "regionId" is not supported. The error message returned when the specified Region ID does not exist. Check whether the service is available in this region.
404 InvalidVSwitchId.NotFound The specified VSwitch does not exist in the specified region. The error message returned because the VSwitch does not exist in the specified region.
400 InvalidDescription.Malformed The specified Description is wrongly formed. The error message returned because the specified description is invalid. The description must be 2 to 256 characters in length and cannot start with http:// or https://.
403 CountLimitExceed.HaVipInVpc Specified Vpc exceeds the quota of max number of ha-vip count. The error message returned because the number of HAVIPs in a VPC exceeds the quota.
403 QuotaExceeded.HaVip Living HaVip quota exceeded. The error message returned because the number of HAVIPs exceeds the quota.
400 InvalidIPAddress.OutOfRange The specified IPAddress is out of VSwitch CIDR. The error message returned because the specified IP address does not fall within the CIDR block of the VSwitch.
400 InvalidIPAddress.NotAvailable The specified IPAddress is not available because it is a system reserved IPAddress. The error message returned because the specified IP address is reserved by the system and cannot be used.
400 InvalidIPAddress.AlreadyUsed The specified IPAddress is already used by other resource. The error message returned because the specified IP address is already used by another resource.

For a list of error codes, visit the API Error Center.