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 Overview of instance families.
- 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. Important 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 Overview of instance families.
- 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.
You can create or delete ENIs, bind ENIs to instances, or unbind ENIs from instances. You can configure notifications for ENI operation events by using CloudMonitor to obtain 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
- 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. After you bind the ENI to the instance, you can go to the Instance Details page of the instance and view the state of the ENI on the ENIs tab. If the 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 Network Interfaces page
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Find an available secondary ENI and click Bind to Instance in the Actions column.
- In the Bind to Instance dialog box, select an instance and click OK. Refresh the ENI list. If the 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 Security Groups page
- Log on to the ECS console.
- In the left-side navigation pane, choose .
- In the top navigation bar, select a region.
- Find the security group to which an available ENI belongs and click Manage ENIs in the Actions column.
- On the ENIs in Security Group page, find the ENI and click Bind to Instance in the Actions column.
- In the Bind to Instance dialog box, select an instance and click OK. After you bind the ENI to the instance, you can choose the InUse is displayed in the Status/Creation Time column corresponding to the ENI.in the left-side navigation pane and view the state of the ENI on the Network Interfaces page. If the ENI is bound to the instance,
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 |
|