计算管理/虚拟机相关接口
POSTVM Related Interfaces起始版本 4.4.6同步需要认证
从OVF模板导入虚拟机
从OVF模板导入虚拟机
调试可用性
在线调试
使用当前认证信息和示例参数提交 Mock 请求。
请求参数
请求体字段
xmlBase64String必填资源名称。
jsonImageInfosString必填暂无描述。
backupStorageUuidString必填暂无描述。
jsonCreateVmParamString必填JSON字符串containing云主机creation参数。
deleteImageAfterSuccessboolean删除镜像文件成功部署。
响应状态
请求地址
POST/zstack/v1/ovf/create-vm-instance
/zstack/v1/ovf/create-vm-instance
请求示例
curl -X POST 'http://{host}/zstack/v1/ovf/create-vm-instance' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"xmlBase64":"<xmlBase64>","jsonImageInfos":"<jsonImageInfos>","backupStorageUuid":"<backupStorageUuid>","jsonCreateVmParam":"<jsonCreateVmParam>","deleteImageAfterSuccess":true,"deleteImageOnFail":true,"resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"],"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
响应示例
200{ "inventory": { "uuid": "ef8b74d3a7f931c3aacf258c20d25411", "name": "test-ovf", "description": "web server VM", "zoneUuid": "5f3cdedd4a823bfcadd45385f034b763", "clusterUuid": "2bb23d2c0a013338add7cedf2615ac39", "imageUuid": "f47e5dbf886e3d16b8097294efd63b37", "hostUuid": "82bad7cada82377684459e59292937b4", "lastHostUuid": "00e742c03afe3cd68234aa9c9352d5a7", "instanceOfferingUuid": "a9a166f625e23886a7227bdb472da645", "rootVolumeUuid": "3e92e577418835a3bfeb0d770e898052", "platform": "Linux", "defaultL3NetworkUuid": "e4f37ede6e563fe5943ae8b8c7c008d6", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 4.294967296E9, "cpuNum": 4.0, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM", "state": "Running", "vmNics": [ { "uuid": "d5a26fdfdcff30748b22b85f4d7fadbe", "vmInstanceUuid": "ef8b74d3a7f931c3aacf258c20d25411", "usedIpUuid": "4423412a12653cb3af73231e16e526cf", "l3NetworkUuid": "e4f37ede6e563fe5943ae8b8c7c008d6", "ip": "192.168.1.10", "mac": "00:0c:29:bd:99:fc", "hypervisorType": "KVM", "netmask": "255.255.255.0", "gateway": "192.168.1.1", "deviceId": 0.0, "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM" } ], "allVolumes": [ { "uuid": "3e92e577418835a3bfeb0d770e898052", "name": "Root-Volume-For-VM-ef8b74d3a7f931c3aacf258c20d25411", "primaryStorageUuid": "353a440b83283acca73e3d3fd2cca0c5", "vmInstanceUuid": "ef8b74d3a7f931c3aacf258c20d25411", "diskOfferingUuid": "323969fdd2273f1a8e42aef10a9e8c6b", "rootImageUuid": "f47e5dbf886e3d16b8097294efd63b37", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-3e92e577418835a3bfeb0d770e898052/3e92e577418835a3bfeb0d770e898052.qcow2", "type": "Root", "format": "qcow2", "size": 1.073741824E11, "actualSize": 2.147483648E10, "deviceId": 0.0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 2:20:57 PM", "lastOpDate": "Nov 14, 2017 2:20:57 PM" } ] } }变更历史
此 API 暂无变更历史记录。
