Resource Center/Resource Pool/VM Instance Operations
PUTVM Instance OperationsSince 0.6SynchronousAuth Required
StopVmInstance
StopVmInstance
Execution Availability
Try It Out
Submit a mock request using the current auth context and example-driven inputs.
Path Parameters
Request Inputs
Path Parameters
uuidStringRequiredThe VM instance UUID.
Body Fields
stopvminstanceObjectRequiredstopvminstance request body object.
typeStringOptional. The method to stop (shut down) the VM instance. Options: grace: graceful shutdown. To use this method, make sure that the corresponding ACPI driver is installed in the VM instance. cold: cold shutdown, which means to power off the VM instance directly.
stopHAStringOptional. Completely stops the HA VM instance.
systemTagsListOptional. The system tags.
userTagsListOptional. The system tags.
Responses
Endpoint
PUT/zstack/v1/vm-instances/{uuid}/actions
/zstack/v1/vm-instances/{uuid}/actions
Request Example
curl -X PUT 'http://{host}/zstack/v1/vm-instances/{uuid}/actions' -H 'Authorization: OAuth {sessionUuid}' -H 'Content-Type: application/json;charset=UTF-8' -d '{"stopvminstance":{"type":"<type>","stopHA":"<stopHA>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "02b75a26397b347a8cf5cfaf5ce93ed1", "name": "Test-VM", "description": "web server VM", "zoneUuid": "2a9974ad7f7a343f908709094b509567", "clusterUuid": "e8626869bf793e0984bd4834c36582c4", "imageUuid": "7020002bfd163c9e8bf59e94b3948b3b", "hostUuid": "7cfc6cb3cb0d310281452e452f6fd8a5", "lastHostUuid": "e8b813355af136bdb5c34b1a760e52d4", "instanceOfferingUuid": "c8e4bc576e8633698b340ca572f45ae8", "rootVolumeUuid": "96b787ec9551331c907060238dff530f", "platform": "Linux", "defaultL3NetworkUuid": "6721d14d610037f193c17cb3b6f361b4", "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": "Stopped", "vmNics": [ { "uuid": "f13d9a01d5ff3953823f65f78bd94668", "vmInstanceUuid": "02b75a26397b347a8cf5cfaf5ce93ed1", "usedIpUuid": "9f7711d4a8b43c1ea582cedf98f44759", "l3NetworkUuid": "6721d14d610037f193c17cb3b6f361b4", "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": "96b787ec9551331c907060238dff530f", "name": "Root-Volume-For-VM-02b75a26397b347a8cf5cfaf5ce93ed1", "primaryStorageUuid": "d265ae8ea11d346cb0e657d46b6f2f86", "vmInstanceUuid": "02b75a26397b347a8cf5cfaf5ce93ed1", "diskOfferingUuid": "264dd6d637953cdda2ec0fc0c083a1fa", "rootImageUuid": "7020002bfd163c9e8bf59e94b3948b3b", "installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-96b787ec9551331c907060238dff530f/96b787ec9551331c907060238dff530f.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.
