SetVmQxlMemory

API Request

URLs
PUT zstack/v1/vm-instances/{uuid}/actions
Headers
Authorization: OAuth the-session-uuid
Body
{
  "setVmQxlMemory": {
    "ram": 65536.0,
    "vram": 32768.0,
    "vgamem": 16384.0
  },
  "systemTags": [],
  "userTags": []
}
Note: In the preceding sample, both systemTags and userTags are optional. These two fields can be included in the body structure.
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"setVmQxlMemory":{"ram":65536.0,"vram":32768.0,"vgamem":16384.0}}' http://localhost:8080/zstack/v1/vm-instances/cc590b2129c437a487311b0f9a8a0dbc/actions
Request Parameters
Name Type Location Description Optional Value Starting Version
uuid String url The VM instance UUID. 3.7.0
ram Integer body (contained in the setVmQxlMemory structure) Optional. The Random Access Memory (RAM) size. Default value: 65536. 3.7.0
vram Integer body (contained in the setVmQxlMemory structure) Optional. The video RAM (VRAM) size. Default value: 32768. 3.7.0
vgamem Integer body (contained in the setVmQxlMemory structure) Optional. The Video Graphics Array (VGA) memory size. Default value: 16384. 3.7.0
systemTags List body Optional. The system tags. 3.7.0
userTags List body Optional. The user tags. 3.7.0
Note:
  • When you create a VM instance in ZStack Cloud, you can set the QXL memory size by adding the qxlMemory option to SystemTags. The SystemTag is passed by using the qxlMemory parameter.
    • Format of the qxlMemory option: qxlMemory::ram::vram::vgamem
    • Example: qxlMemory::65536::32768::16384

API Response

When the API succeeded, an empty JSON structure {} is returned. When the API failed, the returned JSON structure includes an error field. For example,
{
	"error": {
		"code": "SYS.1001",
		"description": "A message or a operation timeout",
		"details": "Create VM on KVM timeout after 300s"
	}
}

SDK Sample

Java SDK
SetVmQxlMemoryAction action = new SetVmQxlMemoryAction();
action.uuid = "cc590b2129c437a487311b0f9a8a0dbc";
action.ram = 65536.0;
action.vram = 32768.0;
action.vgamem = 16384.0;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetVmQxlMemoryAction.Result res = action.call();
Python SDK
SetVmQxlMemoryAction action = SetVmQxlMemoryAction()
action.uuid = "cc590b2129c437a487311b0f9a8a0dbc"
action.ram = 65536.0
action.vram = 32768.0
action.vgamem = 16384.0
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetVmQxlMemoryAction.Result res = action.call()