Resource Center/Resource Pool/VM Instance Operations
POSTVM Instance OperationsSince 4.4.6SynchronousAuth Required
CreateVmInstanceFromOvf
CreateVmInstanceFromOvf
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Request Inputs
Body Fields
xmlBase64StringRequiredThe resource name.
jsonImageInfosStringRequiredThe JSON string that describes the relationship between disk ID and the image file.
backupStorageUuidStringRequiredThe UUID of the backup storage that stores the uploaded image file.
jsonCreateVmParamStringRequiredThe JSON string that contains the parameters used to create a VM instance.
deleteImageAfterSuccessbooleanOptional. Specifies whether to delete the image file after the deployment is completed.
Responses
Endpoint
POST/zstack/v1/ovf/create-vm-instance
/zstack/v1/ovf/create-vm-instance
Request Example
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>"]}'
Response Example
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" } ] } }Change History
This API has no change history records yet.
