文档

CreateVirtualNode - 创建一个虚拟节点

更新时间:

调用CreateVirtualNode创建一个虚拟节点(VNode),用于对接自建Kubernetes集群,使其可以扩展资源到ECI。

接口说明

  • 调用本接口创建虚拟节点时,系统将自动为您创建一个服务关联角色 AliyunServiceRoleForECIVnode,用于访问 ECI、ECS、VPC 等相关云服务。更多信息,请参见虚拟节点服务关联角色

  • 虚拟节点按个数计费。每个虚拟节点会有一个常驻节点,相当于 2 vCPU,8 GiB 的 ECI 实例,收取相关 ECI 实例费用。

调试

您可以在OpenAPI Explorer中直接运行该接口,免去您计算签名的困扰。运行成功后,OpenAPI Explorer可以自动生成SDK代码示例。

授权信息

下表是API对应的授权信息,可以在RAM权限策略语句的Action元素中使用,用来给RAM用户或RAM角色授予调用此API的权限。具体说明如下:

  • 操作:是指具体的权限点。
  • 访问级别:是指每个操作的访问级别,取值为写入(Write)、读取(Read)或列出(List)。
  • 资源类型:是指操作中支持授权的资源类型。具体说明如下:
    • 对于必选的资源类型,用背景高亮的方式表示。
    • 对于不支持资源级授权的操作,用全部资源表示。
  • 条件关键字:是指云产品自身定义的条件关键字。
  • 关联操作:是指成功执行操作所需要的其他权限。操作者必须同时具备关联操作的权限,操作才能成功。
操作访问级别资源类型条件关键字关联操作
eci:CreateVirtualNodeWrite
  • VirtualNode
    acs:eci:{#regionId}:{#accountId}:virtualnode/*
  • eci:tag

请求参数

名称类型必填描述示例值
RegionIdstring

地域 ID。

cn-hangzhou
ZoneIdstring

可用区 ID。

cn-hangzhou-b
SecurityGroupIdstring

安全组 ID。虚拟节点以及该虚拟节点下的 ECI 实例将加入到该安全组中。

sg-2ze81zoc3yl7a3we****
VSwitchIdstring

交换机 ID。虚拟节点以及虚拟节点下的 ECI 实例所使用的交换机。
支持指定多个(1~10 个)属于同一 VPC 的交换机。

vsw-2ze23nqzig8inprou****
VirtualNodeNamestring

虚拟节点的名称。长度为 2~128 个英文字符,可以包含小写英文字符、数字、半角句号(.)或者短划线(-)。

testNode
ResourceGroupIdstring

资源组 ID。

rg-uf66jeqopgqa9hdn****
ClientTokenstring

保证请求幂等性。从您的客户端生成一个参数值,确保不同请求间该参数值唯一。只支持 ASCII 字符,且不能超过 64 个字符。更多详情,请参见如何保证幂等性

123e4567-e89b-12d3-a456-426655440000
EnablePublicNetworkboolean

是否支持公网。默认为 false。
如果设置为 true,则虚拟节点将对外暴露一个公网 IP。

false
EipInstanceIdstring

弹性公网 IP 的 ID。

eip-uf66jeqopgqa9hdn****
KubeConfigstring

虚拟节点要连接的 K8s 集群的 KubeConfig。需进行 Base64 编码后传入。

JTVDbmFwaVZlcnNpb24lM0ElMjB2MSU1Q25jbHVzdGVycyUzQSU1Q24tJTIwY2x1c3RlciUzQSU1Q24uLi******
CustomResourcesstring

虚拟节点支持的自定义资源。如果 ECI Pod 的 request 中声明了相应的自定义资源,则该 Pod 会被调度到 VNode。 格式为资源名称=资源数量,多个资源之间使用半角逗号间隔。

example1.com=100,example2.com=200
ClusterDomainstring

集群的域名。配置后,除了主机的搜索域外,Kubelet 会配置所有容器来搜索该域名。

example.com
ClusterDNSstring

DNS 服务器的 IP 地址。如果 ECI Pod 中设置了dnsPolicy=ClusterFirst,则使用该配置值为容器提供 DNS 服务。 支持配置多个 IP 地址,多个 IP 地址之间使用半角逗号间隔。

100.1.XX.XX
Tagobject []

虚拟节点标签信息。

Keystring

标签键。N 的取值范围为 1~20。

name
Valuestring

标签值。N 的取值范围为 1~20。

test
Taintobject []

虚拟节点污点信息。

Keystring

污点的 Key。N 的取值范围为 1~20。

testKey
Valuestring

污点的 Value。N 的取值范围为 1~20。

testValue
Effectstring

污点的 Effect。N 的取值范围为 1~20。Effect 的取值范围:

  • NoSchedule:不将 Pod 调度到具有该污点的节点上。
  • NoExecute:不将 Pod 调度到具有该污点的节点上的同时,驱逐节点上已经存在的 Pod。
  • PreferNoSchedule:尽量不将 Pod 调度到具有该污点的节点上。
NoSchedule
TlsBootstrapEnabledboolean

是否启用 TLS 启动引导。启用后,请使用 TLS 启动引导的 KubeConfig 证书。取值范围:

  • true:启用
  • false:不启用

默认为 false。

false

返回参数

名称类型描述示例值
object

返回信息。

RequestIdstring

请求 ID。

89164E78-FC82-4684-BE97-DCDD85D26546
VirtualNodeIdstring

虚拟节点 ID。

vnd-2ze960zkdqrldeaw****

示例

正常返回示例

JSON格式

{
  "RequestId": "89164E78-FC82-4684-BE97-DCDD85D26546",
  "VirtualNodeId": "vnd-2ze960zkdqrldeaw****"
}

错误码

HTTP status code错误码错误信息描述
400Account.ArrearageYour account has an outstanding payment.账号已经欠费。
400DryRunOperationRequest validation has been passed with DryRun flag set.此次DryRun预检请求合格。
400InvalidParameter.CPU.MemoryThe specified cpu and memory are not allowed-
400InvalidParameter.DuplicatedNameThe container group include containers with duplicate names.容器组内有重复名字的容器。
400InvalidParameter.DuplicatedVolumeNameThe container group includes volumes with duplicate names.容器组内有重复名字的数据卷。
400IncorrectStatus%s指定的实例状态不正确。
400ServiceNotEnabled%s该次请求所依赖的服务没有开通,请开通后再试。
400ImageSnapshot.IncorrectStatus%s用于镜像缓存的快照状态不正确。
400ImageSnapshot.NotSupport%s基于数据盘快照的镜像缓存功能暂未全网开放,如有需要请联系我们。
400DiskVolume.NotSupportThe disk volume is not supported.云盘卷暂不支持,如有需要请联系我们。
400RamRole.NotSupportThe RAM role is not supported.ram实例角色不支持。
400DiskNumber.LimitExceedThe maximum number of disks in an instance is exceeded.实例下云盘数目超过限制。
400InvalidPaymentMethod.InsufficientBalanceNo payment method is specified for your account. We recommend that you add a payment method or add funds to the prepayment balance.您的账户暂无有效支付方式,请添加支付方式或保持预付款余额充足。
400DiskVolume.NotInSameZoneThe instance to be created and the disk are not in the same zone.即将创建的实例和云盘不在同一可用区。
400NoPermissionYou are not authorized to use the "Product on ECI" feature.-
400HighCpuMemConfigRequiredYou need to apply to be added to the whitelist of the specified CPU and memory.您需要申请CPU高配白名单。
400RecommendEmpty.InstanceTypeFamilyNotMatchedThe recommended instance type is unavailable in the current zone. Try again later.当前可用区没有推荐的规格可使用,请稍后重试或者到其他的可用区创建。
400LocalDiskAmountNotMatchThe number of local volumes does not match the instance type.本地盘数量跟实例规格不匹配
400Payfor.CreditPayInsufficientBalanceYour payment credit line is insufficient.您的付款信用额度不足。
400InvalidOperation.KMS.InstanceTypeNotSupportThe specified instance is invalid. Only I/O optimized instances support KMS key.指定的实例无效,只有 I/O 优化类型的实例支持设置“KMS Key”。
400InvalidParameter.Encrypted.KmsNotEnabledKMS must be enabled for encrypted disks.加密磁盘需要启用密钥管理服务。
400InvalidParameter.KMS.EncryptedIllegalAfter configuring the parameter KmsKeyId, you must enable encryption.设置参数“KmsKeyId”后,您必须开启加密属性。
400Ipv6AddressNotSupportVswIPv6 is not supported in the specified vSwitch.该交换机暂未开通ipv6地址。
400EipAddressPoolIpNotEnoughThe ip address of specified PublicIpAddressPool is not enough.指定的eip公网地址池地址资源不足。
400VnodeDedicatedHostIdAlreadyExistDedicatedHostId:%s of Vnode:%s already exists.DedicatedHostId已经存在
400DedicatedHostQuotaExceededThe quota of DedicatedHost is exceeded.专有宿主机的quota超过限制
403OperationDenied.VswZoneMisMatchThe specified VSwitchId is not in the specified Zone.-
403QuotaExceeded%s quota exceeded.用户允许创建的实例已经超过限制。
403Zone.NotOnSaleThe specified zone is not available for purchase.创建实例的可用区已经关闭售卖,请更换其他可用区。或者无法在该可用区使用指定 VPC 的虚拟交换机。
403Forbidden.RiskControlThis operation has been identified as an abnormal operation and cannot be processed.此操作已被确定为一个操作异常,无法处理。
403Forbidden.SubUserThe specified action is not available for you.当前用户无法执行该操作。
403Forbidden.OnlyForInvitedTestEci create action is only open to invited users during public beta.Eci公测阶段只对受邀的用户开放。
403OperationDenied.SecurityGroupMisMatchThe specified VSwitchId and SecurityGroupId are not in the same VPC.指定的交换机和安全组不在同一个VPC下。
403InvalidVSwitchId.IpNotEnoughThe specified VSwitch does not have enough IP addresses.-
403Forbidden.UserBussinessStatusThis operation is not allowed, because you have overdue bills. Pay the overdue bill and try again.用户处于欠费状态不允许创建,请充值后再尝试。
403Forbidden.UserNotRealNameAuthenticationThis operation is not allowed, because you have not passed the real-name verification.操作被禁止,因为用户还未进行实名认证。
403InvalidUser.PassRoleForbiddenThe RAM user is not authorized to assume a RAM role.子账号用户没有权限使用RAM实例角色。
403NoPermissionThe RAM role does not belong to ECS.-
403OperationDenied.NoStockSales of this resource are temporarily suspended in the specified zone. We recommend that you use the multi-zone creation function to avoid the risk of insufficient resource. For more information, see https://help.aliyun.com/document_detail/157290.html-
403InvalidParameter.KMS.KeyId.ForbiddenYou are not authorized to access the specified KMSKeyId.无权访问指定的 KMSKeyId。
403NoPermissionThe RAM role AliyunECIContainerGroupRole does not belong to eci.aliyuncs.com. Please check and try again.-
403Forbidden.AccountClosedThe operation is forbidden. Your account has been closed.操作被禁止,因为用户账户已注销。
403InvalidOperation.ResourceManagedByCloudProductThe operation is forbidden. The security group has been managed by another cloud product.安全组由其他云产品管理,禁止操作。
403Spot.NotMatched%s. We recommend that you use the create multi-zone function to avoid insufficient inventory. For more information, see https://help.aliyun.com/document_detail/157290.html-
403SecurityRisk.3DVerificationWe have detected a security risk with your default credit or debit card. Please proceed with verification via the link in your email.我们检测到您的默认信用卡或借记卡存在安全风险。请通过电子邮件中的链接进行验证。
403CreateServiceLinkedRole.DeniedPlease make sure the account has ram:CreateServiceLinkedRole permission.请确保账号拥有ram:CreateServiceLinkedRole权限。
404ImageSnapshot.NotFoundThe specified snapshot does not exist.镜像缓存,快照不存在。
404InvalidDiskId.NotFoundThe specified disk does not exist.指定的云盘不存在。
404InvalidParameter.KMS.KeyId.NotFoundThe specified KMSKeyId does not exist.指定的参数“KMSKeyId”不存在。

访问错误中心查看更多错误码。

变更历史

变更时间变更内容概要操作
2023-07-03OpenAPI 错误码发生变更、OpenAPI 入参发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    删除错误码:400
    删除错误码:403
    删除错误码:404
入参OpenAPI 入参发生变更
    删除入参:RotateCertificateEnabled
2023-06-13OpenAPI 错误码发生变更看变更集
变更项变更内容
错误码OpenAPI 错误码发生变更
    错误码 400 变更
    删除错误码:403
    删除错误码:404
2021-09-06新增 OpenAPI看变更集
  • 本页导读 (1)
文档反馈