全部產品
Search
文件中心

Elastic Compute Service:ModifyNetworkInterfaceAttribute

更新時間:Aug 27, 2026

修改一個彈性網卡(ENI)的網卡佇列數、所屬安全性群組、佇列深度、通訊模式以及釋放執行個體時是否保留網卡等屬性。

調試

您可以在OpenAPI Explorer中直接運行該介面,免去您計算簽名的困擾。運行成功後,OpenAPI Explorer可以自動產生SDK程式碼範例。

調試

授權資訊

下表是API對應的授權資訊,可以在RAM權限原則語句的Action元素中使用,用來給RAM使用者或RAM角色授予調用此API的許可權。具體說明如下:

  • 操作:是指具體的許可權點。

  • 存取層級:是指每個操作的存取層級,取值為寫入(Write)、讀取(Read)或列出(List)。

  • 資源類型:是指操作中支援授權的資源類型。具體說明如下:

    • 對於必選的資源類型,用前面加 * 表示。

    • 對於不支援資源級授權的操作,用全部資源表示。

  • 條件關鍵字:是指雲產品自身定義的條件關鍵字。

  • 關聯操作:是指成功執行操作所需要的其他許可權。操作者必須同時具備關聯操作的許可權,操作才能成功。

操作

存取層級

資源類型

條件關鍵字

關聯操作

ecs:ModifyNetworkInterfaceAttribute

update

*NetworkInterface

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

*SecurityGroup

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

無 無

請求參數

名稱

類型

必填

描述

樣本值

RegionId

string

是

彈性網卡所在地域 ID。您可以呼叫 DescribeRegions 查看最新的阿里雲端地域清單。

cn-hangzhou

NetworkInterfaceName

string

否

彈性網卡的名稱。長度為 2~128 個字元,必須以大小寫字母或中文開頭,不能以 http:// 和 https:// 開頭。支援 Unicode 中 letter 分類下的字元(其中包括英文、中文和數字等)。可以包含半形冒號(:)、底線(_)、半形句號(.)或者連字號(-)。

預設值:空。

eniTestName

NetworkInterfaceId

string

是

彈性網卡 ID。

eni-bp67acfmxazb4p****

QueueNumber

integer

否

網卡佇列數。取值範圍:1~2048。

  • 允許修改處於可用狀態(Available)的網卡佇列數,或者已附加(InUse)至執行個體但執行個體為已停止(Stopped)狀態的網卡佇列數。

  • 網卡佇列數不能超過執行個體規格允許的單塊網卡最大佇列數,同時執行個體的所有網卡累加佇列數不能超過執行個體規格允許的佇列數總配額。執行個體規格的單塊網卡最大佇列數和總配額可以透過 DescribeInstanceTypes 介面查詢 MaximumQueueNumberPerEni、TotalEniQueueQuantity 欄位。

8

Description

string

否

彈性網卡的描述資訊。長度為 2~255 個英文或中文字元,不能以 http:// 和 https:// 開頭。

預設值:空。

testDescription

SecurityGroupId

array

否

SecurityGroupId 清單,輔助彈性網卡最終加入的安全性群組,並會移出已有的安全性群組。

  • N 的取值範圍與每張彈性網卡能夠加入的安全性群組數量配額有關,更多資訊,請參見使用限制。

  • 修改安全性群組後很快會生效,但可能有較小的延遲。

string

否

SecurityGroupId 清單。

  • N 的取值範圍與每張彈性網卡能夠加入的安全性群組數量配額有關,更多資訊,請參見使用限制。

  • 只允許修改輔助網卡的安全性群組。

  • 設定安全性群組後,輔助彈性網卡會加入該安全性群組,並且移出已有安全性群組。

  • 修改安全性群組後很快會生效,但可能有較小的延遲。

sg-bp67acfmxazb4p****

DeleteOnRelease

boolean

否

釋放執行個體時是否保留網卡。取值範圍:

  • true:不保留。

  • false:保留。

true

RxQueueSize

integer

否

彈性網卡入方向佇列深度。

說明

該參數正在邀測中,暫未開放使用,如有需求請提交工單聯絡加白。

您需要注意:

  • 僅適用於第 7 代及以後 ECS 規格。

  • 目前僅適用於 Linux 映像。

  • 較大的入方向佇列深度可以提升入方向的輸送量,降低丟包機率,但會佔用更多的記憶體。

8192

TxQueueSize

integer

否

彈性網卡出方向佇列深度。

說明

該參數正在邀測中,暫未開放使用,如有需求請提交工單聯絡加白。

您需要注意:

  • 僅適用於第 7 代及以後 ECS 規格。

  • 目前僅適用於 Linux 映像。

  • 較大的出方向佇列深度可以提升出方向的輸送量,降低丟包機率,但會佔用更多的記憶體。

8192

NetworkInterfaceTrafficConfig

object

否

彈性網卡通訊參數。

NetworkInterfaceTrafficMode

string

否

網卡的通訊模式。參數取值範圍:

  • Standard:使用 TCP 通訊模式。

  • HighPerformance:開啟 ERI(Elastic RDMA Interface)介面,使用 RDMA 通訊模式。

當彈性網卡處於掛載狀態時,您需要注意:

  • 執行個體的所有 RDMA 網卡數不能超過執行個體規格允許的 RDMA 網卡數配額。執行個體規格允許的 RDMA 網卡數配額可以透過 DescribeInstanceTypes 介面查詢 EriQuantity 欄位。

說明

該參數正在邀測中,暫未開放使用。

HighPerformance

QueueNumber

integer

否

彈性網卡佇列數。 當彈性網卡處於掛載狀態時,您需要注意:

  • 不能超過執行個體規格允許的單塊網卡最大佇列數。

  • 執行個體的所有網卡累加佇列數不能超過執行個體規格允許的佇列數總配額。執行個體規格的單塊網卡最大佇列數和總配額可以透過 DescribeInstanceTypes 介面查詢 MaximumQueueNumberPerEni、TotalEniQueueQuantity 欄位。

說明

該參數正在邀測中,暫未開放使用。

8

QueuePairNumber

integer

否

RDMA 網卡佇列數。 當彈性網卡處於掛載狀態時,您需要注意:

  • 不能超過執行個體規格允許的單塊 RDMA 網卡最大佇列數。執行個體規格允許的單塊 RDMA 網卡最大佇列數可以透過 DescribeInstanceTypes 介面查詢 QueuePairNumber 欄位。

說明

該參數正在邀測中,暫未開放使用。

8

RxQueueSize

integer

否

彈性網卡入方向佇列深度。

說明

該參數正在邀測中,暫未開放使用,如有需求請提交工單聯絡加白。

您需要注意:

  • 僅適用於第 7 代及以後 ECS 規格。

  • 目前僅適用於 Linux 映像。

  • 較大的入方向佇列深度可以提升入方向的輸送量,降低丟包機率,但會佔用更多的記憶體。

8192

TxQueueSize

integer

否

彈性網卡出方向佇列深度。

說明

該參數正在邀測中,暫未開放使用,如有需求請提交工單聯絡加白。

您需要注意:

  • 僅適用於第 7 代及以後 ECS 規格。

  • 目前僅適用於 Linux 映像。

  • 較大的出方向佇列深度可以提升出方向的輸送量,降低丟包機率,但會佔用更多的記憶體。

8192

ConnectionTrackingConfiguration

object

否

網路連線追蹤配置資訊集合。

使用該參數前,請認真閱讀連線逾時管理。

TcpEstablishedTimeout

integer

否

已建立狀態的 TCP 連線逾時時間,單位:s(秒)。取值範圍:[30, 60, 80, 100, 200, 300, 500, 700, 910]。

預設值:910。

910

TcpClosedAndTimeWaitTimeout

integer

否

TCP 等待與關閉逾時時間,單位:s(秒)。取值範圍:3~15 內的整數。

預設值:3。

說明

如果您的 ECS 執行個體配合 NLB/CLB 使用,TIME_WAIT 狀態的連線逾時時間預設值為 15 秒。

3

UdpTimeout

integer

否

UDP 流逾時時間。單位:s(秒)。取值範圍:[10, 20, 30, 60, 80, 100]。

預設值:30。

說明

如果您的 ECS 執行個體配合 NLB/CLB 使用,預設值為 100 秒。

30

EnhancedNetwork

object

否

該參數暫未開放使用。

EnableSriov

boolean

否

該參數暫未開放使用。

true

EnableRss

boolean

否

說明

該參數暫未開放使用。

false

VirtualFunctionTotalQueueNumber

integer

否

VirtualFunctionQuantity

integer

否

EnableExpress

boolean

否

SourceDestCheck

boolean

否

是否開啟來源/目的地檢查功能。建議您開啟該功能,以提高網路安全性。可能值:

  • true:是。

  • false:否。

預設值:false。

說明

僅部分地域支援該功能。使用前,請認真閱讀來源/目的地檢查。

false

EnablePrimaryIPv6

boolean

否

返回參數

名稱

類型

描述

樣本值

object

請求 ID。

RequestId

string

請求 ID。

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

樣本

正常返回樣本

JSON格式

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

錯誤碼

HTTP status code

錯誤碼

錯誤資訊

描述

400 InvalidOperation.NotSupportModifyQueueNumber %s
400 MissingParameter %s 多個參數中必須至少填寫其中一個(不能全為空)。
400 UnsupportedParameter %s 指定參數不支援。
400 InvalidParameter %s 指定的參數組合不符合要求。
400 InvalidInstanceID.Malformed %s
400 InvalidOperation.InvalidEcsState %s 當前執行個體的狀態不支援該操作。
400 InvalidOperation.InvalidEniState %s 當前 ENI 的狀態不允許修改該網卡屬性。
400 InvalidOperation.DetachPrimaryEniNotAllowed %s 不允許分離執行個體的主網卡。
400 InvalidParams.EniId %s 指定的參數 EniId 無效。
400 Forbidden.RegionId %s 目前地域暫時沒有提供該服務。
400 JoinedGroupLimitExceed %s 指定資源所能加入的安全性群組數量達到上限。具體資訊請參見錯誤訊息 %s 預留位置符號的實際返回結果。
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. 地域或使用者不支援設定網卡佇列深度。
400 InvalidParameter.EniQueueSize The specified parameter TxQueueSize and RxQueueSize are not equal or exceed limit. 出方向和入方向網卡佇列深度不相等或不在允許的取值範圍內。
400 InvalidParameter.Conflict %s 目前操作不允許同時設定 diskId 和 imageId,請確保 diskId 或 imageId 有一個不為空。
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. 地域或使用者不支援設定網卡連線設定。
400 InvalidParameter.InvalidQueuePairNumber The specified parameter QueuePairNumber exceeds limit. 指定的 RDMA 網卡佇列數超過限制。
400 InvalidParameter.EniConnectionTrackingConfiguration The specify network interface connection tracking configuration exceeds limit. 網卡指定的網路連線設定超出允許的範圍。
400 InvalidOperation.MaxEniQueuePairNumberExceed The QueuePairNumber on the RDMA ENI exceeds the upper limit allowed for a single ENI. 彈性網卡關聯的 ECS 執行個體總 RDMA 佇列數超出規格限制。
400 InvalidOperation.HighPerformanceEniPerInstanceLimitExceeded The number of RDMA ENIs attached to the ECS instance exceeds the upper limit. 目前 ECS 綁定的啟用 RDMA 能力的網卡數量超過了目標規格的限制。
400 InvalidOperation.InstanceTypeNotSupportHighPerformance The ECS instance type where the ENI is located does not support the RDMA mode. 彈性網卡所在的 ECS 執行個體規格不支援 RDMA 通訊模式。
400 InvalidTrafficMode.ModifyToStandardNotSupported The specified parameter NetworkInterfaceTrafficMode is not supported to modify to Standard. 指定的參數「網卡通訊模式」不允許由 RDMA 通訊模式修改為 TCP 通訊模式。
400 InvalidOperation.EniTrafficModeNotSupportIPv6 The ENI using High Performance traffic mode does not support IPv6.
400 InvalidOperation.EniQueuePairNumberOverflow The RDMA QueuePairNumber of the ECS instance associated with the specified ENI exceeds the limit. 執行個體彈性網卡的佇列對數之和超過了指定執行個體規格所支援的上限。
400 InvalidParameter.QueuePairNumberMustEmpty When the traffic mode is set to Standard, the QueuePairNumber must be empty. 當 Traffic Mode 為 Standard 類型時,指定的參數 QueuePairNumber 必須為空。
400 InvalidParameter.EniTrafficMode The ENI traffic mode is set incorrectly, it must be either Standard or HighPerformance. 彈性網卡的通訊模式不合法,取值範圍為 Standard 或 HighPerformance。
400 InvalidOperation.InstanceTypeNotSupportRss The ECS instance type does not support Rss. 指定執行個體的規格不支援啟用 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. 指定的網路增強功能參數不合法,當 EnableSriov 設定為 true 時,VirtualFunctionTotalQueueNumber 必須不為空,且 VirtualFunctionQuantity 取值範圍 1-256;當 EnableSriov 為空或設定為 false 時,VirtualFunctionTotalQueueNumber 和 VirtualFunctionQuantity 必須為空。
400 InvalidOperation.NotSupportModifyVFQueueNumberAndVFQuantity The ENI not support modify VirtualFunctionTotalQueueNumber and VirtualFunctionQuantity when EnableSriov is true. 當 EnableSriov 為 true 時,不支援修改 VirtualFunctionTotalQueueNumber 和 VirtualFunctionQuantity。
400 InvalidOperation.TrunkAttachmentMustEmpty The Attachment of the current Trunk type Network Interface must be empty when modify EnableSriov to true. 當修改 EnableSriov 為 true 時,Trunk 網卡掛載的裝置必須為空。
400 Throttling Request was denied due to request throttling, try again later. 請求限流,請使用 nextToken 的分頁方式替代 PageNumber 的分頁方式進行查詢。
400 InvalidOperation.SourceDestCheckUnsupported Modifying sourceDestCheck attribute for network interface is not allowed in the %s region. 目前地域不支援修改彈性網卡 SourceDestCheck 屬性。
400 InvalidOperation.EnablePrimaryIPv6 The specified ENI can not enable primary IPv6 or already has primary IPv6. 指定的 ENI 無法開啟主要 IPv6 或已經含有主要 IPv6。
500 InternalError The request processing has failed due to some unknown error, exception or failure. 傳送請求時發生錯誤,請稍後重試。
403 InvalidUserType.NotSupported %s 使用者類型參數不合法。
403 Abs.InvalidAccount.NotFound %s 您的阿里雲帳號不存在,或者您的 AccessKey 已經過期。
403 Forbidden.NotSupportRAM %s 暫不支援 RAM 使用者執行該操作。
403 Forbidden.SubUser %s 您的帳號沒有操作此資源的權限,請向主帳號申請相關的權限。
403 MaxEniCountExceeded %s 已超過可以操作的最大彈性網路卡數。
403 EniPerInstanceLimitExceeded %s 執行個體附加的彈性網卡數量已經達到最大限度,無法再為執行個體附加彈性網卡。
403 InvalidOperation.AvailabilityZoneMismatch %s 彈性網卡和 ECS 執行個體的交換器不在同一個可用區內。
403 InvalidOperation.VpcMismatch %s 該彈性網卡的 VPC 和安全性群組的 VPC 不一致。
403 SecurityGroupInstanceLimitExceed %s 該安全性群組內已有的執行個體數量已達到最大限制。
403 InvalidSecurityGroupId.NotVpc %s 參數 SecurityGroupId 無效,該安全性群組的網路類型不是專有網路。
403 InvalidOperation.InvalidEniType %s 當前彈性網卡的類型不支援此操作。
403 InvalidOperation.EniServiceManaged %s 操作無效。
403 InvalidOperation.MultiGroupType The specified instance can't join different types of security group. 指定的執行個體無法加入不同類型的安全性群組。
403 InvalidOperation.EniCountExceeded The maximum number of eni in a enterprise level security group is exceeded. 當前 ECS 所綁定的彈性網卡數量超過了目標規格限制的彈性網卡數量。
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. 當前 ENI 的狀態不允許修改該網卡屬性。
403 InvalidOperation.ResourceManagedByCloudProduct %s 此次操作不支援,因為資源被雲端產品託管。請聯絡對應的雲端產品確認原因。
403 InvalidParameter.InvalidEniQueueNumber %s 彈性網卡佇列數有誤,具體資訊請參見錯誤訊息 %s 預留位置的實際回傳結果。
403 InvalidOperation.MaxEniQueueNumberExceeded %s 彈性網卡佇列數超過上限,具體資訊請參見錯誤訊息 %s 預留位置的實際返回結果。
403 InvalidOperation.ExceedInstanceTypeQueueNumber %s 目前 ECS 執行個體綁定的彈性網卡佇列數超過了目標規格限制的網卡佇列數。
403 AclLimitExceed %s 網路卡或執行個體的安全性群組規則數量超過限額值。
403 InvalidOperation.EniTypeUnsupported The specified eni type does not supported. 指定的業務類型不支援。
403 InvalidVSwitch.Ipv6NotEnabled The VSwitch of ENI does not support IPv6 feature.
404 InvalidEcsId.NotFound %s 指定的執行個體 ID 不存在。
404 InvalidEniId.NotFound %s
404 InvalidVSwitchId.NotFound %s 指定的交換器不存在。
404 InvalidSecurityGroupId.NotFound %s 提供的安全性群組不存在。
404 InvalidOperation.PrimaryEniOnlySupportModifyNameAndDesc Primary NetworkInterface is only allowed to modify name and description. 主要網卡僅支援修改網卡名稱和描述。
404 InvalidParameter.SecurityGroupIdRepeated The specified security group ids has repeated. 安全性群組重複。
409 OperationConflict Request was denied due to conflict with a previous request,please try again later. 請求操作的資源與之前的請求衝突。
409 TokenProcessing The previous token request is still processing. Please try again later.

訪問錯誤中心查看更多錯誤碼。

變更歷史

更多資訊,參考變更詳情。