SetVmBootOrder
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.
{
"setVmBootOrder": {
"bootOrder": [
"CdRom",
"HardDisk"
]
},
"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 '{"setVmBootOrder":{"bootOrder":["CdRom","HardDisk"]}}' \
http://localhost:8080/zstack/v1/vm-instances/f757785b3980305095c89eb2b4e1b785/actionsRequest Parameters
Note:
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| uuid | String | url | The VM instance UUID. | 0.6 | |
| bootOrder | List | body (contained in the setVmBootOrder structure) | Optional. The boot device. Options:
|
0.6 | |
| systemTags | List | body | Optional. The system tags. | 0.6 | |
| userTags | List | body | Optional. The user tags. | 0.6 |
Note:
- When you specify the boot device of a VM instance in ZStack Cloud, you can specify the boot order by adding
the BOOT_ORDER_ONCE option to SystemTags. Note that the
setting will take effect during next boot.
- Format of the BOOT_ORDER_ONCE option:
bootOrderOnce::{%s} - Example:
bootOrder::Network,CdRom,HardDisk
- Format of the BOOT_ORDER_ONCE option:
API Response
Sample
Response
{
"inventory": {
"uuid": "16a1759999f43522989d50257c148f03",
"name": "Test-VM",
"description": "web server VM",
"zoneUuid": "52c0c4d3965330c78035324338caca26",
"clusterUuid": "0d18aab547103bcfb2098655bd1fc71b",
"imageUuid": "f2a2344a96a93d84958cdd8e9396ac53",
"hostUuid": "fbd24b0405723d06b41fb0d41d126a53",
"lastHostUuid": "3e0502a12a413e5a8cea8022d774e8f7",
"instanceOfferingUuid": "bac644877b783182ace705f49d8b0d5d",
"rootVolumeUuid": "963beb34a38a31c6a663861152ebdfa7",
"platform": "Linux",
"defaultL3NetworkUuid": "58e3259d7ac63196bab7b4fde66a63e4",
"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": "Stopped",
"vmNics": [
{
"uuid": "843c879cfd36341a845551d4f3f80adc",
"vmInstanceUuid": "16a1759999f43522989d50257c148f03",
"usedIpUuid": "34e14b0d570930bbaf521e6cf11703ad",
"l3NetworkUuid": "58e3259d7ac63196bab7b4fde66a63e4",
"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": "963beb34a38a31c6a663861152ebdfa7",
"name": "Root-Volume-For-VM-16a1759999f43522989d50257c148f03",
"primaryStorageUuid": "bb0ef0006c0831bcba36bf8cb449e4e5",
"vmInstanceUuid": "16a1759999f43522989d50257c148f03",
"diskOfferingUuid": "d3208f0181f1312b8807e228e1f89bc9",
"rootImageUuid": "f2a2344a96a93d84958cdd8e9396ac53",
"installPath": "/Cloud_ps/rootVolumes/acct-36c27e8ff05c4780bf6d2fa65700f22e/vol-963beb34a38a31c6a663861152ebdfa7/963beb34a38a31c6a663861152ebdfa7.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"
}
]
}
}| 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 | |
| ipVersion | Integer | The IP version. | 3.1.0 |
| deviceId | Integer | 0.6 | |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| usedIps | List | See usedIps. | 0.6 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 0.6 |
| ipRangeUuid | String | The IP range UUID. | 0.6 |
| l3NetworkUuid | String | The L3 network UUID. | 0.6 |
| ipVersion | Integer | The IP version. | 3.1.0 |
| ip | String | The IP address. | 0.6 |
| netmask | String | The netmask. | 0.6 |
| gateway | String | The gateway. | 0.6 |
| usedFor | String | 0.6 | |
| ipInLong | long | 0.6 | |
| vmNicUuid | String | The VM NIC UUID. | 3.1.0 |
| 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 | The root image UUID. | 0.6 |
| installPath | String | The volume installation path on the primary storage. | 0.6 |
| type | String | The volume type, including data volume and root volume. | 0.6 |
| format | String | The volume format. | 0.6 |
| size | Long | The volume size. | 0.6 |
| actualSize | Long | The actual size of the volume. | 0.6 |
| deviceId | Integer | 0.6 | |
| state | String | Whether the volume is enabled. | 0.6 |
| status | String | The volume status. | 0.6 |
| createDate | Timestamp | The creation date. | 0.6 |
| lastOpDate | Timestamp | The last operation date. | 0.6 |
| isShareable | Boolean | Whether the volume can be shared. | 0.6 |
| volumeQos | String | The volume QoS. Format: total=1048576. | 3.2.0 |
SDK Sample
Java
SDK
SetVmBootOrderAction action = new SetVmBootOrderAction();
action.uuid = "a83e7ff6d8d84f6fa48a089b2a918258";
action.bootOrder = asList("CdRom","HardDisk");
action.sessionId = "93251a3a33994bd9b3d54d4d9abcf5d7";
SetVmBootOrderAction.Result res = action.call();Python
SDK
SetVmBootOrderAction action = SetVmBootOrderAction()
action.uuid = "dccc7be070934387b50fe96f30439231"
action.bootOrder = [CdRom, HardDisk]
action.sessionId = "2da90129d60741a3bc69228448ed9795"
SetVmBootOrderAction.Result res = action.call()