CreateBareMetal2InstanceFromVmBackup
API Request
URLs
POST zstack/v1/baremetal2-instance/from/vm-backup/{groupUuid}Headers
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.
{
"params": {
"name": "New-BareMetal-Instance",
"description": "This is a bare metal instance created from vm backup.",
"zoneUuid": "ab593cddece13e78b2a1b7745870eb87",
"clusterUuid": "6d775d44d2153da9956f3173b0138646",
"gatewayUuid": "78da4dbcec473f45b002064f463a0d09",
"chassisUuid": "3b099920323a3b539df62af1af86d47c",
"chassisDiskUuid": "f705f9c189ab32bf9ad97255fe8fab55",
"primaryStorageUuidForRootVolume": "24c91178649f342283e4d7d7dfb3fe27",
"rootVolumeSystemTags": [
"tag1",
"tag2"
],
"gatewayAllocatorStrategy": "DefaultAllocatorStrategy"
},
"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 POST -d '{"params":{"name":"New-BareMetal-Instance","description":"This is a bare metal instance created from vm backup.","zoneUuid":"ab593cddece13e78b2a1b7745870eb87","clusterUuid":"6d775d44d2153da9956f3173b0138646","gatewayUuid":"78da4dbcec473f45b002064f463a0d09","chassisUuid":"3b099920323a3b539df62af1af86d47c","chassisDiskUuid":"f705f9c189ab32bf9ad97255fe8fab55","primaryStorageUuidForRootVolume":"24c91178649f342283e4d7d7dfb3fe27","rootVolumeSystemTags":["tag1","tag2"],"gatewayAllocatorStrategy":"DefaultAllocatorStrategy"}}' \
http://localhost:8080/zstack/v1/baremetal2-instance/from/vm-backup/a4cdc1a10d7d3e9397c01e0136bc1eabRequest Parameters
| Name | Type | Location | Description | Optional Value | Starting Version |
|---|---|---|---|---|---|
| name | String | body(included in the params structure) | The resource name. | 5.5.6 | |
| description | String | body(included in the params structure) | Optional. The detailed description of the resource. | 5.5.6 | |
| zoneUuid | String | body(included in the params structure) | Optional. The zone UUID. | 5.5.6 | |
| clusterUuid | String | body(included in the params structure) | Optional. The cluster UUID. | 5.5.6 | |
| gatewayUuid | String | body(included in the params structure) | Optional. The bare metal gateway node UUID. | 5.5.6 | |
| groupUuid | String | url | The backup data group UUID. | 5.5.6 | |
| chassisUuid | String | body(included in the params structure) | Optional. The bare metal node UUID. | 5.5.6 | |
| chassisOfferingUuid | String | body(included in the params structure) | Optional. The chassis offering UUID. Note: For the chassisUuid and chassisOfferingUuid parameters, you must set at least one of them. |
5.5.6 | |
| chassisDiskUuid | String | body(included in the params structure) | 5.5.6 | ||
| primaryStorageUuidForRootVolume | String | body(included in the params structure) | Optional. The primary storage UUID for the root volume. | 5.5.6 | |
| primaryStorageUuidForDataVolume | String | body(included in the params structure) | Optional. The primary storage UUID for the data volume. | 5.5.6 | |
| dataDiskOfferingUuids | List | body(included in the params structure) | Optional. The data volume disk offering UUID list. | 5.5.6 | |
| rootVolumeSystemTags | List | body(included in the params structure) | Optional. The root volume system tags. | 5.5.6 | |
| dataVolumeSystemTags | List | body(included in the params structure) | Optional. The data volume system tags. | 5.5.6 | |
| gatewayAllocatorStrategy | String | body(included in the params structure) | Optional. The bare metal gateway node allocation strategy. | 5.5.6 | |
| resourceUuid | String | body(included in the params structure) | Optional. The resource UUID. | 5.5.6 | |
| tagUuids | List | body(included in the params structure) | Optional. The tag UUID list. | 5.5.6 | |
| systemTags | List | body | Optional. The system tags. | 5.5.6 | |
| userTags | List | body | Optional. The user tags. | 5.5.6 |
API Response
Sample Response
{
"inventory": {
"chassisUuid": "81554a6ff599416b9e52ced2af50f6e9",
"lastChassisUuid": "59fd7178455f479da6bc83de953898ea",
"gatewayUuid": "8fbe18d4be76461383b540611df22b7e",
"lastGatewayUuid": "d492e5b96f5a4fa88cb0ac304902f5c2",
"chassisOfferingUuid": "6ef976116b4346de88d4e70f2ff8498c",
"status": "Connected",
"provisionType": "Remote",
"agentVersion": "2.0.0",
"isLatestAgent": true,
"uuid": "3261d308bf1b4295a8bbdc1c52b08e33",
"name": "BM-1",
"description": "This is a BareMetal2 Instance.",
"zoneUuid": "d5849358f65c40518904cdbaba78b821",
"clusterUuid": "ce69c134f6344119af9faeaf6f0a735a",
"imageUuid": "9da74193c8b5413d890955fcaef694cf",
"rootVolumeUuid": "3a29abbc54c040f597469300200aaa7b",
"platform": "Linux",
"type": "baremetal2",
"memorySize": 8589934592,
"cpuNum": 8,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"state": "Running"
}
}| Name | Type | Description | Starting Version |
|---|---|---|---|
| success | boolean | 5.5.6 | |
| error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 5.5.6 |
| inventory | BareMetal2InstanceInventory | See inventory. | 5.5.6 |
#inventory
| Name | Type | Description | Starting Version |
|---|---|---|---|
| chassisUuid | String | The bare metal node UUID. | 4.0.0 |
| lastChassisUuid | String | The last bare metal node UUID. | 4.0.0 |
| gatewayUuid | String | The bare metal gateway node UUID. | 4.0.0 |
| lastGatewayUuid | String | The last bare metal gateway node UUID. | 4.0.0 |
| chassisOfferingUuid | String | The chassis offering UUID. | 4.0.0 |
| gatewayAllocatorStrategy | String | The bare metal gateway node allocation strategy. | 4.0.0 |
| status | String | The connection status. | 4.0.0 |
| provisionType | String | 4.7.13 | |
| agentVersion | String | 4.7.13 | |
| isLatestAgent | boolean | 4.7.13 | |
| uuid | String | The resource UUID. | 4.0.0 |
| name | String | The resource name. | 4.0.0 |
| description | String | The detailed description of the resource. | 4.0.0 |
| zoneUuid | String | The zone UUID. | 4.0.0 |
| clusterUuid | String | The cluster UUID. | 4.0.0 |
| imageUuid | String | The image UUID. | 4.0.0 |
| hostUuid | String | The host UUID. | 4.7.13 |
| lastHostUuid | String | 4.7.13 | |
| instanceOfferingUuid | String | The instance offering UUID. | 4.7.13 |
| rootVolumeUuid | String | The root volume UUID. | 4.0.0 |
| platform | String | The platform type. | 4.0.0 |
| architecture | String | 4.7.13 | |
| defaultL3NetworkUuid | String | The default L3 network UUID. | 4.0.0 |
| type | String | The type. | 4.0.0 |
| hypervisorType | String | The hypervisor type. | 4.0.0 |
| memorySize | Long | The memory size. | 4.0.0 |
| cpuNum | Integer | The CPU number. | 4.0.0 |
| cpuSpeed | Long | The CPU speed. | 4.0.0 |
| allocatorStrategy | String | 4.7.13 | |
| createDate | Timestamp | The creation date. | 4.0.0 |
| lastOpDate | Timestamp | The last operation date. | 4.0.0 |
| state | String | The state. | 4.0.0 |
| guestOsType | String | 4.7.13 | |
| provisionNics | BareMetal2InstanceProvisionNicInventory | See provisionNics. | 4.0.0 |
| vmNics | List | See vmNics. | 4.0.0 |
| allVolumes | List | See allVolumes. | 4.0.0 |
| vmCdRoms | List | See vmCdRoms. | 4.7.13 |
#provisionNics
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.0.0 |
| networkUuid | String | The bare metal provisioning network UUID. | 4.0.0 |
| mac | String | The MAC address. | 4.0.0 |
| ip | String | The IP address. | 4.0.0 |
| netmask | String | The netmask. | 4.0.0 |
| gateway | String | The gateway. | 4.0.0 |
| metadata | String | 4.0.0 | |
| createDate | Timestamp | The creation date. | 4.0.0 |
| lastOpDate | Timestamp | The last operation date. | 4.0.0 |
#vmNics
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.7.13 |
| vmInstanceUuid | String | The VM instance UUID. | 4.7.13 |
| l3NetworkUuid | String | The L3 network UUID. | 4.7.13 |
| ip | String | 4.7.13 | |
| mac | String | 4.7.13 | |
| hypervisorType | String | 4.7.13 | |
| netmask | String | 4.7.13 | |
| gateway | String | 4.7.13 | |
| metaData | String | 4.7.13 | |
| ipVersion | Integer | 4.7.13 | |
| driverType | String | 4.7.13 | |
| internalName | String | 4.7.13 | |
| deviceId | Integer | 4.7.13 | |
| type | String | 4.7.13 | |
| state | String | The NIC state. | 4.7.13 |
| createDate | Timestamp | The creation date. | 4.7.13 |
| lastOpDate | Timestamp | The last operation date. | 4.7.13 |
| usedIps | List | See usedIps. | 4.7.13 |
#usedIps
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 5.0.0 |
| ipRangeUuid | String | The IP range UUID. | 5.0.0 |
| l3NetworkUuid | String | The L3 network UUID. | 5.0.0 |
| ipVersion | Integer | 5.0.0 | |
| ip | String | 5.0.0 | |
| netmask | String | 5.0.0 | |
| gateway | String | 5.0.0 | |
| usedFor | String | The allocation reason. | 5.0.0 |
| ipInLong | long | 5.0.0 | |
| ipInBinary | byte[] | 5.2.0 | |
| vmNicUuid | String | The VM instance NIC UUID. | 5.0.0 |
| createDate | Timestamp | The creation date. | 5.0.0 |
| lastOpDate | Timestamp | The last operation date. | 5.0.0 |
#allVolumes
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.7.13 |
| name | String | The resource name. | 4.7.13 |
| description | String | The detailed description of the resource. | 4.7.13 |
| primaryStorageUuid | String | The primary storage UUID. | 4.7.13 |
| vmInstanceUuid | String | The VM instance UUID. | 4.7.13 |
| diskOfferingUuid | String | The disk offering UUID. | 4.7.13 |
| rootImageUuid | String | 4.7.13 | |
| installPath | String | 4.7.13 | |
| type | String | 4.7.13 | |
| format | String | 4.7.13 | |
| size | Long | 4.7.13 | |
| actualSize | Long | 4.7.13 | |
| deviceId | Integer | 4.7.13 | |
| state | String | 4.7.13 | |
| status | String | 4.7.13 | |
| createDate | Timestamp | The creation date. | 4.7.13 |
| lastOpDate | Timestamp | The last operation date. | 4.7.13 |
| isShareable | Boolean | 4.7.13 | |
| volumeQos | String | 4.7.13 | |
| lastDetachDate | Timestamp | 4.7.13 | |
| lastVmInstanceUuid | String | 4.7.13 |
#vmCdRoms
| Name | Type | Description | Starting Version |
|---|---|---|---|
| uuid | String | The resource UUID. | 4.7.13 |
| vmInstanceUuid | String | The VM instance UUID. | 4.7.13 |
| deviceId | Integer | 4.7.13 | |
| isoUuid | String | 4.7.13 | |
| isoInstallPath | String | 4.7.13 | |
| name | String | The resource name. | 4.7.13 |
| description | String | The detailed description of the resource. | 4.7.13 |
| createDate | Timestamp | The creation date. | 4.7.13 |
| lastOpDate | Timestamp | The last operation date. | 4.7.13 |
#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. | 5.3.20 |
| description | String | The brief description of the error. | 5.3.20 |
| details | String | The details about the error. | 5.3.20 |
| elaboration | String | The reserved field. Default value: null. | 5.3.20 |
| opaque | LinkedHashMap | The reserved field. Default value: null. | 5.3.20 |
| cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 5.3.20 |
SDK Sample
Java SDK
CreateBareMetal2InstanceFromVmBackupAction action = new CreateBareMetal2InstanceFromVmBackupAction();
action.name = "New-BareMetal-Instance";
action.description = "This is a bare metal instance created from vm backup.";
action.zoneUuid = "ab593cddece13e78b2a1b7745870eb87";
action.clusterUuid = "6d775d44d2153da9956f3173b0138646";
action.gatewayUuid = "78da4dbcec473f45b002064f463a0d09";
action.groupUuid = "a4cdc1a10d7d3e9397c01e0136bc1eab";
action.chassisUuid = "3b099920323a3b539df62af1af86d47c";
action.chassisDiskUuid = "f705f9c189ab32bf9ad97255fe8fab55";
action.primaryStorageUuidForRootVolume = "24c91178649f342283e4d7d7dfb3fe27";
action.rootVolumeSystemTags = asList("tag1","tag2");
action.gatewayAllocatorStrategy = "DefaultAllocatorStrategy";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateBareMetal2InstanceFromVmBackupAction.Result res = action.call();Python SDK
CreateBareMetal2InstanceFromVmBackupAction action = CreateBareMetal2InstanceFromVmBackupAction()
action.name = "New-BareMetal-Instance"
action.description = "This is a bare metal instance created from vm backup."
action.zoneUuid = "ab593cddece13e78b2a1b7745870eb87"
action.clusterUuid = "6d775d44d2153da9956f3173b0138646"
action.gatewayUuid = "78da4dbcec473f45b002064f463a0d09"
action.groupUuid = "a4cdc1a10d7d3e9397c01e0136bc1eab"
action.chassisUuid = "3b099920323a3b539df62af1af86d47c"
action.chassisDiskUuid = "f705f9c189ab32bf9ad97255fe8fab55"
action.primaryStorageUuidForRootVolume = "24c91178649f342283e4d7d7dfb3fe27"
action.rootVolumeSystemTags = [tag1, tag2]
action.gatewayAllocatorStrategy = "DefaultAllocatorStrategy"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateBareMetal2InstanceFromVmBackupAction.Result res = action.call()