Skip to main content
Resource Center/Resource Pool/VM Instance Operations
POSTVM Instance OperationsSince 4.1.0SynchronousAuth Required

CreateVmInstanceFromVolumeSnapshot

CreateVmInstanceFromVolumeSnapshot

Execution Availability

Try It Out

Submit a mock request using the current auth context and example-driven inputs.

Path Parameters

Request Inputs

Path Parameters

  • volumeSnapshotUuidStringRequired

    The snapshot group UUID.

Body Fields

  • paramsObjectRequired

    Request body parameter object.

    • nameStringRequired

      The resource name.

    • descriptionString

      Optional. Optional. The detailed description of the resource.

    • instanceOfferingUuidString

      Optional. The instance offering UUID.

    • cpuNumInteger

      Optional. The number of CPU cores.

    • memorySizeLong

      Optional. The memory size.

    • l3NetworkUuidsListRequired

      The L3 network UUID.

    • typeString

      Optional. The VM type. This is a reserved field.

    • platformString

      The VM platform type.

    • zoneUuidString

      Optional. The zone UUID.

    • clusterUuidString

      Optional. The cluster UUID.

    • hostUuidString

      Optional. The host UUID.

    • primaryStorageUuidString

      Optional. The UUID of the primary storage.

    • defaultL3NetworkUuidString

      Optional. The default L3 network UUID.

    • strategyString

      Optional. The policy that specifies whether to start a VM instance when the instance is created.

    • resourceUuidString

      Optional. The resource UUID.

    • tagUuidsList

      Optional. The tag UUIDs.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

Responses

200 OK

On success, this API returns the following response structure.

  • 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.

    • descriptionString

      Optional. Optional. The detailed description of the resource.

    • 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

      平台。

    • 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 update time.

    • stateStringRequired

      当前状态。

    • 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 address version.

      • deviceIdIntegerRequired

        The device ID.

      • typeStringRequired

        The NIC type.

      • createDateTimestampRequired

        The creation time.

      • lastOpDateTimestampRequired

        The last update 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 VM NIC UUID.

        • createDateTimestampRequired

          The creation time.

        • lastOpDateTimestampRequired

          The last update time.

    • allVolumesListRequired

      See allVolumes.

      • uuidStringRequired

        The resource UUID.

      • nameStringRequired

        The resource name.

      • descriptionString

        Optional. The detailed description of the resource.

      • primaryStorageUuidStringRequired

        The primary storage UUID.

      • vmInstanceUuidStringRequired

        The VM UUID.

      • diskOfferingUuidStringRequired

        The disk offering UUID.

      • rootImageUuidStringRequired

        The root volume image UUID.

      • installPathStringRequired

        The installation path of the volume on the primary storage.

      • typeStringRequired

        The volume type.

      • formatStringRequired

        The volume type.

      • sizeLongRequired

        The volume size.

      • actualSizeLongRequired

        The actual size of the volume.

      • deviceIdIntegerRequired

        设备ID。

      • stateStringRequired

        Indicates whether the disk is enabled.

      • statusStringRequired

        The volume status.

      • createDateTimestampRequired

        The creation time.

      • lastOpDateTimestampRequired

        The last update time.

      • isShareableBooleanRequired

        Indicates whether the volume is a shared volume.

      • volumeQosStringRequired

        The volume QoS, for example, total=1048576

Endpoint

POST/zstack/v1/vm-instances/from/volume-snapshots/{volumeSnapshotUuid}

/zstack/v1/vm-instances/from/volume-snapshots/{volumeSnapshotUuid}

Operation ID

CreateVmInstanceFromVolumeSnapshot

Permalink

Request Example

curl -X POST 'http://{host}/zstack/v1/vm-instances/from/volume-snapshots/{volumeSnapshotUuid}' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"params":{"name":"<name>","description":"<description>","instanceOfferingUuid":"<instanceOfferingUuid>","cpuNum":1,"memorySize":1,"l3NetworkUuids":["<l3NetworkUuids>"],"type":"<type>","platform":"<platform>","zoneUuid":"<zoneUuid>","clusterUuid":"<clusterUuid>","hostUuid":"<hostUuid>","primaryStorageUuid":"<primaryStorageUuid>","defaultL3NetworkUuid":"<defaultL3NetworkUuid>","strategy":"<strategy>","resourceUuid":"<resourceUuid>","tagUuids":["<tagUuids>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "inventory": { "uuid": "109d10001c5c3553a7f2333e6a48610a", "name": "Test-VM", "description": "web server VM", "zoneUuid": "f31cb809cf0b3c668953e2507d5467b2", "clusterUuid": "fdfdf92e7bbe3212ab6530b11d8e0af5", "imageUuid": "96acc892dd793fb98c1924d54eb27a88", "hostUuid": "8eb85f51f10c30c0a6305b73d2002899", "lastHostUuid": "59ae08c1f6ed3638b6e4aa35b5a30d2e", "instanceOfferingUuid": "8b6d6aabad773972a0549539099e3e68", "rootVolumeUuid": "70eda0fe06163e67accf01a266fd5274", "platform": "Linux", "defaultL3NetworkUuid": "5ec42284ceaa3ad18f2b498e98ab6acc", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8.589934592E9, "cpuNum": 1.0, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM", "state": "Running", "vmNics": [ { "uuid": "b6d840187f1932209c21888923f5f35e", "vmInstanceUuid": "109d10001c5c3553a7f2333e6a48610a", "usedIpUuid": "54e8db987a4a333c80a87e4a84ab7675", "l3NetworkUuid": "5ec42284ceaa3ad18f2b498e98ab6acc", "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 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ], "allVolumes": [ { "uuid": "70eda0fe06163e67accf01a266fd5274", "name": "Root-Volume-For-VM-109d10001c5c3553a7f2333e6a48610a", "primaryStorageUuid": "0739abbe904639649da74cdcf0abd25f", "vmInstanceUuid": "109d10001c5c3553a7f2333e6a48610a", "rootImageUuid": "96acc892dd793fb98c1924d54eb27a88", "installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-70eda0fe06163e67accf01a266fd5274/70eda0fe06163e67accf01a266fd5274.qcow2", "type": "Root", "format": "qcow2", "size": 1.073741824E11, "actualSize": 2.147483648E10, "deviceId": 0.0, "state": "Enabled", "status": "Ready", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM" } ] } }

Change History

This API has no change history records yet.

View all change history