UpdateVmInstance
UpdateVmInstance
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
updatevminstanceObjectRequiredupdatevminstance request body object.
nameStringOptional. The VM instance name.
descriptionStringOptional. The detailed description of the VM instance.
stateStringOptional. The state of the VM instance. Generally, the state of a VM instance cannot be updated directly. Otherwise, ZStack Cloud might misjudge the state of the VM instance. This parameter can be used only when the actual state of the VM instance is inconsistent with the state recorded by ZStack Cloud, and the synchronization mechanism of ZStack Cloud has expired (which is us usually a bug). The administrator must fully understand the consequences of using this parameter.
defaultL3NetworkUuidStringOptional. The UUID of the default L3 network.
platformStringOptional. The platform type of the VM instance.
cpuNumIntegerOptional. The CPU count of the VM instance. You must stop or enable the VM instance for the setting of this parameter to take effect. The VM instance that is created when NUMA is set to true in global settings can be adjusted.
memorySizeLongOptional. The memory size of the VM instance. You must stop or enable the VM instance for the setting of this parameter to take effect. The VM instance that is created when NUMA is set to true in global settings can be adjusted.
guestOsTypeStringOptional.
systemTagsListOptional. The system tags.
userTagsListOptional. The user 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 '{"updatevminstance":{"name":"<name>","description":"<description>","state":"<state>","defaultL3NetworkUuid":"<defaultL3NetworkUuid>","platform":"<platform>","cpuNum":1,"memorySize":1,"guestOsType":"<guestOsType>"},"systemTags":["<systemTags>"],"userTags":["<userTags>"]}'
Response Example
200{ "inventory": { "uuid": "6710cdffb0653455809b6511a6b3aaa4", "name": "new vm name", "description": "web server VM", "zoneUuid": "aa63c5a3b3c436fa94e5e851f057fe23", "clusterUuid": "48b424d94ed239f1b18e1ce37db24cf8", "imageUuid": "4e1ac550da8d30c7b07162acc39773c1", "hostUuid": "1f3ffea4673e3e4197681ee030d1794b", "lastHostUuid": "d334dadb7cfc34da8f6f7d74dfd04692", "instanceOfferingUuid": "33b38aff5cbe3e24a9266300f7163d20", "rootVolumeUuid": "761df8e1eef933ee8d7f3b7f8551b754", "platform": "Linux", "defaultL3NetworkUuid": "3a3c91f4a28a31beb410d6d1c3dc862c", "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": "ae19167e24713aeea9c45e6f2d27249d", "vmInstanceUuid": "6710cdffb0653455809b6511a6b3aaa4", "usedIpUuid": "010f4817011b32d3b476faa3f393d765", "l3NetworkUuid": "3a3c91f4a28a31beb410d6d1c3dc862c", "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": "761df8e1eef933ee8d7f3b7f8551b754", "name": "Root-Volume-For-VM-6710cdffb0653455809b6511a6b3aaa4", "primaryStorageUuid": "da81ed018a9738ff97a16d7b7a43327d", "vmInstanceUuid": "6710cdffb0653455809b6511a6b3aaa4", "diskOfferingUuid": "bd9b406d36c13fc7ad3f995535415898", "rootImageUuid": "4e1ac550da8d30c7b07162acc39773c1", "installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-761df8e1eef933ee8d7f3b7f8551b754/761df8e1eef933ee8d7f3b7f8551b754.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.
