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, as well as how to separately create an ENI and bind it to an existing instance.

Prerequisites

  • If you want to bind an ENI when you create an instance, make sure that the preparations for instance creation are complete. For more information, see Create an instance by using the wizard.
  • If you want to separately create an ENI 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 Instances of specific instance types must be in the Stopped state before you can bind secondary ENIs to the instances. 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 families.
    • The instance is restarted if the last start time of the instance is earlier than April 1, 2018 and the instance remains in the Running state. 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.
    • An ENI is created and is in the Available state. For more information, see Create an ENI.
    • The instance and the ENI are in the same virtual private cloud (VPC).
    • The instance and the ENI reside in the same zone.

Background information

You can use one of the following methods to bind an ENI to an instance:

Bind an ENI when you create an instance

For information about how to create an instance, see Create an instance by using the wizard. When you bind an ENI during instance creation, take note of the following configurations for the 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 families.
    • Image: ENIs can be automatically identified without additional configurations if you select the following images:
      • 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 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 be connected to different vSwitches.

Bind an ENI to an existing instance on the Instances page

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Instances & Images > Instances.
  3. In the top navigation bar, select a region.
  4. Find the instance to which you want to bind an ENI and choose More > Network and Security Group > Bind Secondary ENI in the Actions column.
  5. 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

  1. Log on to the ECS console.
  2. In the left-side navigation pane, choose Network & Security > ENIs.
  3. In the top navigation bar, select a region.
  4. Find an available secondary ENI and click Bind to Instance in the Actions column.
  5. In the Bind to Instance dialog box, select an instance and click OK.
    Refresh the list. If the state of the ENI is Bound, the ENI is bound to the instance.

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.

Instance types for which instances must be in the Stopped state

Instances of specific instance types must be in the Stopped state before you can bind ENIs to or unbind ENIs from the instances. For more information, see Stop an instance.

The following table describes the instance types.
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.s6-c1m1.small, ecs.s6-c1m2.large, ecs.s6-c1m2.small, ecs.s6-c1m4.large, and ecs.s6-c1m4.small
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
  • ecs.xn4.small
  • ecs.n4.small and ecs.n4.large
  • ecs.mn4.small and ecs.mn4.large
  • ecs.e4.small and ecs.e4.large