As your business grows, you may deploy more Elastic Compute Service (ECS) instances on top of an existing one to provide services to your customers. To ensure that the same IP address is used by your service, you can convert the public IP address that is assigned to your existing ECS instance to an Elastic IP Address (EIP) and bind the EIP to a Server Load Balancer (SLB) instance or other ECS instances. This allows you to scale out your business without affecting ongoing services. This topic describes how to convert an auto-assigned public IP address to an EIP.
Differences between auto-assigned public IP addresses and EIPs
Precautions
Item | Description |
Address convertibility | After an auto-assigned public IP address is converted to an EIP, you cannot convert the EIP back to the auto-assigned public IP address. If you require an auto-assigned public IP address for your instance after the conversion, you can unbind the EIP from the instance and adjust the public bandwidth for a new public IP address to be assigned to your instance. For more information, see Modify the bandwidth configurations of subscription instances or Modify the bandwidth configurations of pay-as-you-go instances. Note Alternatively, you can call the ModifyInstanceNetworkSpec operation to modify the public bandwidth of your ECS instance and enable a new public IP address to be assigned to the instance. |
IP address | The auto-assigned public IP address is converted to and retained as an EIP. |
Billing method for network usage | The pay-by-traffic billing method for network usage remains unchanged. |
Billable item | The EIP is separately billed, and separate bills are generated. For more information about the billing of EIPs, see Billing overview. |
Prerequisites
Before you convert the auto-assigned public IP address of an instance in a VPC to an EIP, make sure that the following requirements are met:
The instance is created in a VPC and has an auto-assigned public IP address.
If the instance is a pay-as-you-go instance, you have no overdue payments in your account.
If the instance is a subscription instance, the instance has at least 24 hours remaining in its subscription duration and uses the pay-by-traffic billing method for network usage. If the subscription instance uses the pay-by-bandwidth billing method for network usage, change the billing method for network usage to pay-by-traffic. For more information, see Overview of instance configuration changes.
If an instance type change is made for the instance, wait until the new instance type takes effect before you convert the auto-assigned public IP address.
The instance is in the Running or Stopped state.
Procedure
You can also call the ConvertNatPublicIpToEip operation to convert the auto-assigned public IP address of an instance in a VPC to an EIP. To call this operation, use SDKs 4.3.0 or later. For more information, see Install and use ECS SDKs.
Log on to the ECS console.
In the left-side navigation pane, choose .
In the top navigation bar, select the region and resource group to which the resource belongs.
Find the ECS instance whose network type is VPC and whose IP address you want to convert. In the Actions column, choose
.In the dialog box that appears, confirm the information and click OK.
Refresh the instance list.
After the public IP address is converted to an EIP, the public IP address is marked by (Elastic).
You can click the EIP to go to the Elastic IP Addresses page in the VPC console to manage the EIP.
What to do next
After the auto-assigned public IP address is converted to an EIP, you can perform the following operations:
Unbind the EIP from the ECS instance and bind it to the SLB instance or another ECS instance. For information about how to associate an EIP with an instance, see Associate or disassociate an EIP.
Use EIP bandwidth plans to save costs. For more information, see Reduce the costs of data transfer over the Internet.
Release the EIP to stop EIP billing. EIPs are billed until they are released. If you no longer require an EIP, we recommend that you release it. For more information, see Release a pay-as-you-go EIP.