This topic describes how to attach an Elastic Network Interface (ENI). Specifically, you either attach an ENI when you create an ECS instance, or you can alternatively create an ENI separately and then attach it to an ECS instance. Attaching an ENI allows you to build clusters with higher availability, perform failovers with lower costs, and manage your network with finer granularity.
Attach an ENI when you create an ECS instanceLimits
If you attach a secondary ENI, as opposed to a primary ENI, to an ECS instance and do not detach it from the ECS instance, the secondary ENI will be released when you release the ECS instance. For more information, see Detach an ENI from an instance.Procedure
Before you begin, make sure that you have created an ECS instance. For the specific procedure, see Step 2: Create an instance.
- Basic configurations
- Region: ENIs are supported in all regions.
- Instance type: Select an I/O-optimized instance type that supports ENIs. For more information, see Instance type families.
- Image: The following image types support ENIs without any manual configuration required:
- CentOS 7.3 64-bit
- CentOS 6.8 64-bit
- Windows Server 2016 Datacenter Edition 64-bit
- Windows Server 2012 R2 Datacenter Edition 64-bit
For other image types, after you create an ECS instance, you must configure the ENI to enable the instance to support ENIs.
- Network: Select VPC, and then select a VPC and VSwitch that you created.
- ENI: Click Add ENI to attach the target ENI. The ENI and the instance must belong to the same VSwitch.
Note When you create an instance in the ECS console, you can attach up to two ENIs to the instance. One is the primary ENI, and the other is the secondary ENI. You can attach more secondary ENIs to the instance by using one of the following two methods:
Attach an ENI to an existing ECS instanceLimits
- The ENI can only be attached to the existing ECS instance as a secondary ENI, rather than a primary ENI.
- The ENI must be in the Available state.
- The ECS instance must be in the Stopped or Running state.
- The ENI can only be attached to a VPC ECS instance. The ENI and the instance must be in the same VPC.
- The VSwitch to which the ENI belongs must be in the same zone as the ECS instance to which the ENI is attached.
- The ENI can only be attached to an I/O-optimized instance.
- One ENI can be attached to only one VPC ECS instance, but one instance can be attached with multiple ENIs. For more information, see Instance type families.
- An ENI is created. For more information, see Create an ENI.
- The ENI is in the Available state.
- The instance can be attached with secondary ENIs and is in the Stopped or Running state. For more information, see Instance type families.
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- Locate an available ENI, and then click Bind to Instance.
- In the displayed dialog box, select the target instance, and then click OK.
What to do next
After you attach an ENI to an ECS instance, you can perform the following operations: