Skip to main content
Resource Center/Resource Pool/VM Instance Operations
PUTVM Instance OperationsSince 0.6SynchronousAuth Required

CloneVmInstance

CloneVmInstance

Execution Availability

Try It Out

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

Path Parameters

Request Inputs

Path Parameters

  • vmInstanceUuidStringRequired

    The VM instance UUID.

Body Fields

  • clonevminstanceObjectRequired

    clonevminstance request body object.

    • strategyString

      Optional. The strategy.

    • namesListRequired

      The VM instance name list.

    • fullBoolean

      Optional. Whether to clone the data volume that is attached to the VM instance.

    • primaryStorageUuidForRootVolumeString

      Optional.

    • primaryStorageUuidForDataVolumeString

      Optional

    • rootVolumeSystemTagsList

      Optional

    • dataVolumeSystemTagsList

      Optional.

    • clusterUuidString

      Optional. The cluster UUID.

    • hostUuidString

      Optional. The host UUID.

    • vmNicParamsList

      Optional. The VM NIC parameter.

  • systemTagsList

    Optional. The system tags.

  • userTagsList

    Optional. The user tags.

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.

  • resultCloneVmInstanceResultsRequired

    See result.

    • numberOfClonedVmintRequired

      No description provided.

    • inventoriesListRequired

      See inventories.

      • errorErrorCodeRequired

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

          平台。

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

        • lastOpDateTimestampRequired

          The last operation date.

        • stateStringRequired

          当前状态。

        • guestOsTypeStringRequired

          No description provided.

        • vmNicsListRequired

          See vmNics.

          • uuidStringRequired

            The resource UUID.

          • vmInstanceUuidStringRequired

            The VM instance UUID.

          • l3NetworkUuidStringRequired

            The L3 network UUID.

          • ipStringRequired

            来源IP地址。

          • macStringRequired

            No description provided.

          • netmaskStringRequired

            No description provided.

          • gatewayStringRequired

            No description provided.

          • metaDataStringRequired

            元数据。

          • ipVersionIntegerRequired

            IP版本。

          • driverTypeStringRequired

            No description provided.

          • internalNameStringRequired

            内部名称。

          • deviceIdIntegerRequired

            设备ID。

          • typeStringRequired

            类型。

          • stateStringRequired

            The NIC state.

          • createDateTimestampRequired

            The creation date.

          • lastOpDateTimestampRequired

            The last operation date.

          • usedIpsListRequired

            See usedIps.

            • uuidStringRequired

              The resource UUID.

            • ipRangeUuidStringRequired

              The IP range UUID.

            • l3NetworkUuidStringRequired

              The L3 network UUID.

            • ipVersionIntegerRequired

              IP版本。

            • ipStringRequired

              来源IP地址。

            • netmaskStringRequired

              No description provided.

            • gatewayStringRequired

              No description provided.

            • usedForStringRequired

              已使用用于。

            • ipInLonglongRequired

              No description provided.

            • vmNicUuidStringRequired

              The UUID of the VM NIC.

            • createDateTimestampRequired

              The creation date.

            • lastOpDateTimestampRequired

              The last operation date.

        • allVolumesListRequired

          See allVolumes.

          • uuidStringRequired

            The resource UUID.

          • nameStringRequired

            The resource name.

          • descriptionStringRequired

            The detailed description of the resource.

          • primaryStorageUuidStringRequired

            The primary storage UUID.

          • vmInstanceUuidStringRequired

            The VM instance UUID.

          • diskOfferingUuidStringRequired

            The disk offering UUID.

          • rootImageUuidStringRequired

            根镜像UUID。

          • installPathStringRequired

            安装路径。

          • typeStringRequired

            类型。

          • formatStringRequired

            数据格式或导出格式。

          • sizeLongRequired

            返回记录数。

          • actualSizeLongRequired

            实际大小。

          • deviceIdIntegerRequired

            设备ID。

          • stateStringRequired

            当前状态。

          • statusStringRequired

            状态信息。

          • createDateTimestampRequired

            The creation date.

          • lastOpDateTimestampRequired

            The last operation date.

          • isShareableBooleanRequired

            是否可分享。

          • volumeQosStringRequired

            No description provided.

          • lastDetachDateTimestampRequired

            最近一次detach时间。

          • lastVmInstanceUuidStringRequired

            最近一次云主机实例UUID。

        • vmCdRomsListRequired

          See cmCdRoms.

          • uuidStringRequired

            The resource UUID.

          • vmInstanceUuidStringRequired

            The VM instance UUID.

          • deviceIdIntegerRequired

            设备ID。

          • isoUuidStringRequired

            No description provided.

          • isoInstallPathStringRequired

            iso安装路径。

          • nameStringRequired

            The resource name.

          • descriptionString

            Optional. The detailed description of the resource.

          • createDateTimestampRequired

            The creation date.

          • lastOpDateTimestampRequired

            The last operation date.

Endpoint

PUT/zstack/v1/vm-instances/{vmInstanceUuid}/actions

/zstack/v1/vm-instances/{vmInstanceUuid}/actions

Operation ID

CloneVmInstance

Permalink

Request Example

curl -X PUT 'http://{host}/zstack/v1/vm-instances/{vmInstanceUuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"clonevminstance":{"strategy":"<strategy>","names":["<names>"],"full":true,"primaryStorageUuidForRootVolume":"<primaryStorageUuidForRootVolume>","primaryStorageUuidForDataVolume":"<primaryStorageUuidForDataVolume>","rootVolumeSystemTags":["<rootVolumeSystemTags>"],"dataVolumeSystemTags":["<dataVolumeSystemTags>"],"clusterUuid":"<clusterUuid>","hostUuid":"<hostUuid>","vmNicParams":["<vmNicParams>"]},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'

Response Example

200
{ "result": { "numberOfClonedVm": 1, "inventories": [ { "inventory": { "uuid": "327b60d6b8cd31489ade6f4830bcec16", "name": "new vm name", "description": "web server VM", "zoneUuid": "d886a09330e13282b7a320a98d0a53ec", "clusterUuid": "f6f07dff7ede3b8cac7c8595a1698832", "imageUuid": "3b7ff22eb60d38318835817ba6a2b6a2", "hostUuid": "70c0f5223d083dfea2f1a02f69906306", "lastHostUuid": "123f7f85f82f3e99940836d97ae18e04", "instanceOfferingUuid": "001537d10c433857a7a98ae0a362c910", "rootVolumeUuid": "c8be7ec6a8573d98a580b457a7245141", "platform": "Linux", "defaultL3NetworkUuid": "2ac50b85591b3e87b2686c529cf062f9", "type": "UserVm", "hypervisorType": "KVM", "memorySize": 8589934592, "cpuNum": 1, "allocatorStrategy": "LastHostPreferredAllocatorStrategy", "createDate": "Nov 14, 2017 10:20:57 PM", "lastOpDate": "Nov 14, 2017 10:20:57 PM", "state": "Running", "allVolumes": [ { "uuid": "c8be7ec6a8573d98a580b457a7245141", "name": "Root-Volume-For-VM-327b60d6b8cd31489ade6f4830bcec16", "primaryStorageUuid": "c2a27c5268493a5cba84b94e37b86b4d", "vmInstanceUuid": "327b60d6b8cd31489ade6f4830bcec16", "diskOfferingUuid": "358e00e7245a39b9aa1c1849d6ba9701", "rootImageUuid": "3b7ff22eb60d38318835817ba6a2b6a2", "installPath": "/zstack_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-c8be7ec6a8573d98a580b457a7245141/c8be7ec6a8573d98a580b457a7245141.qcow2", "type": "Root", "format": "qcow2", "size": 107374182400, "actualSize": 21474836480, "deviceId": 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