Todos los productos
Search
Centro de documentos

Elastic Compute Service:ModifyNetworkInterfaceAttribute

Última actualización: Sep 01, 2026

Modifica los atributos de una interfaz de red elástica (ENI), como el número de colas, los security groups asociados, la profundidad de cola, el modo de comunicación y si se debe conservar la ENI cuando se libera la instancia asociada.

Pruébelo ahora

Pruebe esta API en OpenAPI Explorer sin necesidad de firma manual. Las llamadas exitosas generan automáticamente código SDK acorde a sus parámetros. Descárguelo con seguridad de credenciales integrada para uso local.

Test

Autorización de RAM

La siguiente tabla describe la autorización necesaria para invocar esta API. Puede definirla en una directiva de Resource Access Management (RAM). A continuación, se detallan las columnas de la tabla:

  • Action: Estas acciones se utilizan en el elemento Action de las declaraciones de directivas de permisos de RAM para otorgar permisos que permitan realizar la operación.

  • API: La API que debe invocarse para llevar a cabo la acción.

  • Nivel de acceso: Nivel de acceso predefinido que se concede para cada API. Valores válidos: create, list, get, update y delete.

  • Tipo de recurso: Tipo de recurso que admite autorización para ejecutar la acción. Indica si la acción es compatible con permisos a nivel de recurso. El recurso especificado debe ser compatible con la acción; de lo contrario, la directiva no surtirá efecto.

    • En las API con permisos a nivel de recurso, los tipos de recursos obligatorios se marcan con un asterisco (*). Especifique el Alibaba Cloud Resource Name (ARN) correspondiente en el elemento Resource de la directiva.

    • Para las API sin permisos a nivel de recurso, se muestra All Resources. Utilice un asterisco (*) en el elemento Resource de la directiva.

  • Clave de condición: Claves de condición definidas por el servicio. Permiten un control granular y se aplican ya sea solo a acciones o a acciones asociadas con recursos específicos. Además de las claves de condición específicas del servicio, Alibaba Cloud proporciona un conjunto de common condition keys aplicables a todos los servicios compatibles con RAM.

  • Acción dependiente: Acciones dependientes necesarias para ejecutar la acción principal. Para completar la operación, el usuario de RAM o el rol de RAM debe contar con permisos para realizar todas las acciones dependientes.

Action

Nivel de acceso

Tipo de recurso

Clave de condición

Acción dependiente

ecs:ModifyNetworkInterfaceAttribute

update

*NetworkInterface

acs:ecs:{#regionId}:{#accountId}:eni/{#eniId}

*SecurityGroup

acs:ecs:{#regionId}:{#accountId}:securitygroup/{#securitygroupId}

Ninguna Ninguna

Parámetros de la solicitud

Parámetro

Tipo

Obligatorio

Descripción

Ejemplo

RegionId

string

Sí

El ID de región del controlador de interfaz de red (NIC). Puede invocar DescribeRegions para consultar la lista de regiones más reciente.

cn-hangzhou

NetworkInterfaceName

string

No

El nombre del controlador de interfaz de red (NIC). El nombre debe tener entre 2 y 128 caracteres de longitud y debe comenzar con una letra o un carácter chino. No puede comenzar con http:// o https://. El nombre puede contener caracteres clasificados como letras en Unicode, incluidas letras en inglés, caracteres chinos y dígitos. El nombre también puede contener dos puntos (:), guiones bajos (_), puntos (.) o guiones (-).

Valor predeterminado: vacío.

eniTestName

NetworkInterfaceId

string

Sí

El ID del controlador de interfaz de red (NIC).

eni-bp67acfmxazb4p****

QueueNumber

integer

No

El número de colas para la ENI. Valores válidos: de 1 a 2048.

  • Puede modificar el número de colas de una ENI que esté en estado Available, o de una ENI que esté en estado InUse pero conectada a una instancia en estado Stopped.

  • El número de colas no puede exceder el número máximo de colas por ENI permitido por el tipo de instancia. El número total de colas en todas las ENI de una instancia no puede exceder la cuota total de colas permitida por el tipo de instancia. Puede llamar a DescribeInstanceTypes para consultar los campos MaximumQueueNumberPerEni y TotalEniQueueQuantity del tipo de instancia.

8

Description

string

No

La descripción del controlador de interfaz de red (NIC). La descripción debe tener entre 2 y 255 caracteres de longitud y no puede comenzar con http:// o https://.

Valor predeterminado: vacío.

testDescription

SecurityGroupId

array

No

La lista de ID de security groups. El controlador de interfaz de red (NIC) secundario se une a los security groups especificados y se elimina de los security groups existentes.

  • Los valores válidos de N dependen del número máximo de security groups a los que puede pertenecer un controlador de interfaz de red (NIC). Para obtener más información, consulte Límites.

  • La modificación surte efecto en breve, pero puede producirse un ligero retraso.

string

No

La lista de ID de security groups.

  • Los valores válidos de N dependen del número máximo de security groups a los que puede pertenecer un controlador de interfaz de red (NIC). Para obtener más información, consulte Límites.

  • Solo puede modificar los security groups de las ENI secundarias.

  • Después de configurar los security groups, la ENI secundaria se une a los security groups especificados y se elimina de los security groups existentes.

  • La modificación surte efecto en breve, pero puede producirse un ligero retraso.

sg-bp67acfmxazb4p****

DeleteOnRelease

boolean

No

Especifica si se debe conservar la ENI cuando se libera la instancia asociada. Valores válidos:

  • true: la ENI no se conserva.

  • false: la ENI se conserva.

true

RxQueueSize

integer

No

La profundidad de la cola de entrada del controlador de interfaz de red (NIC).

Nota

Este parámetro se encuentra en vista previa por invitación y no está disponible públicamente. Para utilizar este parámetro, envíe un ticket para solicitar acceso.

Tenga en cuenta los siguientes puntos:

  • Este parámetro solo aplica a instancias de séptima generación o posteriores.

  • Actualmente, este parámetro solo aplica a imágenes de Linux.

  • Una mayor profundidad de cola de entrada puede mejorar el rendimiento de entrada y reducir la pérdida de paquetes, pero consume más memoria.

8192

TxQueueSize

integer

No

La profundidad de la cola de salida del controlador de interfaz de red (NIC).

Nota

Este parámetro se encuentra en vista previa por invitación y no está disponible públicamente. Para utilizar este parámetro, envíe un ticket para solicitar acceso.

Tenga en cuenta los siguientes puntos:

  • Este parámetro solo aplica a instancias de séptima generación o posteriores.

  • Actualmente, este parámetro solo aplica a imágenes de Linux.

  • Una mayor profundidad de cola de salida puede mejorar el rendimiento de salida y reducir la pérdida de paquetes, pero consume más memoria.

8192

NetworkInterfaceTrafficConfig

object

No

El parámetro de comunicación del controlador de interfaz de red (NIC).

NetworkInterfaceTrafficMode

string

No

El patrón de comunicación del controlador de interfaz de red (NIC). Valores válidos:

  • Standard: utiliza el patrón de comunicación TCP.

  • HighPerformance: habilita la interfaz RDMA elástica (ERI) y utiliza el patrón de comunicación RDMA.

Cuando el controlador de interfaz de red (NIC) está en estado conectado, tenga en cuenta los siguientes puntos:

  • El número total de controladores de interfaz de red (NIC) RDMA de una instancia no puede exceder la cuota de controladores de interfaz de red (NIC) RDMA permitida por el tipo de instancia. Puede llamar a DescribeInstanceTypes para consultar el campo EriQuantity correspondiente a la cuota de controladores de interfaz de red (NIC) RDMA.

Nota

Este parámetro se encuentra en vista previa por invitación y no está disponible públicamente.

HighPerformance

QueueNumber

integer

No

El número de colas para el controlador de interfaz de red (NIC). Cuando el controlador de interfaz de red (NIC) está en estado conectado, tenga en cuenta los siguientes puntos:

  • El valor no puede exceder el número máximo de colas por controlador de interfaz de red (NIC) permitido por el tipo de instancia.

  • El número total de colas en todos los controladores de interfaz de red (NIC) de una instancia no puede exceder la cuota total de colas permitida por el tipo de instancia. Puede llamar a DescribeInstanceTypes para consultar los campos MaximumQueueNumberPerEni y TotalEniQueueQuantity.

Nota

Este parámetro se encuentra en vista previa por invitación y no está disponible públicamente.

8

QueuePairNumber

integer

No

El número de colas RDMA para el controlador de interfaz de red (NIC). Cuando el controlador de interfaz de red (NIC) está en estado conectado, tenga en cuenta los siguientes puntos:

  • El valor no puede exceder el número máximo de colas por controlador de interfaz de red (NIC) RDMA permitido por el tipo de instancia. Puede llamar a DescribeInstanceTypes para consultar el campo QueuePairNumber correspondiente al número máximo de colas por controlador de interfaz de red (NIC) RDMA.

Nota

Este parámetro se encuentra en vista previa por invitación y no está disponible públicamente.

8

RxQueueSize

integer

No

La profundidad de la cola de entrada del controlador de interfaz de red (NIC).

Nota

Este parámetro se encuentra en vista previa por invitación y no está disponible públicamente. Para utilizar este parámetro, envíe un ticket para solicitar acceso.

Tenga en cuenta los siguientes puntos:

  • Este parámetro solo aplica a instancias de séptima generación o posteriores.

  • Actualmente, este parámetro solo aplica a imágenes de Linux.

  • Una mayor profundidad de cola de entrada puede mejorar el rendimiento de entrada y reducir la pérdida de paquetes, pero consume más memoria.

8192

TxQueueSize

integer

No

La profundidad de la cola de salida del controlador de interfaz de red (NIC).

Nota

Este parámetro se encuentra en vista previa por invitación y no está disponible públicamente. Para utilizar este parámetro, envíe un ticket para solicitar acceso.

Tenga en cuenta los siguientes puntos:

  • Este parámetro solo aplica a instancias de séptima generación o posteriores.

  • Actualmente, este parámetro solo aplica a imágenes de Linux.

  • Una mayor profundidad de cola de salida puede mejorar el rendimiento de salida y reducir la pérdida de paquetes, pero consume más memoria.

8192

ConnectionTrackingConfiguration

object

No

La configuración de seguimiento de conectividad de red.

Antes de utilizar este parámetro, lea Gestión de tiempo de espera de conexión.

TcpEstablishedTimeout

integer

No

El período de tiempo de espera para conexiones TCP establecidas. Unidad: segundos. Valores válidos: [30, 60, 80, 100, 200, 300, 500, 700, 910].

Valor predeterminado: 910.

910

TcpClosedAndTimeWaitTimeout

integer

No

El período de tiempo de espera para conexiones TCP en los estados TIME_WAIT y CLOSED. Unidad: segundos. Valores válidos: números enteros del 3 al 15.

Valor predeterminado: 3.

Nota

Si su instancia de ECS se utiliza con NLB o CLB, el período de tiempo de espera predeterminado para conexiones en estado TIME_WAIT es de 15 segundos.

3

UdpTimeout

integer

No

El período de tiempo de espera para flujos UDP. Unidad: segundos. Valores válidos: [10, 20, 30, 60, 80, 100].

Valor predeterminado: 30.

Nota

Si su instancia de ECS se utiliza con NLB o CLB, el valor predeterminado es de 100 segundos.

30

EnhancedNetwork

object

No

Este parámetro no está disponible públicamente.

EnableSriov

boolean

No

Este parámetro no está disponible públicamente.

true

EnableRss

boolean

No

Nota

Este parámetro no está disponible públicamente.

false

VirtualFunctionTotalQueueNumber

integer

No

VirtualFunctionQuantity

integer

No

EnableExpress

boolean

No

SourceDestCheck

boolean

No

Especifica si se debe habilitar la verificación de origen/destino. Se recomienda habilitar esta función para mejorar la seguridad de la red. Valores válidos:

  • true: habilitado.

  • false: deshabilitado.

Valor predeterminado: false.

Nota

Solo algunas regiones admiten esta función. Antes de utilizarla, lea Verificación de origen/destino.

false

EnablePrimaryIPv6

boolean

No

Elementos de la respuesta

Elemento

Tipo

Descripción

Ejemplo

object

El ID de la solicitud.

RequestId

string

El ID de la solicitud.

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

Ejemplos

Respuesta exitosa

JSON Formato

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

Códigos de error

Código de estado HTTP

Código de error

Mensaje de error

Descripción

400 InvalidOperation.NotSupportModifyQueueNumber %s
400 MissingParameter %s A parameter is not specified.
400 UnsupportedParameter %s The parameter is not supported.
400 InvalidParameter %s The specified parameter is invalid.
400 InvalidInstanceID.Malformed %s The specified InstanceId parameter is invalid.
400 InvalidOperation.InvalidEcsState %s This operation is not allowed in the current cloud service status.
400 InvalidOperation.InvalidEniState %s The current state of the ENI does not allow this operation.
400 InvalidOperation.DetachPrimaryEniNotAllowed %s Detaching the primary ENI from an instance is not allowed.
400 InvalidParams.EniId %s The specified EniId parameter is invalid.
400 Forbidden.RegionId %s The service is unavailable in the current region.
400 JoinedGroupLimitExceed %s The 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.
400 InvalidEniQueueSize.RegionOrUserNotSupported The 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.
400 InvalidParameter.EniQueueSize The specified parameter TxQueueSize and RxQueueSize are not equal or exceed limit. The specified parameter TxQueueSize and RxQueueSize are not equal or exceed limit.
400 InvalidParameter.Conflict %s The specified parameter is invalid. Check whether parameter conflicts exist. %s is a variable. An error message is dynamically returned based on call conditions.
400 InvalidConnectionTrackingConfiguration.RegionOrUserNotSupported The 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.
400 InvalidParameter.InvalidQueuePairNumber The specified parameter QueuePairNumber exceeds limit. The number of queues on the specified ERI exceeds the limit.
400 InvalidParameter.EniConnectionTrackingConfiguration The specify network interface connection tracking configuration exceeds limit. The network connection configuration of the ENI is out of range.
400 InvalidOperation.MaxEniQueuePairNumberExceed The 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.
400 InvalidOperation.HighPerformanceEniPerInstanceLimitExceeded The 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.
400 InvalidOperation.InstanceTypeNotSupportHighPerformance The 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.
400 InvalidTrafficMode.ModifyToStandardNotSupported The specified parameter NetworkInterfaceTrafficMode is not supported to modify to Standard. You cannot set the NetworkInterfaceTrafficMode parameter of the ENI to Standard.
400 InvalidOperation.EniTrafficModeNotSupportIPv6 The ENI using High Performance traffic mode does not support IPv6. ENIs that use the RDMA communication mode do not support IPv6.
400 InvalidOperation.EniQueuePairNumberOverflow The 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.
400 InvalidParameter.QueuePairNumberMustEmpty When 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.
400 InvalidParameter.EniTrafficMode The ENI traffic mode is set incorrectly, it must be either Standard or HighPerformance. The NetworkInterfaceTrafficMode value is invalid. Valid values: Standard and HighPerformance.
400 InvalidOperation.InstanceTypeNotSupportRss The ECS instance type does not support Rss. The ECS instance type does not support Rss.
400 InvalidParameter.EniEnhancedNetwork The input parameter "EnhancedNetwork" is illegal, when EnableSriov is true, VirtualFunctionTotalQueueNumber must not be empty, and VirtualFunctionQuantity must be 1 to 256. When EnableSriov is empty or false, VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity must be empty. The specified network enhancement function parameter is illegal. When the EnableSriov is set to true, the VirtualFunctionTotalQueueNumber must not be empty and the VirtualFunctionQuantity value range is 1-256; When the EnableSriov is empty or set to false, the VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity must be empty
400 InvalidOperation.NotSupportModifyVFQueueNumberAndVFQuantity The ENI not support modify VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity when EnableSriov is true. The ENI not support modify VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity when EnableSriov is true.
400 InvalidOperation.TrunkAttachmentMustEmpty The Attachment of the current Trunk type Network Interface must be empty when modify EnableSriov to true. The Attachment of the current Trunk type Network Interface must be empty when modify EnableSriov to true.
400 Throttling Request was denied due to request throttling, try again later. Requests are too frequent due to resource or account dimensions, please try again later.
400 InvalidOperation.SourceDestCheckUnsupported Modifying sourceDestCheck attribute for network interface is not allowed in the %s region. The current region does not support modifying the ENI SourceDestCheck attributes.
400 InvalidOperation.EnablePrimaryIPv6 The specified ENI can not enable primary IPv6 or already has primary IPv6. The specified ENI can not enable primary IPv6 or already has primary IPv6.
500 InternalError The request processing has failed due to some unknown error, exception or failure. An internal error has occurred. Try again later.
403 InvalidUserType.NotSupported %s Your account does not support this operation.
403 Abs.InvalidAccount.NotFound %s Your Alibaba Cloud account does not exist or your AccessKey pair has expired.
403 Forbidden.NotSupportRAM %s RAM users are not authorized to perform this operation.
403 Forbidden.SubUser %s You are not authorized to manage this resource. Contact the owner of the Alibaba Cloud account for authorization.
403 MaxEniCountExceeded %s The maximum number of ENIs that can be managed has been reached.
403 EniPerInstanceLimitExceeded %s The maximum number of ENIs that can be attached to the specified instance has been reached.
403 InvalidOperation.AvailabilityZoneMismatch %s The operation is invalid.
403 InvalidOperation.VpcMismatch %s The operation is invalid. Check whether the VPC in the operation corresponds to other parameters.
403 SecurityGroupInstanceLimitExceed %s The maximum number of instances in the security group has been reached.
403 InvalidSecurityGroupId.NotVpc %s The specified SecurityGroupId parameter is invalid and the network type of the security group is not VPC.
403 InvalidOperation.InvalidEniType %s This operation is not allowed for the current network interface type.
403 InvalidOperation.EniServiceManaged %s The operation is invalid.
403 InvalidOperation.MultiGroupType The specified instance can't join different types of security group. The specified instance cannot be added to security groups of different types.
403 InvalidOperation.EniCountExceeded The maximum number of eni in a enterprise level security group is exceeded. The number of NICs in the enterprise security group exceeds the limit.
403 InvalidParams.NetworkInterfaceName %s
403 InvalidOperation.ModifyPrimaryEniQueueNumber Primary NetworkInterface is not allowed to modify queue number.
403 InvalidOperation.InvalidEniState Available status or ECS instance attached is Stopped is allowed to modify network interface queue number. The current state of the ENI does not allow this operation.
403 InvalidOperation.ResourceManagedByCloudProduct %s You cannot modify security groups managed by cloud services.
403 InvalidParameter.InvalidEniQueueNumber %s The number of Elastic Network Interface (ENI) queues is incorrect. For more information, see the actual return result of the %s placeholder in the error message.
403 InvalidOperation.MaxEniQueueNumberExceeded %s The number of Elastic Network Interface (ENI) queues exceeds the upper limit. For more information, see the actual return result of the %s placeholder in the error message.
403 InvalidOperation.ExceedInstanceTypeQueueNumber %s The 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.
403 AclLimitExceed %s The number of ACL rules for an ENI or instance exceeds the upper limit.
403 InvalidOperation.EniTypeUnsupported The specified eni type does not supported. The specified business type is not supported.
403 InvalidVSwitch.Ipv6NotEnabled The VSwitch of ENI does not support IPv6 feature.
404 InvalidEcsId.NotFound %s The specified instance ID does not exist.
404 InvalidEniId.NotFound %s
404 InvalidVSwitchId.NotFound %s The specified vSwitch does not exist.
404 InvalidSecurityGroupId.NotFound %s The specified security group ID does not exist.
404 InvalidOperation.PrimaryEniOnlySupportModifyNameAndDesc Primary NetworkInterface is only allowed to modify name and description. Primary ENIs can only have their names and descriptions modified.
404 InvalidParameter.SecurityGroupIdRepeated The specified security group ids has repeated. Duplicate security group IDs are specified. Check whether the specified SecurityGroupIds.N parameter is valid.
409 OperationConflict Request was denied due to conflict with a previous request,please try again later. A request conflict occurred. Wait a moment and try again, or submit a ticket.
409 TokenProcessing The previous token request is still processing. Please try again later.

Consulte Códigos de error para ver la lista completa.

Notas de la versión

Consulte Notas de la versión para ver la lista completa.