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
IP addresses provide access to your services over the Internet, regardless of whether the IP addresses are auto-assigned public IP addresses or EIPs. Auto-assigned public IP addresses and EIPs are different in the following ways:
Auto-assigned public IP addresses
When ECS instances are created in VPCs, public IP addresses can be automatically assigned to the instances. The auto-assigned public IP addresses cannot be disassociated from the instances.
EIPs are static public IP addresses that can be purchased and used as independent resources. You can associate and disassociate EIPs to and from ECS instances as needed. For more information, see Elastic IP addresses.
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.
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.
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.
The EIP is separately billed, and separate bills are generated. For more information about the billing of EIPs, see Billing overview.
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.
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.