Document navigation

CreateBareMetal2InstanceFromVolumeBackup

API Request

URLs
POST zstack/v1/baremetal2-instance/from/volume-backup/{backupUuid}
Headers
Authorization: OAuth the-session-uuid
Body
{
  "params": {
    "name": "New-BareMetal-Instance",
    "description": "This is a bare metal instance created from volume backup.",
    "zoneUuid": "a6bd3e3415303e0ba10093587062da90",
    "clusterUuid": "fbbb8afe94e73e6384eb42806a81bbfa",
    "gatewayUuid": "d1cda3e4e0453703a8c1743e570680ee",
    "chassisUuid": "c40496c747af3710aec065a4a993c0a0",
    "chassisDiskUuid": "17e8555e857b38cebe935db9af3f2df6",
    "primaryStorageUuidForRootVolume": "2d21e7bd7c273be4bc630f15aa82e708",
    "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 volume backup.","zoneUuid":"a6bd3e3415303e0ba10093587062da90","clusterUuid":"fbbb8afe94e73e6384eb42806a81bbfa","gatewayUuid":"d1cda3e4e0453703a8c1743e570680ee","chassisUuid":"c40496c747af3710aec065a4a993c0a0","chassisDiskUuid":"17e8555e857b38cebe935db9af3f2df6","primaryStorageUuidForRootVolume":"2d21e7bd7c273be4bc630f15aa82e708","rootVolumeSystemTags":["tag1","tag2"],"gatewayAllocatorStrategy":"DefaultAllocatorStrategy"}}' \
http://localhost:8080/zstack/v1/baremetal2-instance/from/volume-backup/03a77b5d079a3d1da607e6fcca155a67
Request 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
backupUuid String url The backup data 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
rootVolumeSystemTags List body(included in the params structure) Optional. The root 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": "81f62f9cd29e4a6f9b30e7acb5f37f2a",
    "lastChassisUuid": "aa573d1305ea427bbffc35ea64bfe644",
    "gatewayUuid": "f8d24330e04c42749fb415a68a4826a8",
    "lastGatewayUuid": "bc826d08dba54bae9b85fcaa1e35591f",
    "chassisOfferingUuid": "7ad393f46f6e4794ada11efbc22ec5b2",
    "status": "Connected",
    "provisionType": "Remote",
    "agentVersion": "2.0.0",
    "isLatestAgent": true,
    "uuid": "69dabbb90a6f4aa889c947a2107cfbdd",
    "name": "BM-1",
    "description": "This is a BareMetal2 Instance.",
    "zoneUuid": "50a7b341788b41f086bd92d51691ad2d",
    "clusterUuid": "8086e39efdec45b8a9e2ed6738b6609f",
    "imageUuid": "66516c70956642a189420900a33d3aeb",
    "rootVolumeUuid": "0f1c76cbb51a481e9a978fad78b437b4",
    "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
CreateBareMetal2InstanceFromVolumeBackupAction action = new CreateBareMetal2InstanceFromVolumeBackupAction();
action.name = "New-BareMetal-Instance";
action.description = "This is a bare metal instance created from volume backup.";
action.zoneUuid = "a6bd3e3415303e0ba10093587062da90";
action.clusterUuid = "fbbb8afe94e73e6384eb42806a81bbfa";
action.gatewayUuid = "d1cda3e4e0453703a8c1743e570680ee";
action.backupUuid = "03a77b5d079a3d1da607e6fcca155a67";
action.chassisUuid = "c40496c747af3710aec065a4a993c0a0";
action.chassisDiskUuid = "17e8555e857b38cebe935db9af3f2df6";
action.primaryStorageUuidForRootVolume = "2d21e7bd7c273be4bc630f15aa82e708";
action.rootVolumeSystemTags = asList("tag1","tag2");
action.gatewayAllocatorStrategy = "DefaultAllocatorStrategy";
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c";
CreateBareMetal2InstanceFromVolumeBackupAction.Result res = action.call();
Python SDK
CreateBareMetal2InstanceFromVolumeBackupAction action = CreateBareMetal2InstanceFromVolumeBackupAction()
action.name = "New-BareMetal-Instance"
action.description = "This is a bare metal instance created from volume backup."
action.zoneUuid = "a6bd3e3415303e0ba10093587062da90"
action.clusterUuid = "fbbb8afe94e73e6384eb42806a81bbfa"
action.gatewayUuid = "d1cda3e4e0453703a8c1743e570680ee"
action.backupUuid = "03a77b5d079a3d1da607e6fcca155a67"
action.chassisUuid = "c40496c747af3710aec065a4a993c0a0"
action.chassisDiskUuid = "17e8555e857b38cebe935db9af3f2df6"
action.primaryStorageUuidForRootVolume = "2d21e7bd7c273be4bc630f15aa82e708"
action.rootVolumeSystemTags = [tag1, tag2]
action.gatewayAllocatorStrategy = "DefaultAllocatorStrategy"
action.sessionId = "b86c9016b4f24953a9edefb53ca0678c"
CreateBareMetal2InstanceFromVolumeBackupAction.Result res = action.call()
API Reference | 5.5.30 | ZStack Cloud · ZCF | ZStack Resource Center