VM Related Interfaces

Set VM NUMA

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

Headers

Authorization: OAuth the-session-uuid

Body

{
  "setVmNuma": {
    "enable": true
  },
  "systemTags": [],
  "userTags": []
}

In the example above, systemTags and userTags fields can be omitted. They are listed to indicate that the body can contain these two fields.

Curl Example

curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X PUT -d '{"setVmNuma":{"enable":true}}' http://localhost:8080/zstack/v1/vm-instances/f523cb5736b630acb643dda6d31be5a0/actions

Parameter List

NameTypeLocationDescriptionAllowed ValuesStarting Version
uuidStringurlVM UUID, uniquely identifies the resource 4.3.12
enablebooleanbody (contained in setVmNuma structure)Whether VM NUMA is enabled 4.3.12
systemTags (Optional)Listbody  4.3.12
userTags (Optional)Listbody  4.3.12
  • ZSvirt supports affinity group when setting VM vNUMA, SystemTags adds affinityGroup option.
  • Option format: affinityGroupUuid::UUID
  • For example: affinityGroupUuid::5fd71606d5af451d981413f35367a8d6

API Response

On success, this API returns an empty JSON structure {}. On error, the returned JSON structure contains 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 Examples

Java SDK

SetVmNumaAction action = new SetVmNumaAction();
action.uuid = "f523cb5736b630acb643dda6d31be5a0";
action.enable = true;
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
SetVmNumaAction.Result res = action.call();

Python SDK

SetVmNumaAction action = SetVmNumaAction()
action.uuid = "f523cb5736b630acb643dda6d31be5a0"
action.enable = true
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
SetVmNumaAction.Result res = action.call()