Binding a Virtual IP Address to an ECS NIC
Function
A virtual IP address provides the second IP address for one or multiple ECS NICs, improving high availability between the ECSs.
This API is used to configure a virtual IP address for an ECS NIC.
- If the specified IP address is a virtual IP address that has not been assigned, the system automatically assigns the virtual IP address and binds it to a specified NIC.
- If the specified IP address is a virtual IP address that has been assigned, the system binds the virtual IP address to a specified NIC. If the device_owner of this IP address is left blank, only intra-VPC layer 2 and layer 3 communication is supported. If the device_owner of this IP address is neutron:VIP_PORT, intra-VPC layer 2 and layer 3 communication, inter-VPC peer access, as well as Internet access through EIP, VPN, and Cloud Connect are supported.
For more details, see Virtual IP Address Overview.
URI
PUT /v1/{project_id}/cloudservers/nics/{nic_id}
|
Parameter |
Mandatory |
Description |
|---|---|---|
|
project_id |
Yes |
Specifies the project ID. For details about how to obtain the ID, see Obtaining a Project ID. |
|
nic_id |
Yes |
Specifies the ECS NIC ID. |
Request
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
nic |
Yes |
Object |
Specifies the NIC parameters required for binding a virtual IP address. For details, see Table 3. |
|
Parameter |
Mandatory |
Type |
Description |
|---|---|---|---|
|
subnet_id |
Yes |
String |
Specifies the information about the NICs to be added to an ECS. Set the parameter value to the ID (in UUID format) of the network created in the VPC to which the target ECS belongs. |
|
ip_address |
Yes |
String |
Specifies the virtual IP address to be bound to a NIC. |
|
reverse_binding |
No |
Boolean |
Indicates the allowed_address_pairs attribute of a virtual IP address, specifying whether the NIC IP/MAC address pair is added. |
Response
Example Request
PUT https://{endpoint}/v1/{project_id}/cloudservers/nics/{nic_id}
{
"nic": {
"subnet_id": "d32019d3-bc6e-4319-9c1d-6722fc136a23",
"ip_address": "192.168.0.7",
"reverse_binding": true
}
}
Example Response
{
"port_id": "d32019d3-bc6e-4319-9c1d-6722fc136a23"
}
Returned Values
Error Codes
Last Article: Deleting NICs from an ECS in a Batch
Next Article: Unbinding a Virtual IP Address from an ECS NIC
Did this article solve your problem?
Thank you for your score!Your feedback would help us improve the website.