You need to enable JavaScript to run this app.
文档中心
私有网络

私有网络

复制全文
下载 pdf
网卡
AttachNetworkInterface - 挂载网卡
复制全文
下载 pdf
AttachNetworkInterface - 挂载网卡
调用 AttachNetworkInterface 接口,将辅助网卡挂载至云服务器。​
使用说明​
调用本接口需满足如下条件:​
  • 云服务器和辅助网卡两者所属同一VPC且在同一可用区。​
  • 云服务器实例的状态为运行中或已停止。​
  • 辅助网卡已分配的私网IPv4地址数量和私网IPv6地址数量均小于云服务器实例规格的单网卡IP配额。​
  • 目标云服务器实例已挂载网卡的数量未达到其可挂载的网卡数量(包括1张主网卡)。不同规格云服务器实例可挂载的网卡数量不同,具体请参见规格实例清单。​
  • AttachNetworkInterface 为异步接口,即返回请求ID时,系统后台仍在配置。您可调用 DescribeNetworkInterfaceAttributes 查看网卡的状态,Attaching表示挂载中,InUse 表示挂载完成。​
调试​
API Explorer
您可以通过 API Explorer 在线发起调用,无需关注签名生成过程,快速获取调用结果。
​
请求参数​
下方仅列出该接口特有的请求参数和部分公共参数。更多信息请见公共参数。​
Action String 必选 示例值:AttachNetworkInterface​
接口名称。当前 API 的名称为AttachNetworkInterface。​
​
Version String 必选 示例值:2020-04-01​
接口版本。当前 API 的版本为 2020-04-01。​
​
NetworkInterfaceId String 必选 示例值:eni-bp1fg655nh68xyz9****​
辅助网卡ID。​
您可以调用 DescribeNetworkInterfaces 接口,查询网卡的ID。​
​
InstanceId String 必选 示例值:i-wijfn35c****​
云服务器实例的ID。​
您可以调用 DescribeInstances 接口,查询云服务器实例的ID。​
​
DeleteOnTermination Boolean 可选 示例值:false​
是否开启随云服务器实例删除。​
  • true:开启。​
  • false:关闭。​
​
​
​
返回参数​
下方仅列出本接口特有的返回参数。更多信息请参见返回结构。​
RequestId String 示例值:2021062415303301022514515207C4****​
请求ID。​
​
​
​
请求示例​
​
GET /?Action=AttachNetworkInterface&Version=2020-04-01&NetworkInterfaceId=eni-bp1fg655nh68xyz9****&InstanceId=i-wijfn35c**** HTTP/1.1​
Host: vpc.cn-beijing.volcengineapi.com​
X-Date: 20251121T094038Z​
Authorization: HMAC-SHA256 Credential=Adfks******wekfwe/20251121/cn-beijing/vpc/request, SignedHeaders=host;x-date, Signature=47a7d934ff7b37c03938******cd7b8278a40a1057690c401e92246a0e41085f​
​
返回示例​
​
{​
"ResponseMetadata": {​
"RequestId": "20230604110420****100232280022D31",​
"Action": "AttachNetworkInterface",​
"Version": "2020-04-01",​
"Service": "vpc",​
"Region": "cn-beijing"​
},​
"Result": {​
"RequestId": "2021062415303301022514515207C4****"​
}​
}​
​
错误码​
​
状态码​
错误码​
错误信息​
说明​
400​
Forbidden.TrafficMode​
You are not authorized to perform operations on the specified network interface.​
您无权在指定的网络接口上执行操作。​
400​
InvalidENI.DeviceType​
The specified Eni deviceType is invalid.​
弹性网卡设备类型不合法。​
400​
InvalidEip.InUse​
The specified EIP is being operated by another request.​
指定的EIP正被另一个请求操作,请稍后再试。​
400​
InvalidEni.AccountMismatch​
The specified elastic network interface and instance are in different account.​
指定的弹性网卡和实例不在同一个账号。​
400​
InvalidEni.InvalidStatus​
The specified elastic network interface is not in the correct status for the request.​
指定的弹性网卡所处的状态无法响应该请求。​
400​
InvalidEni.InvalidType​
The type of specified elastic network interface is illegal for the request.​
指定类型的弹性网卡无法响应该请求。​
400​
InvalidEni.ZoneMismatch​
The specified elastic network interface and instance are in different Available Zones.​
指定的弹性网卡和实例不在同一个可用区。​
400​
InvalidInstance.InvalidStatus​
The specified instance is not in the correct status for the request.​
指定的ECS实例所处的状态无法响应该请求。​
400​
InvalidInstance.InvalidType​
The specified instance type is invalid for the request.​
指定的ECS实例规格无法响应该请求。​
400​
InvalidInstance.Malformed​
The specified instance does not support vRDMA currently.​
指定的ECS实例当前不支持vRDMA。​
400​
InvalidIp.Malformed​
The specified ip is malformed.​
指定的IP不合法。​
400​
InvalidTrafficMirrorSession.InvalidStatus​
The specified traffic mirror session is not in the correct status for the request.​
指定的镜像流量会话所处的状态无法响应该请求。​
400​
InvalidVpcEip.InUse​
The specified vpc eip is being operated by another request.​
指定的EIP正被另一个请求操作,请稍后再试。​
400​
InvalidVrdmaEnable.JumboFrameMismatch​
The specified instance is not supported to enable vRDMA without jumbo frame enabled.​
指定的实例在未启用JumboFrame的情况下,不支持启用vRDMA。​
400​
LimitExceeded.BranchEnisPerInstance​
You've reached the limit on the number of branch enis that can be attached to a single instance.​
已达到该ECS实例可绑定的branch网卡的数量上限。​
400​
LimitExceeded.EnisPerInstance​
You've reached the limit on the number of elastic network interfaces that can be attached to a single instance.​
已达到该ECS实例可绑定的弹性网卡的数量上限。​
400​
LimitExceeded.HighPerformanceEnisPerInstance​
You've reached the limit on the number of high performance elastic network interfaces that can be attached to the specified instance.​
已达到该ECS实例可绑定的高性能弹性网卡的数量上限。​
400​
LimitExceeded.Ipv6AddressesPerEni​
The number of IPv6 addresses for a specified network interface exceeds the limit for the type of instance you are attaching.​
网卡已达到指定实例规格可分配的IPv6地址数量上限。​
400​
LimitExceeded.PrivateIpsPerEni​
You've reached the limit on the number of private IPs per elastic network interface that you can create.​
已达到弹性网卡可分配的辅助IP的数量上限。​
403​
Forbidden​
You are not authorized to perform operations on ESI related resources.​
无权限操作弹性预约实例关联资源。​
403​
Forbidden​
You are not authorized to perform operations on the specified elastic network interface.​
无权限对指定的弹性网卡进行操作。​
403​
Forbidden​
You are not authorized to perform operations on the specified elastic network interface. The specified elastic network interface is a service-managed elastic network interface.​
无权限对指定弹性网卡进行操作。指定的弹性网卡为云产品托管的弹性网卡。​
404​
InvalidEniId.NotFound​
The specified elastic network interface does not exist.​
指定的弹性网卡不存在。​
404​
InvalidInstance.NotFound​
The specified instance does not exist.​
指定的ECS实例不存在。​
409​
InvalidEniVtepIp.Conflict​
The specified elastic network interface vtep ip is conflict.​
指定的弹性网卡的VTEP IP冲突。​
500​
VportLimit.Exceed​
The number of Vports on the specified host has exceeded the limit.​
指定Host上的Vport数量已超过限制。​
​
​
最近更新时间:2026.09.17 15:49:39
这个页面对您有帮助吗?
有用
有用
无用
无用