AttachIsoToVmInstance

API Request

URLs
POST zstack/v1/vm-instances/{vmInstanceUuid}/iso/{isoUuid}
Headers
Authorization: OAuth the-session-uuid
Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST http://localhost:8080/zstack/v1/vm-instances/b1105c5dd00f323d99aa182dee237628/iso/8f36a77ab76e3425a571a7f75fca2d69
Request Parameters
Name Type Location Description Optional Value Starting Version
vmInstanceUuid String url The VM instance UUID. 0.6
isoUuid String url The ISO UUID. 0.6
systemTags List body Optional. The system tags. 0.6
userTags List body Optional. The user tags. 0.6
Note:
  • When you attach an ISO image to a VM instance in ZStack Cloud, you can specify the target CD-ROM by adding the cdromUuid option to SystemTags. The SystemTag is passed by using the cdromUuid parameter.
    • Format of the cdromUuid option: cdromUuid::cdrom_xx_uuid
    • Example: cdromUuid::cdrom_xx_uuid

API Response

Sample Response
{
  "inventory": {
    "uuid": "7105b03e09794680b7ba1027f812c987",
    "name": "Test-VM",
    "description": "web server VM",
    "zoneUuid": "8fa381c6f74d4e6fb45fa83536dcd5b8",
    "clusterUuid": "e3ec6c0da6dd48318e4e714a653de68d",
    "imageUuid": "d74932c666774571a9fa1dfa648eb1be",
    "hostUuid": "7eae91b419e444dcb5964557048e8b98",
    "lastHostUuid": "d6e533fdf3704b77bb2417fdeaf49812",
    "instanceOfferingUuid": "5d92054212bc468bb1789c3343ed6472",
    "rootVolumeUuid": "2b0f6bb1aaf44768ad94b8fe2b747f5e",
    "platform": "Linux",
    "defaultL3NetworkUuid": "c9527ab637ed43d6a82ef64eaaebc7d4",
    "type": "UserVm",
    "hypervisorType": "KVM",
    "memorySize": 8.589934592E9,
    "cpuNum": 1.0,
    "allocatorStrategy": "LastHostPreferredAllocatorStrategy",
    "createDate": "May 11, 2017 1:23:01 PM",
    "lastOpDate": "May 11, 2017 1:23:01 PM",
    "state": "Running",
    "vmNics": [
      {
        "uuid": "f20b08a8c81b42959c6b33f34d012cfa",
        "vmInstanceUuid": "7105b03e09794680b7ba1027f812c987",
        "usedIpUuid": "1338d1697352464383dbdc9ba89311a6",
        "l3NetworkUuid": "c9527ab637ed43d6a82ef64eaaebc7d4",
        "ip": "192.168.1.10",
        "mac": "00:0c:29:bd:99:fc",
        "netmask": "255.255.255.0",
        "gateway": "192.168.1.1",
        "deviceId": 0.0,
        "createDate": "May 11, 2017 1:23:01 PM",
        "lastOpDate": "May 11, 2017 1:23:01 PM"
      }
    ],
    "allVolumes": [
      {
        "uuid": "2b0f6bb1aaf44768ad94b8fe2b747f5e",
        "name": "Root-Volume-For-VM-7105b03e09794680b7ba1027f812c987",
        "primaryStorageUuid": "5ceb65417c3a4e94a375f19bda2470b9",
        "vmInstanceUuid": "7105b03e09794680b7ba1027f812c987",
        "diskOfferingUuid": "d6caadf062514f2b8073faefd52fad46",
        "rootImageUuid": "d74932c666774571a9fa1dfa648eb1be",
        "installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/\
vol-2b0f6bb1aaf44768ad94b8fe2b747f5e/2b0f6bb1aaf44768ad94b8fe2b747f5e.qcow2",
        "type": "Root",
        "format": "qcow2",
        "size": 1.073741824E11,
        "actualSize": 2.147483648E10,
        "deviceId": 0.0,
        "state": "Enabled",
        "status": "Ready",
        "createDate": "May 11, 2017 1:23:01 PM",
        "lastOpDate": "May 11, 2017 1:23:01 PM"
      }
    ]
  }
}
Name Type Description Starting Version
error ErrorCode The error code. If not null, the operation fails, or vice versa. For more information, see error. 0.6
inventory VmInstanceInventory See inventory. 0.6
#error
Name Type Description Starting Version
code String The error code, which is a numbered or alphanumeric code that specifies an error. For example, SYS.1000, HOST.1001. 0.6
description String The brief description of the error. 0.6
details String The details about the error. 0.6
elaboration String The reserved field. Default value: null. 0.6
opaque LinkedHashMap The reserved field. Default value: null. 0.6
cause ErrorCode The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. 0.6
#inventory
Name Type Description Starting Version
uuid String The resource UUID. 0.6
name String The resource name. 0.6
description String The detailed description of the resource. 0.6
zoneUuid String The zone UUID. 0.6
clusterUuid String The cluster UUID. 0.6
imageUuid String The image UUID. 0.6
hostUuid String The host UUID. 0.6
lastHostUuid String 0.6
instanceOfferingUuid String The instance offering UUID. 0.6
rootVolumeUuid String The root volume UUID. 0.6
platform String 0.6
defaultL3NetworkUuid String 0.6
type String 0.6
hypervisorType String 0.6
memorySize Long 0.6
cpuNum Integer 0.6
cpuSpeed Long 0.6
allocatorStrategy String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
state String 0.6
vmNics List See vmNics. 0.6
allVolumes List See allVolumes. 0.6
#vmNics
Name Type Description Starting Version
uuid String The resource UUID. 0.6
vmInstanceUuid String The VM instance UUID. 0.6
l3NetworkUuid String The L3 network UUID. 0.6
ip String 0.6
mac String 0.6
netmask String 0.6
gateway String 0.6
metaData String 0.6
deviceId Integer 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
#allVolumes
Name Type Description Starting Version
uuid String The resource UUID. 0.6
name String The resource name. 0.6
description String The detailed description of the resource. 0.6
primaryStorageUuid String The primary storage UUID. 0.6
vmInstanceUuid String The VM instance UUID. 0.6
diskOfferingUuid String The disk offering UUID. 0.6
rootImageUuid String 0.6
installPath String 0.6
type String 0.6
format String 0.6
size Long 0.6
actualSize Long 0.6
deviceId Integer 0.6
state String 0.6
status String 0.6
createDate Timestamp The creation date. 0.6
lastOpDate Timestamp The last operation date. 0.6
isShareable Boolean 0.6

SDK Sample

Java SDK
AttachIsoToVmInstanceAction action = new AttachIsoToVmInstanceAction();
action.vmInstanceUuid = "6f18cd9b9c1d4a6a860bf08775572904";
action.isoUuid = "32ff7e18cd844e32a1b0225544ac9539";
action.sessionId = "d495ba4961e14d438c5e3ebb9c0f5996";
AttachIsoToVmInstanceAction.Result res = action.call();
Python SDK
AttachIsoToVmInstanceAction action = AttachIsoToVmInstanceAction()
action.vmInstanceUuid = "12819ba2af514022b355d474fe254fae"
action.isoUuid = "c907863d2fc84b729bececdab2de5c31"
action.sessionId = "b3acb29da25f4bfaa9a6960b8be9c2ca"
AttachIsoToVmInstanceAction.Result res = action.call()