Skip to main content
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

  • xmlBase64StringRequired

    The resource name.

  • jsonImageInfosStringRequired

    The JSON string that describes the relationship between disk ID and the image file.

  • backupStorageUuidStringRequired

    The UUID of the backup storage that stores the uploaded image file.

  • jsonCreateVmParamStringRequired

    The JSON string that contains the parameters used to create a VM instance.

  • deleteImageAfterSuccessboolean

    Optional. Specifies whether to delete the image file after the deployment is completed.

Responses

200 OK

On success, this API returns the following response structure.

  • successbooleanRequired

    操作是否成功。

  • errorErrorCodeRequired

    The error code. If not null, the operation fails, or vice versa. For more information, see error.

    • codeStringRequired

      The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001.

    • descriptionStringRequired

      The brief description of the error.

    • detailsStringRequired

      The details about the error.

    • elaborationStringRequired

      The reserved field. Default value: null.

    • opaqueLinkedHashMapRequired

      The reserved field. Default value: null.

    • causeErrorCodeRequired

      The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null.

  • inventoryVmInstanceInventoryRequired

    See inventory.

    • uuidStringRequired

      The resource UUID.

    • nameStringRequired

      The resource name.

    • descriptionStringRequired

      The resource description.

    • zoneUuidStringRequired

      The zone UUID.

    • clusterUuidStringRequired

      The cluster UUID.

    • imageUuidStringRequired

      The image UUID.

    • hostUuidStringRequired

      The host UUID.

    • lastHostUuidStringRequired

      最近一次主机UUID。

    • instanceOfferingUuidStringRequired

      The instance offering UUID.

    • rootVolumeUuidStringRequired

      The root volume UUID.

    • platformStringRequired

      平台。

    • architectureStringRequired

      No description provided.

    • defaultL3NetworkUuidStringRequired

      No description provided.

    • typeStringRequired

      类型。

    • hypervisorTypeStringRequired

      No description provided.

    • memorySizeLongRequired

      内存大小。

    • cpuNumIntegerRequired

      No description provided.

    • cpuSpeedLongRequired

      No description provided.

    • allocatorStrategyStringRequired

      No description provided.

    • createDateTimestampRequired

      The creation time.

    • lastOpDateTimestampRequired

      The last operation time.

    • stateStringRequired

      当前状态。

    • guestOsTypeStringRequired

      No description provided.

    • vmNicsListRequired

      See vmNics.

      • uuidStringRequired

        The resource UUID.

      • vmInstanceUuidStringRequired

        The VM UUID.

      • l3NetworkUuidStringRequired

        The L3 network UUID.

      • ipStringRequired

        The IP address.

      • macStringRequired

        The MAC address.

      • hypervisorTypeStringRequired

        The hypervisor type.

      • netmaskStringRequired

        The netmask.

      • gatewayStringRequired

        The gateway.

      • metaDataStringRequired

        元数据。

      • ipVersionIntegerRequired

        The IP version.

      • driverTypeStringRequired

        No description provided.

      • internalNameStringRequired

        内部名称。

      • deviceIdIntegerRequired

        The device ID.

      • typeStringRequired

        The NIC type.

      • createDateTimestampRequired

        The creation time.

      • lastOpDateTimestampRequired

        The last operation time.

      • usedIpsListRequired

        See usedIps.

        • uuidStringRequired

          The resource UUID.

        • ipRangeUuidStringRequired

          The IP range UUID.

        • l3NetworkUuidStringRequired

          The L3 network UUID.

        • ipVersionIntegerRequired

          The IP version.

        • ipStringRequired

          The IP address.

        • netmaskStringRequired

          The netmask.

        • gatewayStringRequired

          The gateway.

        • usedForStringRequired

          已使用用于。

        • ipInLonglongRequired

          No description provided.

        • vmNicUuidStringRequired

          The NIC UUID.

        • createDateTimestampRequired

          The creation time.

        • lastOpDateTimestampRequired

          The last operation time.

    • allVolumesListRequired

      See allVolumes.

      • uuidStringRequired

        The resource UUID.

      • nameStringRequired

        The resource name.

      • descriptionStringRequired

        The resource description.

      • primaryStorageUuidStringRequired

        The primary storage UUID.

      • vmInstanceUuidStringRequired

        The VM UUID.

      • diskOfferingUuidStringRequired

        The disk offering UUID.

      • rootImageUuidStringRequired

        The root volume image UUID.

      • installPathStringRequired

        The installation path.

      • typeStringRequired

        The volume type.

      • formatStringRequired

        The volume format.

      • sizeLongRequired

        The virtual size of the volume.

      • actualSizeLongRequired

        The actual size of the volume.

      • deviceIdIntegerRequired

        The device ID.

      • stateStringRequired

        The state of the volume.

      • statusStringRequired

        The status of the volume.

      • createDateTimestampRequired

        The creation time.

      • lastOpDateTimestampRequired

        The last operation time.

      • isShareableBooleanRequired

        Whether the volume can be shared.

      • volumeQosStringRequired

        The volume QoS.

    • vmCdRomsListRequired

      See vmCdRoms.

      • uuidStringRequired

        The resource UUID.

      • vmInstanceUuidStringRequired

        The VM UUID.

      • deviceIdIntegerRequired

        设备ID。

      • isoUuidStringRequired

        No description provided.

      • isoInstallPathStringRequired

        iso安装路径。

      • nameStringRequired

        The resource name.

      • descriptionStringRequired

        The resource description.

      • createDateTimestampRequired

        The creation time.

      • lastOpDateTimestampRequired

        The last operation time.

Endpoint

POST/zstack/v1/ovf/create-vm-instance

/zstack/v1/ovf/create-vm-instance

Operation ID

CreateVmInstanceFromOvf

Permalink

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.

View all change history