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
vmInstanceUuidStringRequiredThe VM instance UUID.
Body Fields
clonevminstanceObjectRequiredclonevminstance request body object.
strategyStringOptional. The strategy.
namesListRequiredThe VM instance name list.
fullBooleanOptional. Whether to clone the data volume that is attached to the VM instance.
primaryStorageUuidForRootVolumeStringOptional.
primaryStorageUuidForDataVolumeStringOptional
rootVolumeSystemTagsListOptional
dataVolumeSystemTagsListOptional.
clusterUuidStringOptional. The cluster UUID.
hostUuidStringOptional. The host UUID.
vmNicParamsListOptional. The VM NIC parameter.
systemTagsListOptional. The system tags.
userTagsListOptional. The user tags.
Responses
Endpoint
PUT/zstack/v1/vm-instances/{vmInstanceUuid}/actions
/zstack/v1/vm-instances/{vmInstanceUuid}/actions
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.
