全部產品
Search
文件中心

Elastic Compute Service:ModifyNetworkInterfaceAttribute

更新時間:Oct 29, 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

否

啟用 SR-IOV 時,虛擬功能的總佇列數。

4

VirtualFunctionQuantity

integer

否

啟用 SR-IOV 時的虛擬功能數量。取值範圍:1~256。

1

EnableExpress

boolean

否

說明

該參數暫未開放使用。

SourceDestCheck

boolean

否

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

  • true:是。

  • false:否。

預設值:false。

說明

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

false

EnablePrimaryIPv6

boolean

否

是否為彈性網卡啟用主要 IPv6 位址。

返回參數

名稱

類型

描述

樣本值

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 當前網卡狀態,不允許此操作。
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 參數衝突。
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. 該彈性網卡 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. 不支援將彈性網卡的通訊模式改為 Standard 。
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. 指定的彈性網卡所在的ECS執行個體 RDMA 網卡佇列數超出限制。
400 InvalidParameter.QueuePairNumberMustEmpty When the traffic mode is set to Standard, the QueuePairNumber must be empty. 建立TCP通訊模式的彈性網卡時,彈性網卡的RDMA模式佇列數必須為空。
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. 請求被流控。
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 由於可用區不匹配,不允許此操作。
403 InvalidOperation.VpcMismatch %s 不允許此操作。
403 SecurityGroupInstanceLimitExceed %s 安全性群組的執行個體數已達上限。
403 InvalidSecurityGroupId.NotVpc %s 無效的安全性群組。
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. 企業安全性群組內網卡的數量達到了上限。
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. 當前網卡狀態,不允許此操作。
403 InvalidOperation.ResourceManagedByCloudProduct %s 雲端產品託管的安全性群組不支援修改操作。
403 InvalidParameter.InvalidEniQueueNumber %s 彈性網卡佇列數有誤,具體資訊請參見錯誤資訊%s佔位符的實際回傳結果。
403 InvalidOperation.MaxEniQueueNumberExceeded %s 彈性網卡佇列數超過上限,具體資訊請參見錯誤資訊%s佔位符的實際回傳結果。
403 InvalidOperation.ExceedInstanceTypeQueueNumber %s 彈性網卡佇列總數超過上限,具體資訊請參見錯誤資訊%s佔位符的實際回傳結果。
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 無效的執行個體。
404 InvalidEniId.NotFound %s
404 InvalidVSwitchId.NotFound %s 指定的虛擬交換器 ID 不存在。
404 InvalidSecurityGroupId.NotFound %s 指定的安全性群組在該用戶帳號下不存在,請您檢查安全性群組 id 是否正確。
404 InvalidOperation.PrimaryEniOnlySupportModifyNameAndDesc Primary NetworkInterface is only allowed to modify name and description. 主網卡僅支援修改網卡名稱和描述。
404 InvalidParameter.SecurityGroupIdRepeated The specified security group ids has repeated. 指定的安全性群組已重複新增。請檢查 SecurityGroupIds 參數值是否正確。
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.

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

變更歷史

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