Create Server¶
Overview¶
This API creates additional baremetal servers.
Classification¶
- Create
API Operation Object¶
Synchronous / Asynchronous¶
- Asynchronous
Request¶
HTTP Request Method¶
- POST
HTTP Request Path¶
{api_endpoint}/v2/{tenant_id}/servers
HTTP Request Header¶
Accept: application/json
Content-Type: application/json
X-Auth-Token: <token>
HTTP Request Body¶
Format¶
{
"server": "<server>"
}
Request Parameter¶
name | style | format | description | required/optional | default value | action for invalid parameter | response code for invalid parameter |
---|---|---|---|---|---|---|---|
name | plain | String | Name of your baremetal server as a string. Please refer OS specific limitations name raw to know the limitation for each OS. | required | - | Terminate | 400, 404 |
networks | plain | Network Array | If it is specified greater than two, default gateway is first network. | required | - | Terminate | 400, 413 |
adminPass | plain | String | Password for the administrator. Please refer OS specific limitations adminPass raw to know the required administrator name for each OS. If you don’t set this parameter, it is set randomly. | optional | - | Terminate | 400 |
imageRef | plain | String | The image reference for the desired image for your baremetal server. Specify as an UUID or full URL. | optional | - | Terminate | 404 |
flavorRef | plain | String | The flavor reference for the desired flavor for your baremetal server. Specify as an UUID or full URL. Parameters of id or links -> href in List Flavors page can be used as flavorRef parameter. | required | - | Terminate | 404 |
key_name | plain | String | SSH Keypair name you created on KeyPairs API | optional | - | Terminate | 400 |
availability_zone | plain | String | The availability zone name in which to launch the server. If omit this parameter, target availability_zone is random. | optional | - | Terminate | 400, 404 |
user_data | plain | String | Configuration information or scripts to use upon launch. Must be Base64 encoded. Maximum size is 65535 bytes. Please refer OS specific limitations user_data raw to know the limitation for each OS. | optional | - | Terminate | 400 |
raid_arrays | plain | RaidArray | Raid Arrays information. Please refer OS specific limitations raid_arrays raw to know the limitation for each OS. | optional | - | Terminate | 400, 403, 413 |
lvm_volume_groups | plain | LVM VolumeGroup | LVM information. must be sure to specify if you have to true lvm parameters Raid Arrays. Please refer OS specific limitations lvm_volume_groups raw to know the limitation for each OS. | optional | - | Terminate | 400, 404, 413 |
filesystems | plain | datatype_filesystems | Partition filesystem / mount point information. Please refer OS specific limitations filesystems raw to know the limitation for each OS. | optional | - | Terminate | 400 |
metadata | plain | Metadata | Metadata key and value pairs. The maximum size of the metadata key and value is 255 bytes each. | optional | - | Terminate | 400, 413 |
personality | plain | Personality | File path and contents (text only) to inject into your baremetal server at launch. This parameter is not supported in ESXi. | optional | - | Terminate | 400, 413 |
Network relationship¶
- If “uuid” is set, new PORT which belongs to target Logical Network UUID is created and “network” is mapped to target Logical Network
- If “port” is set, “network” is mapped to target Logical Network which “port” (PORT UUID) belongs to.
Network Configuration Type | Description |
---|---|
DHCP | Refer to “enable_dhcp” value. |
IP Address |
|
Network Address / Subnet Mask | Refer to “cidr” value. |
Default GW | Refer to “gateway_ip”. If the value is nil, then no default GW is set to your baremetal server. |
DNS | Refer to “dns_nameservers”. If the value is nil, then DNS configuration is blank. |
NTP | Refer to “ntp_servers”. If the value is nil, then NTP configuration is blank. |
Static Routes | Refer to “host_routes”. If the value is nil, then no routes are added to routing table. (Not implemented) |
OS specific limitations¶
Parameter | Limitation |
---|---|
name |
|
adminPass |
|
key_name
user_data
|
|
raid_arrays |
|
lvm_volume_groups |
|
filesystems |
|
About of Disk Partitioning¶
For customize disk partitioning, you can specify raid_arrays / lvm_volume_groups / filesystems parameters.
Default settings¶
OS | Default settings |
---|---|
RHEL
CentOS
Ubuntu
|
Most of primary_storage area used as ‘/’.
Filesystem is xfs(RHEL, CentOS) or ext4(Ubuntu).
Installer automatically creates GPT area, uEFI partition, and boot partition in small size to head of primary_storage.
In default, LVM does not used.
+----------+-----------+----------+----------------------------------------------+---------+ | GPT area | /boot/efi | /boot | / | swap | | | [fat32] | [ext4] | [ext4(ubuntu) or xfs(CentOS/RHEL)] | [swap] | | (<1MB) | (512MB) | (512MB) | (all remaining area) | (16GB) | +----------+-----------+----------+----------------------------------------------+---------+ |
Windows
|
Most of primary_storage area used as ‘C:’.
Filesystem is NTFS.
Installer automatically creates Windows RE Tools partition, ESP partition and MSR partition in small size to head of primary_storage.
About these partitions, see Microsoft®Web site.( https://msdn.microsoft.com/en-us/library/Hh824839.aspx )
Pagefile is created on ‘C:’ and set fixed size. The size is 16GB.
+--------------+---------+---------+------------------------------------------------------+ | Windows RE | ESP | MSR | Windows(C:) +----------------| | Tools | | | [NTFS] | pagefile.sys | | (300MB-1GB) | (500MB) | (128MB) | (all remaining area) | (16GB) | +--------------+---------+---------+-------------------------------------+----------------+ |
ESXi
CoreOS
|
Cannot specify partitioning.
Installer automatically creates partitions / filesystems in primary_storage.
Partition / filesystem structure same as these OSes are installed by official installer.
|
Manual
ISO
|
All of primary_storage area used by one empty partition.
Cannot create filesystem.
You can separate manually partition / filesystem in ISO image installer.
+-----------------------------------------------------------------------------------------+ | empty partition | | (all area) | +-----------------------------------------------------------------------------------------+ |
Manual partitioning examples¶
RHEL, CentOS, Ubuntu(without LVM)¶
If you want to customize partition without LVM, specify ‘raid_arrays’ and ‘filesystems’ parameters.
{
"server": {
"raid_arrays": [
{
"primary_storage": true,
"partitions": [
{
"size": "40G",
"partition_label": "root"
},
{
"size": "auto",
"partition_label": "home"
},
{
"size": "4G",
"partition_label": "swap"
}
]
}
],
"filesystems": [
{
"label": "root",
"mount_point": "/",
"fs_type": "ext4"
},
{
"label": "home",
"mount_point": "/home",
"fs_type": "ext4"
},
{
"label": "swap",
"fs_type": "swap"
}
]
}
}
+-----------+-----------+---------+------------+---------------------------------+--------+
| GPT area | /boot/efi | /boot | / | /home | swap |
| | [fat32] | [ext4] | [ext4] | [ext4] | [swap] |
| (<1MB) | (512MB) | (512MB) | (40GB) | (all remaining area) | (4GB) |
+-----------+-----------+---------+------------+---------------------------------+--------+
RHEL, CentOS, Ubuntu(Use LVM)¶
If you want to customize partition with LVM, specify ‘raid_arrays’, ‘lvm_volume_groups’, and ‘filesystems’ parameters.
{
"server": {
"raid_arrays": [
{
"primary_storage": true,
"partitions": [
{
"lvm": true,
"size": "40G",
"partition_label": "PV1"
},
{
"lvm": true,
"size": "40G",
"partition_label": "PV2"
},
{
"lvm": true,
"size": "auto",
"partition_label": "PV3"
}
]
}
],
"vg_label": [
{
"vg_label": "VG1",
"physical_volume_partition_labels": [
"PV1"
],
"logical_volumes": [
{
"lv_label": "lv_root",
"size": "auto"
}
]
}
]
"filesystems": [
{
"label": "lv_root",
"mount_point": "/",
"fs_type": "ext4"
},
{
"label": "lv_home",
"mount_point": "/home",
"fs_type": "ext4"
},
{
"label": "lv_var",
"mount_point": "/var",
"fs_type": "ext4"
}
]
}
}
Physical volumes
+-----------+-----------+---------+-----------------------------------------------------+
| | | | PV |
| | | | (all remaining area) |
+-----------+-----------+---------+-----------------------------------------------------+
\____________________________________________________/
VG
____________________________________________________
Logical volumes and filesystems / \
+-----------+-----------+---------+-----------------------------------------------------+
| GPT area | /boot/efi | /boot | / |
| | [fat32] | [ext4] | [ext4] |
| (<1MB) | (512MB) | (512MB) | (all remaining area) |
+-----------+-----------+---------+-----------------------------------------------------+
Windows¶
In windows, You can specify ‘raid_arrays’ parameter only. First partition of ‘partitions’ used as Windows operating system partition. Second or after partitions, used as data partition. Driveletter order same as specified in ‘partitions’ parameter. (ex. 1st->C, 2nd->D, 3rd->E)
{
"server": {
"raid_arrays": [
{
"primary_storage": true,
"partitions": [
{
"size": "100G",
"partition_label": "windows"
},
{
"size": "auto",
"partition_label": "data"
}
]
}
]
}
}
+-------------+---------+---------+-----------------------------+---------------------------+
| Windows RE | ESP | MSR | Windows(C:) +--------------| (D:) |
| Tools | | | [NTFS] | pagefile.sys | [NTFS] |
| (300MB-1GB) | (500MB) | (128MB) | (100GB) | (16GB) | (all remaining area) |
+-------------+---------+---------+-----------------------------+---------------------------+
Using user_data introduction¶
OS | Executor | Executing Format |
---|---|---|
RHEL
CentOS
Ubuntu
|
cloud-init
|
|
Windows
|
cloudbase-init
|
|
ESXi
|
Unsupported
|
None
|
CoreOS
|
CoreOS cloud-init
|
Network Parameter of deploying ESXi¶
If you deploy ESXi, port attached nic_physical_port will be configured tag mode.
- Network ID
Port created has following attributes.
- segmentation_type: vlan
- segmentation_id: 3
- port id (You configured segmentation_type is flat)
Overwrite port’s attributes following value.
- segmentation_type: flat
- segmentation_id: 0
- port id (You configured segmentation_type is vlan)
- Use specified port’s segmentation_type segmentation_type.
Response¶
HTTP Response Header¶
Format¶
HTTP/1.1 200 OK
- <response_code>: see “HTTP Responses” section
- <message>: message based on the response code
HTTP Response Body¶
Format¶
{
"server": "<server>"
}
Response Parameter¶
item | format | description | |
server | CreatedServer | Server to be Created. |
Sample Request and Response¶
Sample API Request¶
Request URI¶
https://baremetal-server-jp1-ecl.api.ntt.com/v2/b322a85578de48beba0f92acce57869b/servers
HTTP Request Header¶
POST /v2/b322a85578de48beba0f92acce57869b/servers HTTP/1.1
User-Agent: curl/7.35.0
Host: 192.168.150.51:8774
Accept: application/json
Content-Type: application/json
X-Auth-Token: 62d528dc0cca4827b0ed465efe1c2588
HTTP Request Body¶
{
"server": {
"name": "server-test-1",
"adminPass": "aabbccddeeff",
"imageRef": "b5660a6e-4b46-4be3-9707-6b47221b454f",
"flavorRef": "05184ba3-00ba-4fbc-b7a2-03b62b884931",
"availability_zone": "zone1-groupa",
"networks": [
{
"uuid": "d32019d3-bc6e-4319-9c1d-6722fc136a22",
"fixed_ip": "10.0.0.100"
}
],
"raid_arrays": [
{
"primary_storage": true,
"partitions": [
{
"lvm": true,
"partition_label": "primary-part1"
},
{
"lvm": false,
"size": "100G",
"partition_label": "var"
}
]
},
{
"raid_card_hardware_id": "raid_card_uuid",
"disk_hardware_ids": [
"disk1_uuid", "disk2_uuid", "disk3_uuid", "disk4_uuid"
],
"raid_level": 10,
"partitions": [
{
"lvm": true,
"partition_label": "secondary-part1"
}
]
}
],
"lvm_volume_groups": [
{
"vg_label": "VG_root",
"physical_volume_partition_labels": [
"primary-part1", "secondary-part1"
],
"logical_volumes": [
{
"size": "300G",
"lv_label": "LV_root"
},
{
"size": "2G",
"lv_label": "LV_swap"
}
]
}
],
"filesystems": [
{
"label": "LV_root",
"mount_point": "/",
"fs_type": "xfs"
},
{
"label": "var",
"mount_point": "/var",
"fs_type": "xfs"
},
{
"label": "LV_swap",
"fs_type": "swap"
}
],
"user_data": "IyEvYmluL2Jhc2gKZWNobyAiS3VtYSBQb3N0IEluc3RhbGwgU2NyaXB0IiA+PiAvaG9tZS9iaWcvcG9zdC1pbnN0YWxsLXNjcmlwdA==",
"metadata": {
"foo": "bar"
}
}
}
Sample API Response¶
HTTP Response Header¶
HTTP/1.1 200 OK
Content-Type: application/json
Content-Length: <content-length>
Date: Thu, 17 Jul 2014 04:21:06 GMT
HTTP Response Body¶
{
"server": {
"id": "05184ba3-00ba-4fbc-b7a2-03b62b884931",
"links": [
{
"href": "https://baremetal-server-jp1-ecl.api.ntt.com/v2/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931",
"rel": "self"
},
{
"href": "https://baremetal-server-jp1-ecl.api.ntt.com/openstack/servers/05184ba3-00ba-4fbc-b7a2-03b62b884931",
"rel": "bookmark"
}
],
"adminPass": "aabbccddeeff"
}
}