Custom Partitioning and RAID (CPR)¶
Equinix Metal™ offers a Custom Partitioning and RAID (CPR) feature, which allows you to specify the disk configuration when you deploy a reserved server.
To use CPR, create a JSON object that:
- States which disks you want to format.
- How you want these disks formatted.
- What filesystem should be created on the disks.
- Where to mount the partition once created.
Use the examples to get started on creating your own.
Reserved Server Requirement¶
A reserved server is required because the exact drive scheme must be known beforehand in order to enable the customization to work through the API. The Custom Partitioning and RAID feature is not available for on demand instances.
Provisioning with CPR¶
To use CPR, you will need to deploy a server from your hardware reservations through the API. When you send your POST
request to the projects/<id>/devices
endpoint, you will need to send in your CPR configuration as a JSON object with the "storage"
parameter in the body of the request.
curl -X POST \
-H "Content-Type: application/json" \
-H "X-Auth-Token: <API_TOKEN>" \
"https://api.equinix.com/metal/v1/projects/{id}/devices" \
-d '{
"hardware_reservation_id":"<reservation_id>",
"hostname": "<your-hostname>",
"plan": "<plan_slug>",
"operating_system": "<os_slug>",
"storage": "<CPR_JSON_definition>",
}'
General Examples¶
RAID 1 boot, RAID 1 DATA¶
- 2 disks in RAID1 for
root
partition. - 2 disks in RAID1 for
data
partition.
{
"disks": [
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "ROOT",
"number": 2,
"size": 0
}
]
},
{
"device": "/dev/sdb",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "ROOT",
"number": 2,
"size": 0
}
]
},
{
"device": "/dev/sdc",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdd",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
}
],
"raid": [
{
"devices": [
"/dev/sda2",
"/dev/sdb2"
],
"level": 1,
"name": "/dev/md/root"
},
{
"devices": [
"/dev/sdc1",
"/dev/sdd1"
],
"level": 1,
"name": "/dev/md/data"
}
],
"filesystems": [
{
"mount": {
"device": "/dev/md/root",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
},
{
"mount": {
"device": "/dev/md/data",
"format": "ext4",
"point": "/data",
"create": {
"options": [
"-L",
"DATA"
]
}
}
}
]
}
RAID1 boot, RAID0 DATA¶
- 2 disks in RAID1 for
root
partition. - 2 disks in RAID0 for
data
partition.
{
"disks": [
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "ROOT",
"number": 2,
"size": 0
}
]
},
{
"device": "/dev/sdb",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "ROOT",
"number": 2,
"size": 0
}
]
},
{
"device": "/dev/sdc",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdd",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
}
],
"raid": [
{
"devices": [
"/dev/sda2",
"/dev/sdb2"
],
"level": 1,
"name": "/dev/md/root"
},
{
"devices": [
"/dev/sdc1",
"/dev/sdd1"
],
"level": 0,
"name": "/dev/md/data"
}
],
"filesystems": [
{
"mount": {
"device": "/dev/md/root",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
},
{
"mount": {
"device": "/dev/md/data",
"format": "ext4",
"point": "/data",
"create": {
"options": [
"-L",
"DATA"
]
}
}
}
]
}
RAID1 boot Only¶
- 2 disks in RAID1 for
root
partition only.
{
"disks": [
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "ROOT",
"number": 2,
"size": 0
}
]
},
{
"device": "/dev/sdb",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "ROOT",
"number": 2,
"size": 0
}
]
}
],
"raid": [
{
"devices": [
"/dev/sda2",
"/dev/sdb2"
],
"level": 1,
"name": "/dev/md/root"
}
],
"filesystems": [
{
"mount": {
"device": "/dev/md/root",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
}
]
}
Examples by Server¶
c3.small.x86¶
The c3.small.x86
comes with 2 x 480 GB drives. This example takes one of those drives, creates three partitions (BIOS, swap, and root), then formats the swap partition as swap and the root partition as ext4
.
{
"disks": [
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "SWAP",
"number": 2,
"size": "3993600"
},
{
"label": "ROOT",
"number": 3,
"size": 0
}
]
}
],
"filesystems": [
{
"mount": {
"device": "/dev/sda3",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
},
{
"mount": {
"device": "/dev/sda2",
"format": "swap",
"point": "none",
"create": {
"options": [
"-L",
"SWAP"
]
}
}
}
]
}
c3.medium.x86¶
- 2 disks in RAID1 for
root
partition. - 2 disks in RAID1 for
data
partition. - 2 disks in RAID0 for
swap
partition.
{
"disks": [
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "SWAP",
"number": 2,
"size": "8G"
},
{
"label": "ROOT",
"number": 3,
"size": 0
}
]
},
{
"device": "/dev/sdb",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "SWAP",
"number": 2,
"size": "8G"
},
{
"label": "ROOT",
"number": 3,
"size": 0
}
]
},
{
"device": "/dev/sdc",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdd",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
}
],
"raid": [
{
"devices": [
"/dev/sda3",
"/dev/sdb3"
],
"level": 1,
"name": "/dev/md/root"
},
{
"devices": [
"/dev/sda2",
"/dev/sdb2"
],
"level": 0,
"name": "/dev/md/swap"
},
{
"devices": [
"/dev/sdc1",
"/dev/sdd1"
],
"level": 1,
"name": "/dev/md/data"
}
],
"filesystems": [
{
"mount": {
"device": "/dev/md/root",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
},
{
"mount": {
"device": "/dev/md/data",
"format": "ext4",
"point": "/data",
"create": {
"options": [
"-L",
"DATA"
]
}
}
},
{
"mount": {
"device": "/dev/md/swap",
"format": "swap",
"point": "none",
"create": {
"options": [
"-L",
"SWAP"
]
}
}
}
]
}
c3.medium.x86 (no swap)¶
- 2 disks in RAID1 for
root
partition. - 2 disks in RAID1 for
data
partition.
{
"disks": [
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "ROOT",
"number": 2,
"size": 0
}
]
},
{
"device": "/dev/sdb",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "ROOT",
"number": 2,
"size": 0
}
]
},
{
"device": "/dev/sdc",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdd",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
}
],
"raid": [
{
"devices": [
"/dev/sda2",
"/dev/sdb2"
],
"level": 1,
"name": "/dev/md/root"
},
{
"devices": [
"/dev/sdc1",
"/dev/sdd1"
],
"level": 1,
"name": "/dev/md/data"
}
],
"filesystems": [
{
"mount": {
"device": "/dev/md/root",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
},
{
"mount": {
"device": "/dev/md/data",
"format": "ext4",
"point": "/data",
"create": {
"options": [
"-L",
"DATA"
]
}
}
}
]
}
s3.xlarge.x86¶
The s3.xlarge has 2 x 960 GB SSD, 12 x 8 TB HDD, and 2 x 256 GB of NVMe Flash. In this example, the 2 x 960 GB SSDs will be used by ROOT and SWAP in RAID 1, 12 x 8 TB will be used by DATA in RAID 10. The NVMe drives are left for other purposes.
{
"disks": [
{
"device": "/dev/sdn",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "SWAP",
"number": 2,
"size": "8G"
},
{
"label": "ROOT",
"number": 3,
"size": 0
}
]
},
{
"device": "/dev/sdm",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": 4096
},
{
"label": "SWAP",
"number": 2,
"size": "8G"
},
{
"label": "ROOT",
"number": 3,
"size": 0
}
]
},
{
"device": "/dev/sdj",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdc",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdi",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdb",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdk",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdf",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdd",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdg",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sde",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdl",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
},
{
"device": "/dev/sdh",
"wipeTable": true,
"partitions": [
{
"label": "DATA",
"number": 1,
"size": 0
}
]
}
],
"raid": [
{
"devices": [
"/dev/sda1",
"/dev/sdb1",
"/dev/sdc1",
"/dev/sdd1",
"/dev/sde1",
"/dev/sdf1",
"/dev/sdg1",
"/dev/sdh1",
"/dev/sdi1",
"/dev/sdj1",
"/dev/sdk1",
"/dev/sdl1"
],
"level": "10",
"name": "/dev/md/DATA"
},
{
"devices": [
"/dev/sdm2",
"/dev/sdn2"
],
"level": "1",
"name": "/dev/md/SWAP"
},
{
"devices": [
"/dev/sdm3",
"/dev/sdn3"
],
"level": "1",
"name": "/dev/md/ROOT"
}
],
"filesystems": [
{
"mount": {
"device": "/dev/md/ROOT",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
},
{
"mount": {
"device": "/dev/md/DATA",
"format": "ext4",
"point": "/DATA",
"create": {
"options": [
"-L",
"DATA"
]
}
}
},
{
"mount": {
"device": "/dev/md/SWAP",
"format": "swap",
"point": "none",
"create": {
"options": [
"-L",
"SWAP"
]
}
}
}
]
}
EFI-Enabled m3.small.x86¶
- EFI-enabled
- 2 disks in RAID1 for
swap
partition. - 2 disks in RAID1 for
root
partition.
{
"disks": [
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": "512M"
},
{
"label": "SWAP",
"number": 2,
"size": "4G"
},
{
"label": "ROOT",
"number": 3,
"size": "0"
}
]
},
{
"device": "/dev/sdb",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": "512M"
},
{
"label": "SWAP",
"number": 2,
"size": "4G"
},
{
"label": "ROOT",
"number": 3,
"size": "0"
}
]
}
],
"raid": [
{
"devices": [
"/dev/sda2",
"/dev/sdb2"
],
"level": "1",
"name": "/dev/md/SWAP"
},
{
"devices": [
"/dev/sda3",
"/dev/sdb3"
],
"level": "1",
"name": "/dev/md/ROOT"
}
],
"filesystems": [
{
"mount": {
"device": "/dev/sda1",
"format": "vfat",
"create": {
"options": [
"32",
"-n",
"EFI"
]
},
"point": "/boot/efi"
}
},
{
"mount": {
"device": "/dev/md/ROOT",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
},
{
"mount": {
"device": "/dev/md/SWAP",
"format": "swap",
"point": "none",
"create": {
"options": [
"-L",
"SWAP"
]
}
}
}
]
}
Example for UEFI-only Servers¶
We have some Legacy servers, the c2.large.arm
and the c2.medium.x86
, which are UEFI only. You are required to use a FAT32 EFI partition for /boot/efi
. This is an example configuration for the c2.medium.x86
, which has 2 x 120 GB SSD and 2 x 480 GB SSD drives.
{
"disks": [
{
"device": "/dev/sda",
"wipeTable": true,
"partitions": [
{
"label": "BIOS",
"number": 1,
"size": "512M"
},
{
"label": "SWAP",
"number": 2,
"size": "3993600"
},
{
"label": "ROOT",
"number": 3,
"size": 0
}
]
}
],
"filesystems": [
{
"mount": {
"device": "/dev/sda1",
"format": "vfat",
"point": "/boot/efi",
"create": {
"options": [
"32",
"-n",
"EFI"
]
}
}
},
{
"mount": {
"device": "/dev/sda3",
"format": "ext4",
"point": "/",
"create": {
"options": [
"-L",
"ROOT"
]
}
}
},
{
"mount": {
"device": "/dev/sda2",
"format": "swap",
"point": "none",
"create": {
"options": [
"-L",
"SWAP"
]
}
}
}
]
}