Specific Elastic Compute Service (ECS) instance types support configuring network card indexes to provide higher network performance. When you attach elastic network interfaces (ENIs) to ECS instances of an instance type that supports configuring network card indexes, you can specify network card indexes to attach the ENIs to different underlying communication channels. This way, you can maximize network bandwidth utilization and improve instance bandwidth capabilities.
Check whether an instance type supports configuring network card indexes
Only specific instance types support configuring network card indexes. You can call the DescribeInstanceTypes operation to check whether a specific instance type supports configuring network card indexes. Take note of the following network card index-related parameters in the response:
NetworkCardQuantity: the maximum number of network cards that the instance type supports. If the instance type does not support configuring network card indexes, this parameter is empty.
NetworkCards: the details of the network cards. If the instance type supports multiple network cards, the details of each network card are returned.
Specify a network card index when you attach an ENI
You can call the AttachNetworkInterface operation, with NetworkInterfaceId set to the ID of an ENI, InstanceId set to the ID of an ECS instance, and NetworkCardIndex set to a network card index, to attach the ENI to the ECS instance and assign the network card index to the ENI. To query the indexes of network cards supported by an instance type, call the DescribeInstanceTypes operation. For more information, see the Check whether an instance type supports configuring network card indexes section of this topic.
View the network card index specified when the ENI was attached
You can call the DescribeNetworkInterfaceAttribute operation to query the attributes of an ENI. The NetworkCardIndex parameter in the response indicates the network card index specified when the ENI was attached.
If the ENI is in the Available state or no network card index was specified when the ENI was attached, this parameter is empty.
If the ENI is in the InUse state and a network card index was specified when the ENI was attached, the specified network card index is returned as the value of this parameter.