AttachGuestToolsIsoToVm
API Request
URLs
PUT zstack/v1/vm-instances/{uuid}/actionsHeaders
Authorization: OAuth the-session-uuidBody
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"attachGuestToolsIsoToVm": {},
"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 '{"attachGuestToolsIsoToVm":{}}' http://localhost:8080/zstack/v1/vm-instances/f58d939e32073aa49acc4897bf81ae45/actionsRequest Parameters
Note:
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The resource UUID. | 3.7.0 | |
| systemTags | List | body | Optional. The system tags. | 3.7.0 | |
| userTags | List | body | Optional. The user tags. | 3.7.0 |
Note:
- After you attach the GuestTools to a VM instance in
ZStack Cloud, the cloud records the
GuestTools version. Note that you can add the GuestTools option
to SystemTags.
- Format of the GuestTools option:
GuestTools::TOOLS_VERSION. Here, the initial value of TOOLS_VERSION is 1.0.0. This value will change as the version of GuestTools is upgraded. - Example:
GuestTools::1.0.0 - The cloud records the version of the GuestTools ISO installed on a host, compares the version with that in the /opt/zstack-dvd directory of the management node, and then decides whether to upgrade the GuestTools ISO.
- Format of the GuestTools option:
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
AttachGuestToolsIsoToVmAction action = new AttachGuestToolsIsoToVmAction();
action.uuid = "f58d939e32073aa49acc4897bf81ae45";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
AttachGuestToolsIsoToVmAction.Result res = action.call();Python
SDK
AttachGuestToolsIsoToVmAction action = AttachGuestToolsIsoToVmAction()
action.uuid = "f58d939e32073aa49acc4897bf81ae45"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
AttachGuestToolsIsoToVmAction.Result res = action.call()