CreateBareMetal2Instance
API Request
URLs
POST zstack/v1/baremetal2/bm-instances
Headers
Authorization: OAuth the-session-uuid
Body
Note: In
the preceding sample, both systemTags and userTags are optional.
These two fields can be included in the body structure.
{
"params": {
"name": "BM",
"description": "This is a bare metal instance",
"clusterUuid": "d42170a418c3371f82ac5f21d10feff4",
"chassisOfferingUuid": "b759701ddf47367eb55efea665eb3bd8",
"imageUuid": "529c9474896035f8bb8aa806bec5c28b"
},
"systemTags": [],
"userTags": []
}

Curl Sample
curl -H "Content-Type: application/json;charset=UTF-8" \
-H "Authorization: OAuth b86c9016b4f24953a9edefb53ca0678c" \
-X POST -d '{"params":{"name":"BM","description":"This is a bare metal instance",\
"clusterUuid":"d42170a418c3371f82ac5f21d10feff4","chassisOfferingUuid":"b759701ddf47367eb55efea665eb3bd8","imageUuid":"529c9474896035f8bb8aa806bec5c28b"}}' http://localhost:8080/zstack/v1/baremetal2/bm-instances
Request Parameters
Name | Type | Location | Description | Valid Value | Starting Version |
---|---|---|---|---|---|
name | String | body(contained in the params structure) | The bare metal instance name. | 4.0.0 | |
description | String | body(contained in the params structure) | Optional. The detailed description of the bare metal instance. | 4.0.0 | |
zoneUuid | String | body(contained in the params structure) | Optional. The zone UUID. | 4.0.0 | |
clusterUuid | String | body(contained in the params structure) | Optional. The cluster UUID. | 4.0.0 | |
gatewayUuid | String | body(contained in the params structure) | Optional. The gateway UUID. | 4.0.0 | |
chassisUuid | String | body(contained in the params structure) | Optional. The bare metal chassis UUID. | 4.0.0 | |
chassisOfferingUuid | String | body(contained in the params structure) | Optional. The chassis offering UUID. | 4.0.0 | |
imageUuid | String | body(contained in the params structure) | Optional. The image UUID. | 4.3.12 | |
primaryStorageUuidForRootVolume | String | body(contained in the params structure) | Optional. The UUID of the primary storage where the root volume resides. | 4.0.0 | |
primaryStorageUuidForDataVolume | String | body(contained in the params structure) | Optional. The UUID of the primary storage where data volumes resides. | 4.0.0 | |
dataDiskOfferingUuids | List | body(contained in the params structure) | Optional. The data volume offering UUID. | 4.0.0 | |
rootVolumeSystemTags | List | body(contained in the params structure) | Optional. The root volume offering UUID. | 4.0.0 | |
dataVolumeSystemTags | List | body(contained in the params structure) | Optional. The system tags of data volumes. | 4.0.0 | |
gatewayAllocatorStrategy | String | body(contained in the params structure) | Optional. The gateway allocation policy. | 4.0.0 | |
chassisDiskUuid | String | body(contained in the params structure) | Optional, The UUID of the local disk. | 4.3.12 | |
resourceUuid | String | body(contained in the params structure) | Optional. The bare metal instance UUID. | 4.0.0 | |
tagUuids | List | body(contained in the params structure) | Optional. The tag UUIDs. | 4.0.0 | |
systemTags | List | body | Optional. The system tags. | 4.0.0 | |
userTags | List | body | Optional. The user tags. | 4.0.0 |
API Response
Sample
Response
{
"inventory": {
"chassisUuid": "abdb84a7186446828d679ca390400804",
"lastChassisUuid": "2e16e29ad4d94a348d3f633358792ebe",
"gatewayUuid": "8a2a62c0d26f46af9b835515ca26cf79",
"lastGatewayUuid": "bc627e89139043e292aea1d691740f58",
"chassisOfferingUuid": "b943087d48644fe7a9165d447b1197e6",
"status": "Connected",
"provisionType": "Remote",
"uuid": "870fde072c314db49fb6c91ca6f893f6",
"name": "BM-1",
"description": "This is a BareMetal2 Instance.",
"zoneUuid": "66bbd29bcd8d4313816dc6ed26e86c97",
"clusterUuid": "f3b09f2ac776470bb0710db497e13b6c",
"imageUuid": "1d499497394e443ba4d5f502d42ffff1",
"rootVolumeUuid": "f88731c18e58481e8d7c98158e8b2948",
"platform": "Linux",
"type": "baremetal2",
"memorySize": 8.589934592E9,
"cpuNum": 8.0,
"createDate": "Nov 14, 2017 10:20:57 PM",
"lastOpDate": "Nov 14, 2017 10:20:57 PM",
"state": "Running"
}
}
Name | Type | Description | Starting Version |
---|---|---|---|
error | ErrorCode | The error code. If not null, the operation fails, or vice versa. For more information, see error. | 4.0.0 |
inventory | BareMetal2InstanceInventory | See inventory. | 4.0.0 |
#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. | 4.0.0 |
description | String | The brief description of the error. | 4.0.0 |
details | String | The details about the error. | 4.0.0 |
elaboration | String | The reserved field. Default value: null. | 4.0.0 |
opaque | LinkedHashMap | The reserved field. Default value: null. | 4.0.0 |
cause | ErrorCode | The root error, which is the associated root cause of the current error. If no root error exists, this parameter is null. | 4.0.0 |
#inventory
Name | Type | Description | Starting Version |
---|---|---|---|
chassisUuid | String | The UUID of the bare metal chassis. | 4.0.0 |
lastChassisUuid | String | The UUID of the bare metal chassis where the instance last resides. | 4.0.0 |
gatewayUuid | String | The gateway UUID. | 4.0.0 |
lastGatewayUuid | String | The UUID of the last gateway. | 4.0.0 |
chassisOfferingUuid | String | The chassis offering UUID. | 4.0.0 |
gatewayAllocatorStrategy | String | The gateway allocation policy. | 4.0.0 |
status | String | The connection status of the bare metal instance. | 4.0.0 |
uuid | String | The UUID of the bare metal instance. | 4.0.0 |
name | String | The bare metal instance name. | 4.0.0 |
description | String | The detailed description of the bare metal instance. | 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 |
rootVolumeUuid | String | The root volume UUID | 4.0.0 |
platform | String | The platform type. | 4.0.0 |
defaultL3NetworkUuid | String | The UUID of the default L3 network. | 4.0.0 |
type | String | The type of the bare metal instance. | 4.0.0 |
hypervisorType | String | The virtualization type. | 4.0.0 |
memorySize | Long | The memory size. | 4.0.0 |
cpuNum | Integer | The number of CPU cores. | 4.0.0 |
cpuSpeed | Long | The processing speed of the CPU. | 4.0.0 |
createDate | Timestamp | The time when the bare metal instance was created. | 4.0.0 |
lastOpDate | Timestamp | The time when the bare metal instance was last modified. | 4.0.0 |
state | String | The state of the bare metal instance. | 4.0.0 |
provisionNic | BareMetal2InstanceProvisionNicInventory | See provisionNic. | 4.0.0 |
vmNics | List | See vmNics. | 4.0.0 |
allVolumes | List | See allVolumes. | 4.0.0 |
#provisionNic
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The UUID of the NIC that is in the deployment network. | 4.0.0 |
networkUuid | String | The deployment network UUID. | 4.0.0 |
mac | String | The name of the NIC. | 4.0.0 |
ip | String | The IP address of the NIC. | 4.0.0 |
netmask | String | The netmask of the NIC. | 4.0.0 |
gateway | String | The gateway IP address. | 4.0.0 |
metadata | String | 4.0.0 | |
createDate | Timestamp | The time when the NIC was created. | 4.0.0 |
lastOpDate | Timestamp | The time when the NIC was last modified. | 4.0.0 |
#vmNics
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The UUID of the NIC of the bare metal instance. | 4.0.0 |
vmInstanceUuid | String | The UUID of the VM instance. | 4.0.0 |
l3NetworkUuid | String | The L3 network UUID. | 4.0.0 |
ip | String | The IP address of the NIC. | 4.0.0 |
mac | String | The MAC address of the NIC. | 4.0.0 |
hypervisorType | String | The virtualization type. | 4.0.0 |
netmask | String | The netmask of the NIC. | 4.0.0 |
gateway | String | The gateway IP address. | 4.0.0 |
metaData | String | 4.0.0 | |
ipVersion | Integer | The version of the IP address. | 4.0.0 |
deviceId | Integer | The device ID. | 4.0.0 |
type | String | The NIC type. | 4.0.0 |
createDate | Timestamp | The time when the NIC was created. | 4.0.0 |
lastOpDate | Timestamp | The time when the NIC was last modified. | 4.0.0 |
usedIps | List | See usedIps. | 4.0.0 |
#usedIps
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The UUID of the IP address. | 4.0.0 |
ipRangeUuid | String | The IP range UUID. | 4.0.0 |
l3NetworkUuid | String | The L3 network UUID. | 4.0.0 |
ipVersion | Integer | The IP version. | 4.0.0 |
ip | String | The IP address. | 4.0.0 |
netmask | String | The netmask of the IP address. | 4.0.0 |
gateway | String | The gateway IP address. | 4.0.0 |
usedFor | String | 4.0.0 | |
ipInLong | long | 4.0.0 | |
vmNicUuid | String | The NIC UUID. | 4.0.0 |
createDate | Timestamp | The time when the IP address was created. | 4.0.0 |
lastOpDate | Timestamp | The time when the IP address was last modified. | 4.0.0 |
#allVolumes
Name | Type | Description | Starting Version |
---|---|---|---|
uuid | String | The volume UUID. | 4.0.0 |
name | String | The volume name. | 4.0.0 |
description | String | The detailed description of the volume. | 4.0.0 |
primaryStorageUuid | String | The primary storage UUID. | 4.0.0 |
vmInstanceUuid | String | The VM instance UUID. | 4.0.0 |
diskOfferingUuid | String | The volume offering UUID. | 4.0.0 |
rootImageUuid | String | The root image UUID. | 4.0.0 |
installPath | String | The installation path of the volume in the primary storage. | 4.0.0 |
type | String | The type of the volume. | 4.0.0 |
format | String | The format of the volume. | 4.0.0 |
size | Long | The size of the volume. | 4.0.0 |
actualSize | Long | The actual storage space that the volume takes up. | 4.0.0 |
deviceId | Integer | 4.0.0 | |
state | String | The state of the volume. | 4.0.0 |
status | String | The status of the volume. | 4.0.0 |
createDate | Timestamp | The time when the volume was created. | 4.0.0 |
lastOpDate | Timestamp | The time when the volume was last modified. | 4.0.0 |
isShareable | Boolean | Indicates whether the volume is shareable. | 4.0.0 |
volumeQos | String | The QoS of the volume, for example, 1048576. | 4.0.0 |
- When you create an elastic baremetal instance from a
local dick (non take-over) baremetal node on ZStack Cloud, , you can specify a disk to write system
data by by adding the systemDisk option to SystemTags.
- Format:
systemDisk::WWN
- Example:
systemDisk::0x5000c500d490b3d0
- Format:
SDK Sample
Java
SDK
CreateBareMetal2IpmiChassisHardwareInfoAction action = new CreateBareMetal2IpmiChassisHardwareInfoAction();
action.ipmiAddress = "192.168.0.10";
action.ipmiPort = 623.0;
action.hardwareInfo = "{'architecture':'x86_64', 'cpuModelName':'Intel i7-6700K', 'cpuNum':'8', 'memorySize':'33421254656','nics':[{'nicMac':'40:8d:5c:f7:8d:61', 'nicSpeed':'1000Mbps', 'isProvisionNic':'true'}]}";
CreateBareMetal2IpmiChassisHardwareInfoAction.Result res = action.call();
Python
SDK
CreateBareMetal2IpmiChassisHardwareInfoAction action = CreateBareMetal2IpmiChassisHardwareInfoAction()
action.ipmiAddress = "192.168.0.10"
action.ipmiPort = 623.0
action.hardwareInfo = "{'architecture':'x86_64', 'cpuModelName':'Intel i7-6700K', 'cpuNum':'8', 'memorySize':'33421254656','nics':[{'nicMac':'40:8d:5c:f7:8d:61', 'nicSpeed':'1000Mbps', 'isProvisionNic':'true'}]}"
CreateBareMetal2IpmiChassisHardwareInfoAction.Result res = action.call()