All Products
Search
Document Center

Elastic Compute Service:ModifyNetworkInterfaceAttribute

Last Updated:Dec 17, 2024

Modifies the attributes, such as the name, description, and security groups, of an elastic network interface (ENI). When you call this operation, you can specify parameters, such as NetworkInterfaceId and SecurityGroupId, in the request.

Debugging

You can run this interface directly in OpenAPI Explorer, saving you the trouble of calculating signatures. After running successfully, OpenAPI Explorer can automatically generate SDK code samples.

Authorization information

The following table shows the authorization information corresponding to the API. The authorization information can be used in the Action policy element to grant a RAM user or RAM role the permissions to call this API operation. Description:

  • Operation: the value that you can use in the Action element to specify the operation on a resource.
  • Access level: the access level of each operation. The levels are read, write, and list.
  • Resource type: the type of the resource on which you can authorize the RAM user or the RAM role to perform the operation. Take note of the following items:
    • The required resource types are displayed in bold characters.
    • If the permissions cannot be granted at the resource level, All Resources is used in the Resource type column of the operation.
  • Condition Key: the condition key that is defined by the cloud service.
  • Associated operation: other operations that the RAM user or the RAM role must have permissions to perform to complete the operation. To complete the operation, the RAM user or the RAM role must have the permissions to perform the associated operations.
OperationAccess levelResource typeCondition keyAssociated operation
ecs:ModifyNetworkInterfaceAttributeupdate
*NetworkInterface
acs:ecs:{#regionId}:{#accountId}:eni/{#eniId}
*SecurityGroup
acs:ecs:{#regionId}:{#accountId}:securitygroup/{#securitygroupId}
    none
none

Request parameters

ParameterTypeRequiredDescriptionExample
RegionIdstringYes

The region ID of the ENI. You can call the DescribeRegions operation to query the most recent region list.

cn-hangzhou
NetworkInterfaceNamestringNo

The name of the ENI. The name must be 2 to 128 characters in length. The name must start with a letter and cannot start with http:// or https://. The name can contain letters, digits, colons (:), underscores (_), periods (.), and hyphens (-).

This parameter is left empty by default.

eniTestName
NetworkInterfaceIdstringYes

The ID of the ENI.

eni-bp67acfmxazb4p****
QueueNumberintegerNo

The number of queues supported by the ENI. Valid values: 1 to 2048.

  • You can change only the number of queues supported by the secondary ENI.
  • You can change the number of queues supported by the secondary ENI only when the ENI is in the Available state or the ENI is attached (InUse) to an instance that is in the Stopped state.
  • The number of queues supported by the secondary ENI cannot exceed the maximum number of queues that the instance allows for each ENI. The total number of queues for all ENIs on the instance cannot exceed the queue quota that the instance allows. To query the maximum number of queues per ENI and the queue quota for an instance type, you can call the DescribeInstanceTypes operation and check the values of MaximumQueueNumberPerEni and TotalEniQueueQuantity in the response.
8
DescriptionstringNo

The description of the ENI. The description must be 2 to 255 characters in length and cannot start with http:// or https://.

This parameter is left empty by default.

testDescription
SecurityGroupIdarrayNo

The IDs of the security groups to which to add the secondary ENI. The secondary ENI is added to the specified security groups and removed from the original security groups.

  • The valid values of N vary based on the maximum number of security groups to which an ENI can be added. For more information, see the Security group limits section of the "Limits and quotas" topic.
  • The new security groups take effect after a short delay.
stringNo

The ID of security group N.

  • The valid values of N vary based on the maximum number of security groups to which an ENI can be added. For more information, see the Security group limits section of the "Limits and quotas" topic.
  • You can change only the security groups to which a secondary ENI is added.
  • After you specify this parameter, the secondary ENI is added to the specified security groups and removed from the original security groups.
  • The new security groups take effect after a short delay.
sg-bp67acfmxazb4p****
DeleteOnReleasebooleanNo

Specifies whether to release the ENI when the associated instance is released. Valid values:

  • true
  • false
true
RxQueueSizeintegerNo

The receive (Rx) queue depth of the ENI.

Take note of the following items:

  • The Rx queue depth of an ENI must be the same as the transmit (Tx) queue depth of the ENI. Valid values: powers of 2 in the range of 8192 to 16384.
  • A larger Rx queue depth yields higher inbound throughput but consumes more memory.
8192
TxQueueSizeintegerNo

The Tx queue depth of the ENI.

Take note of the following items:

  • The Tx queue depth of an ENI must be the same as the Rx queue depth of the ENI. Valid values: powers of 2 in the range of 8192 to 16384.
  • A larger Tx queue depth yields higher outbound throughput but consumes more memory.
8192
NetworkInterfaceTrafficConfigobjectNo

The communication parameters of the ENI.

NetworkInterfaceTrafficModestringNo

The communication mode of the ENI. Valid values:

  • Standard: uses the TCP communication mode.
  • HighPerformance: uses the remote direct memory access (RDMA) communication mode with Elastic RDMA Interface (ERI) enabled.

When the ENI is in the InUse state, take note of the following items:

  • The total number of ERIs attached to the instance cannot exceed the ERI quota for the instance type. To query the ERI quota for an instance type, call the DescribeInstanceTypes operation and check the EriQuantity value in the response.
Note This parameter is in invitational preview and is not publicly available.
HighPerformance
QueueNumberintegerNo

The number of queues supported by the ENI. When the ENI is in the InUse state, take note of the following items:

  • The value of this parameter cannot exceed the maximum number of queues allowed per ENI for the instance type.
  • The total number of queues for all ENIs on the instance cannot exceed the queue quota for the instance type. To query the maximum number of queues per ENI and the queue quota for an instance type, call the DescribeInstanceTypes operation and check the MaximumQueueNumberPerEnig and TotalEniQueueQuantity values in the response.
Note This parameter is in invitational preview and is not publicly available.
8
QueuePairNumberintegerNo

The number of queues supported by the ERI. When the ERI is in the InUse state, take note of the following items:

  • The value of this parameter cannot exceed the maximum number of queues allowed per ERI for the instance type. To query the maximum number of queues allowed per ERI for an instance type, call the DescribeInstanceTypes operation and check the QueuePairNumber value in the response.
Note This parameter is in invitational preview and is not publicly available.
8
RxQueueSizeintegerNo

The receive (Rx) queue depth of the ENI.

Take note of the following items:

  • The Rx queue depth of an ENI must be the same as the transmit (Tx) queue depth of the ENI. Valid values: powers of 2 in the range of 8192 to 16384.
  • A larger Rx queue depth yields higher inbound throughput but consumes more memory.
Note This parameter is in invitational preview and is not publicly available.
8192
TxQueueSizeintegerNo

The Tx queue depth of the ENI.

Take note of the following items:

  • The Tx queue depth of an ENI must be the same as the Rx queue depth of the ENI. Valid values: powers of 2 in the range of 8192 to 16384.
  • A larger Tx queue depth yields higher outbound throughput but consumes more memory.
Note This parameter is in invitational preview and is not publicly available.
8192
ConnectionTrackingConfigurationobjectNo
Note This parameter is in invitational preview and is not publicly available.
TcpEstablishedTimeoutintegerNo
Note This parameter is in invitational preview and is not publicly available.
910
TcpClosedAndTimeWaitTimeoutintegerNo
Note This parameter is in invitational preview and is not publicly available.
3
UdpTimeoutintegerNo
Note This parameter is in invitational preview and is not publicly available.
30
EnhancedNetworkobjectNo

This parameter is not publicly available.

EnableSriovbooleanNo

This parameter is not publicly available.

true
SourceDestCheckbooleanNo
Note This parameter is in invitational preview and is not publicly available.
false

Response parameters

ParameterTypeDescriptionExample
object

The request ID.

RequestIdstring

The request ID.

473469C7-AA6F-4DC5-B3DB-A3DC0DE3****

Examples

Sample success responses

JSONformat

{
  "RequestId": "473469C7-AA6F-4DC5-B3DB-A3DC0DE3****"
}

Error codes

HTTP status codeError codeError messageDescription
400InvalidOperation.NotSupportModifyQueueNumber%s-
400MissingParameter%sA parameter is not specified.
400UnsupportedParameter%sThe parameter is not supported.
400InvalidParameter%sThe specified parameter is invalid.
400InvalidInstanceID.Malformed%sThe specified InstanceId parameter is invalid.
400InvalidOperation.InvalidEcsState%s-
400InvalidOperation.InvalidEniState%s-
400InvalidOperation.DetachPrimaryEniNotAllowed%s-
400InvalidParams.EniId%sThe specified EniId parameter is invalid.
400Forbidden.RegionId%sThe service is unavailable in the current region.
400JoinedGroupLimitExceed%sThe maximum number of security groups to which the specified resource can be added has been reached. For more information, see the return value of the %s placeholder in the error message.
400InvalidEniQueueSize.RegionOrUserNotSupportedThe specified parameter RxQueueSize or TxQueueSize is not supported in this region, or this account is not in the whitelist of using eni QueueSize.You are not authorized to specify the length of NIC queues or cannot specify the length of NIC queues in the current region.
400InvalidParameter.EniQueueSizeThe specified parameter TxQueueSize and RxQueueSize are not equal or exceed limit.The specified parameter TxQueueSize and RxQueueSize are not equal or exceed limit.
400InvalidParameter.Conflict%sThe specified parameter is invalid. Check whether parameter conflicts exist. %s is a variable. An error message is dynamically returned based on call conditions.
400InvalidConnectionTrackingConfiguration.RegionOrUserNotSupportedThe specified parameter ConnectionTrackingConfiguration is not supported in this region, or this account is not in the whitelist of using network interface ConnectionTrackingConfiguration.The specified parameter ConnectionTrackingConfiguration is not supported in this region, or this account is not in the whitelist of using network interface ConnectionTrackingConfiguration.
400InvalidParameter.InvalidQueuePairNumberThe specified parameter QueuePairNumber exceeds limit.The number of queues on the specified ERI exceeds the limit.
400InvalidParameter.EniConnectionTrackingConfigurationThe specify network interface connection tracking configuration exceeds limit.The network connection configuration of the ENI is out of range.
400InvalidOperation.MaxEniQueuePairNumberExceedThe QueuePairNumber on the RDMA ENI exceeds the upper limit allowed for a single ENI.The number of RDMA queues on the ENI exceeds the maximum number of RDMA queues allowed per ENI.
400InvalidOperation.HighPerformanceEniPerInstanceLimitExceededThe number of RDMA ENIs attached to the ECS instance exceeds the upper limit.The number of eRDMA interfaces (ERIs) on the ECS instance to which the ENI is attached exceeds the upper limit.
400InvalidOperation.InstanceTypeNotSupportHighPerformanceThe ECS instance type where the ENI is located does not support the RDMA mode.The instance type of the ECS instance to which the ENI is attached does not support the RDMA communication mode.
400InvalidTrafficMode.ModifyToStandardNotSupportedThe specified parameter NetworkInterfaceTrafficMode is not supported to modify to Standard.You cannot set the NetworkInterfaceTrafficMode parameter of the ENI to Standard.
400InvalidOperation.EniTrafficModeNotSupportIPv6The ENI using High Performance traffic mode does not support IPv6.ENIs that use the RDMA communication mode do not support IPv6.
400InvalidOperation.EniQueuePairNumberOverflowThe RDMA QueuePairNumber of the ECS instance associated with the specified ENI exceeds the limit.The number of RDMA queues on ENIs of the ECS instance to which the specified ENI is attached exceeds the upper limit.
400InvalidParameter.QueuePairNumberMustEmptyWhen the traffic mode is set to Standard, the QueuePairNumber must be empty.When you create an ENI that uses the TCP communication mode, do not specify the number of RDMA queues for the ENI.
400InvalidParameter.EniTrafficModeThe ENI traffic mode is set incorrectly, it must be either Standard or HighPerformance.The NetworkInterfaceTrafficMode value is invalid. Valid values: Standard and HighPerformance.
403InvalidUserType.NotSupported%sYour account does not support this operation.
403Abs.InvalidAccount.NotFound%sYour Alibaba Cloud account does not exist or your AccessKey pair has expired.
403Forbidden.NotSupportRAM%sRAM users are not authorized to perform this operation.
403Forbidden.SubUser%sYou are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization.
403MaxEniCountExceeded%sThe maximum number of ENIs that can be managed has been reached.
403EniPerInstanceLimitExceeded%sThe maximum number of ENIs that can be attached to the specified instance has been reached.
403InvalidOperation.AvailabilityZoneMismatch%sThe operation is invalid.
403InvalidOperation.VpcMismatch%sThe operation is invalid. Check whether the VPC in the operation corresponds to other parameters.
403SecurityGroupInstanceLimitExceed%s-
403InvalidSecurityGroupId.NotVpc%sThe specified SecurityGroupId parameter is invalid and the network type of the security group is not VPC.
403InvalidOperation.InvalidEniType%s-
403InvalidOperation.EniServiceManaged%sThe operation is invalid.
403InvalidOperation.MultiGroupTypeThe specified instance can't join different types of security group.-
403InvalidOperation.EniCountExceededThe maximum number of eni in a enterprise level security group is exceeded.-
403InvalidParams.NetworkInterfaceName%s-
403InvalidOperation.ModifyPrimaryEniQueueNumberPrimary NetworkInterface is not allowed to modify queue number.-
403InvalidOperation.InvalidEniStateAvailable status or ECS instance attached is Stopped is allowed to modify network interface queue number.-
403InvalidOperation.ResourceManagedByCloudProduct%sYou cannot modify security groups managed by cloud services.
403InvalidParameter.InvalidEniQueueNumber%s-
403InvalidOperation.MaxEniQueueNumberExceeded%s-
403InvalidOperation.ExceedInstanceTypeQueueNumber%sThe maximum number of queues for all ENIs on an instance has been exceeded. For more information, see the return value of the %s placeholder in the error message.
403AclLimitExceed%sThe number of ACL rules for an ENI or instance exceeds the upper limit.
404InvalidEcsId.NotFound%sThe specified instance ID does not exist.
404InvalidEniId.NotFound%sThe specified ENI ID does not exist.
404InvalidVSwitchId.NotFound%sThe specified vSwitch does not exist.
404InvalidSecurityGroupId.NotFound%sThe specified security group ID does not exist.
404InvalidOperation.PrimaryEniOnlySupportModifyNameAndDescPrimary NetworkInterface is only allowed to modify name and description.Primary ENIs can only have their names and descriptions modified.
404InvalidSecurityGroupId.NotFoundSpecified security group not exist.The specified security group does not exist in this account. Check whether the security group ID is correct.
404InvalidParameter.SecurityGroupIdRepeatedThe specified security group ids has repeated.Duplicate security group IDs are specified. Check whether the specified SecurityGroupIds.N parameter is valid.

For a list of error codes, visit the Service error codes.

Change history

Change timeSummary of changesOperation
2024-09-23The Error code has changedView Change Details
2024-09-14The Error code has changed. The request parameters of the API has changedView Change Details
2024-07-03The Error code has changedView Change Details
2024-07-03The Error code has changed. The request parameters of the API has changedView Change Details
2024-05-17The Error code has changed. The request parameters of the API has changedView Change Details
2024-05-07The Error code has changed. The request parameters of the API has changedView Change Details
2024-01-24The Error code has changed. The request parameters of the API has changedView Change Details
2023-10-09The Error code has changed. The request parameters of the API has changedView Change Details
2023-06-14The Error code has changedView Change Details