创建BEC虚机实例

接口描述

本接口用于创建BEC虚机实例。

请求结构

POST /v1/vm/service/{serviceId}/instance HTTP/1.1 Host: bec.baidubce.com Authorization: authorization string { "vmName": vmName, "needPublicIp": needPublicIp, "bandwidth": bandwidth, "deployInstances": [ { "regionId": regionId, "region": region, "serviceProvider": serviceProvider, "city": city, "replicas": replicas }, { "regionId": regionId, "region": region, "serviceProvider": serviceProvider, "city": city, "replicas": replicas, "networkType": "vpc", "vpcId": vpcId, "subnetId": subnetId } ], "needIpv6PublicIp": false, "spec": spec, "cpu": cpu, "memory": memory, "imageId": imageId, "imageType": bec, "systemVolume": { "volumeType": SATA, "name": vm-rootfs, "sizeInGB": 40 }, "dnsConfig": { "dnsType": dnsType, "dnsAddress": dnsAddress }, "keyConfig": { "type": "password", "adminPass": "adminPass", }, "dataVolumeList": [ { "name": name, "volumeType": volumeType, "sizeInGB": sizeInGB }, { "name": name, "volumeType": volumeType, "sizeInGB": sizeInGB } ], "disableIntranet": disableIntranet, "disableCloudInit": disableCloudInit, "networkConfigList": [ { "nodeType": "SINGLE", "networksList": [ { "netType": "netType", "netName": "netName" }, { "netType": "netType", "netName": "netName" } ] } ], "hostname": hostname, "deploysetIdList": ["deploysetId"] }
  • 创建独占盘
  • 密码和密钥配置注意事项
  • 网卡命名注意事项
  • 使用VPC网络注意事项
  • 三线指定三线运营商

请求头域

除公共头域外,无其它特殊头域。

请求参数

响应头域

除公共头域外,无其它特殊头域。

响应参数

错误码

请求示例

POST /v1/vm/service/s-zz9r0enj/instance HTTP/1.1 Host: bec.baidubce.com Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de { "dataVolumeList": [ { "volumeType": "SATA", "sizeInGB": 20, "name": "data-disk-name" } ], "adminPass": "Password12345!", "imageId": "im-DqQdV8VQ", "imageType": "bec", "bandwidth": 100, "deployInstances": [ { "regionId": "cn-chengdu-un", "replicas": 1, "networkType": "vpc", "vpcId": "vpc-12ou61", "subnetId": "sbn-14okg1j" } ], "securityGroupIds": ["sg-bjlfkdq"], "systemVolume": { "volumeType": "SATA", "name": "system-disk-name", "sizeInGB": 40 }, "dnsConfig": { "dnsType": "CUSTOMIZE", "dnsAddress": "129.29.29.29" }, "vmName": "vmName", "purchaseMonth": null, "needPublicIp": false, "spec": "bec.c2.c4m8", "cpu": 4, "memory": 8, "disableIntranet": false, "disableCloudInit": false, "networkConfigList": [ { "nodeType": "SINGLE", "networksList": [ { "netType": "INTERNAL_IP", "netName": "intra" }, { "netType": "PUBLIC_IP", "netName": "extra" } ] } ], "deploysetIdList": ["dset-enckow4i"] }
POST /v1/vm/service/s-zz9r0enj/instance HTTP/1.1 Host: bec.baidubce.com Authorization: bce-auth-v1/f81d3b34e48048fbb2634dc7882d7e21/2015-08-11T04:17:29Z/3600/host/74c506f68c65e26c633bfa104c863fffac5190fdec1ec24b7c03eb5d67d2e1de { "dataVolumeList": [ { "volumeType": "SATA", "sizeInGB": 20, "name": "data-disk-name" } ], "adminPass": "Password12345!", "imageId": "im-DqQdV8VQ", "imageType": "bec", "bandwidth": 100, "deployInstances": [ { "region": "SOUTH_WEST", "city": "CHENGDU", "serviceProvider": "CHINA_UNICOM", "replicas": 1, "networkType": "vpc", "vpcId": "vpc-12ou61", "subnetId": "sbn-14okg1j" } ], "securityGroupIds": ["sg-bjlfkdq"], "systemVolume": { "volumeType": "SATA", "name": "system-disk-name", "sizeInGB": 40 }, "dnsConfig": { "dnsType": "CUSTOMIZE", "dnsAddress": "129.29.29.29" }, "vmName": "vmName", "purchaseMonth": null, "needPublicIp": false, "spec": "bec.c2.c4m8", "cpu": 4, "memory": 8, "disableIntranet": false, "disableCloudInit": false, "networkConfigList": [ { "nodeType": "SINGLE", "networksList": [ { "netType": "INTERNAL_IP", "netName": "intra" }, { "netType": "PUBLIC_IP", "netName": "extra" } ] } ], "deploysetIdList": ["dset-enckow4i"] }

响应示例

HTTP/1.1 200 OK Content-Type: application/json;charset=UTF-8 Date: Wed, 08 Jul 2015 03:28:11 GMT x-bce-request-id: d8752367-38e8-45e4-b4c7-e53be3137ce5 Server: BWS { "result": true, "action": "create", "details": { "serviceId": "s-zz9r0enj", "serviceName": "test", "status": "NORMAL", "totalCpu": 1, "totalMem": 2, "totalDisk": 0, "totalRootDisk": 40, "regions": 1, "instances": [ { "vmId": "vm-wbolbmuo-1-m-chengdu-2ds4d", "vmName": "vm-wbolbmuo-1-m-chengdu-2ds4d", "regionId": "cn-chengdu-un", "region": "SOUTH_WEST", "city": "CHENGDU", "serviceProvider": "CHINA_UNICOM" } ], "deployInstances": [ { "regionId": "cn-chengdu-un", "region": "SOUTH_WEST", "serviceProvider": "CHINA_UNICOM", "replicas": 1, "city": "CHENGDU" } ], "totalInstances": 1, "runningInstances": 0, "osImage": { "id": "5732f5cf-fd17-4e6b-a044-e95bed7da02e", "imageId": "im-DqQdV8VQ", "name": "qa-hello-world", "imageType": "becCommon", "snapshotId": "", "cpu": 1, "memory": 2, "osType": "linux", "osVersion": "7.5", "osName": "CentOS", "osBuild": "2019110600", "osLang": "ENG", "diskSize": 0, "createTime": "2020-10-22T03:59:36Z", "status": "active", "minMem": 1, "minCpu": 0, "minDiskGb": 40, "desc": "centos-7u5-x86_64-20191105105756", "osArch": "x86_64 (64bit)", "ephemeralSize": 0, "imageDescription": "centos-7u5-x86_64-20191105105756", "shareToUserNumLimit": 0, "sharedToUserNum": 0, "fpgaType": "", "name_fri": null }, "createTime": null, "totalGpu": 0, "bandwidth": null, "totalBandwidth": "0Mbps" } }

Model对象定义

原文链接:https://cloud.baidu.com/doc/BEC/s/jknpo0evo

原创文章,作者:优速盾-小U,如若转载,请注明出处:https://www.cdnb.net/bbs/archives/6350

(0)
上一篇 2022年9月17日 23:36
下一篇 2022年9月18日 00:26

相关推荐

发表回复

您的电子邮箱地址不会被公开。 必填项已用*标注

优速盾注册领取大礼包www.cdnb.net
/sitemap.xml