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 Elastic Compute Service (ECS) instance and how to create an ENI separately and bind it to an existing instance.
Prerequisites
- If you want to bind an ENI when you create an instance, make sure that the required preparations are made. For more information, see Create an instance by using the wizard.
- If you want to create an ENI separately and bind it to an existing instance, make
sure that the following requirements are met:
- The instance to which you want to bind an ENI is of an I/O optimized instance type
and is in the Stopped or Running state.
Note For specific instance types, secondary ENIs can be bound to instances only when the instances are in the Stopped state. For more information about instance types, see Instance types for which instances must be in the Stopped state.
- The maximum number of ENIs that can be bound to the instance is not reached.
Note An ENI can be bound to only a single ECS instance at a time. However, an ECS instance can have multiple ENIs. For information about the maximum number of ENIs that can be bound per instance for different instance types, see Instance family.
- If the instance was last started, restarted, or reactivated before April 1, 2018 and
has remained in the Running state since then, you must restart the instance before
you can bind ENIs to it.
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.
- An ENI is created and is in the Available state. For more information, see Create an ENI.
- The instance and the ENI reside in the same virtual private cloud (VPC).
- The instance and the ENI reside in the same zone.
- The instance to which you want to bind an ENI is of an I/O optimized instance type
and is in the Stopped or Running state.
Background information
- Bind an ENI when you create an instance.
When you create an instance in the ECS console, you can bind only a primary ENI and a secondary ENI to the instance. For more information, see Bind an ENI when you create an instance.Note For specific instance types, you cannot bind secondary ENIs when you create instances. To bind secondary ENIs to instances of these instance types, wait until the instances are created. For more information, see Instance family.
- Create an ENI Separately and bind it to an existing instance.
You can perform this operation on the Instances, Network Interfaces, or Security Groups page in the ECS console. For more information, see Bind an ENI to an existing instance on the Instances page, Bind an ENI to an existing instance on the Network Interfaces page, and Bind an ENI to an existing instance on the Security Groups page.
After ENIs are created, deleted, bound to instances, or unbound from instances, ENI operation events are triggered. You can use CloudMonitor to set notifications of ENI operation events to obtain the ENI operation results such as whether ENIs are created. For more information, see ENI operation event notifications.
Bind an ENI when you create an instance
- Basic configurations:
- Region: ENIs are supported in all regions.
- Instance Type: Select an I/O optimized instance type that allows ENIs to be bound during instance creation. For more information, see Instance families.
- Image: ENIs can be automatically identified without additional configurations if you
select one of the following images:
- Alibaba Cloud Linux 3.2104 64-bit
- CentOS 8.0 64-bit, CentOS 8.1 64-bit, and CentOS 8.2 64-bit
- CentOS 7.3 64-bit, CentOS 7.4 64-bit, and CentOS 7.5 64-bit
- CentOS 6.8 64-bit and CentOS 6.9 64-bit
- Debian 10.5 64-bit and Debian 10.6 64-bit
- Windows Server 2008 R2 and later
If you select an image that is not in the preceding list, you must configure ENIs so that they can be identified after the instance is created. For more information, see Configure a secondary ENI.
- Networking configurations:
- Network Type: You must select VPC. Then, select a VPC and a vSwitch for the instance.
- Elastic Network Interface: Click Add ENI to create an ENI. An ENI and the instance to which it is bound must reside within the same zone but do not need to connect to the same vSwitch.
After the instance is created, you can go to its Instance Details page and view the state of ENIs on the ENIs tab. If an ENI is bound to the instance, InUse is displayed in the Status/Creation Time column corresponding to the ENI.
Bind an ENI to an existing instance on the Instances page
Bind an ENI to an existing instance on the Network Interfaces page
Bind an ENI to an existing instance on the Security Groups page
What to do next
For instances that use specific images, you may need to manually configure ENIs so that they can be identified by the instances. For more information, see Configure a secondary ENI.
Instance types for which instances must be in the Stopped state
For specific instance types, ENIs can be bound to or unbound from instances only when the instances are in the Stopped state. For more information, see Stop an instance.
Instance family | Instance type |
---|---|
s6, shared standard instance family | ecs.s6-c1m1.small, ecs.s6-c1m2.large, ecs.s6-c1m2.small, ecs.s6-c1m4.large, and ecs.s6-c1m4.small |
t6, burstable instance family | ecs.t6-c1m1.large, ecs.t6-c1m2.large, ecs.t6-c1m4.large, ecs.t6-c2m1.large, and ecs.t6-c4m1.large |
t5, burstable instance family | ecs.t5-c1m1.large, ecs.t5-c1m2.large, ecs.t5-c1m4.large, ecs.t5-lc1m1.small, ecs.t5-lc1m2.large, ecs.t5-lc1m2.small, ecs.t5-lc1m4.large, and ecs.t5-lc2m1.nano |
Previous-generation shared instance families xn4, n4, mn4, and e4 |
|