You can use elastic network interfaces (ENIs) to deploy high availability clusters and perform low-cost failover and fine-grained network management. This topic describes how to bind an ENI when you create an instance or separately create an ENI and bind it to an existing instance.
Prerequisites
- If you want to bind an ENI when you create an instance, the preparations for instance creation must be complete. For more information, see Create an instance by using the provided wizard.
- If you want to separately create an ENI and bind the ENI to an existing instance,
take note of the following items:
- A secondary ENI is created and is in the Available state. For more information, see Create an ENI.
- The instance to which the ENI is to be bound is of an I/O optimized instance type and is in the Stopped or Running state. The network type of the instance is VPC.
- The instance and the ENI are in the same VPC.
- The VSwitch of the ENI are in the same zone as the instance.
- The maximum number of ENIs that can be bound to the instance is not reached.
Note An ENI can be bound to only one ECS instance at a time. However, an ECS instance can have multiple ENIs. For information about the maximum numbers of ENIs that can be bound to instances of different instance types, see Instance families.
- If the last start time of the instance is earlier than April 1, 2018 and the instance
remains in the Running state, you must restart the instance. Otherwise, you cannot
bind ENIs to the instance. Applicable scenarios include starting new instances, and
restarting and reactivating instances.
Notice To restart an ECS instance, you must use the ECS console or call the RebootInstance operation. You cannot restart an instance from within the operating system.
Background information
- Bind an ENI when you create an instance.
When you create an instance in the console, you can bind only a primary and a secondary ENIs to the instance. For more information, see Bind an ENI when you create an instance.
- Separately create an ENI and bind it to an existing instance.
You can perform this operation on the Instances or Network Interfaces page in the console. For more information, see Bind an ENI to an existing instance on the Instances page or Bind an ENI to an existing instance on the Network Interfaces page.
Bind an ENI when you create an instance
- Basic configurations:
- Region: ENIs are available in all regions.
- Instance Type: Select an I/O optimized instance type that supports ENIs. For more information, see Instance families.
- Image: The following images can automatically identify ENIs without the need to configure
the ENIs.
- CentOS 7.3 64-bit
- CentOS 6.8 64-bit
- Windows Server 2008 R2 and later
If you select an image that is not in the preceding list, you must configure the ENIs so that they can be identified after the instance is created. For more information, see Configure an ENI.
- Networking:
- Network Type: You must select VPC. Select a VPC and a VSwitch for the instance.
- Elastic Network Interface: Click Add ENI to create an ENI. The ENI and the instance must be in the same zone but can belong to different VSwitches.
Bind an ENI to an existing instance on the Instances page
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Find the instance to which you want to bind an ENI, and choose Actions column. in the
- In the Bind Secondary ENI dialog box, select a secondary ENI and click OK.
Bind an ENI to an existing instance on the Network Interfaces page
What to do next
For some images used by ECS instances, you may need to manually configure the ENIs so that they can be identified by the instances. For more information, see Configure an ENI.