Custom Partitioning & RAID

Custom Partitioning & Raid (CPR) is powerful and yet easy to use feature that helps you configure Reserved Hardware instances during deployment.  

Please note: This feature is best used with reserved hardware.  With reserved hardware, our system knows the exact disk layout, whereas on-demand instances will sometimes vary based on manufacturer and disks are not guaranteed to show up at the same logical path.  If you are having trouble provisioning or seeing intermittent failures, contact us at support@packet.com to arrange for reserved hardware.


Getting Started

First things first, you should be familiar with the API calls available for device provisioning (view them here).   You'll need them!

You should also be aware of our standard disk configurations for each server type.  With a few hardware-specific exceptions, generally speaking, this looks like:

  • t1.small.x86:    1 × 80 GB, no RAID
  • c1.small.x86:   2 × 120 GB SSD in RAID 1
  • x1.small.x86:   240 GB of SSD (1 × 240 GB)
  • m1.xlarge.86: 2.8 TB of SSD (6 × 480GB SSD)
  • m2.xlarge.x86 (Intel Scalable): 2 × 120 GB in RAID 1 & 3.8 TB of NVMe Flash 
  • c1.larger.arm: 1 × 340 GB SSD, no RAID
  • c1.xlarge.x86:  2 × 120 GB SSD in RAID 1
  • c2.medium.x86 (EPYC): 960 GB of SSD (2 x 480 GB)
  • s1.large.x86:  2 x 480 GB SSD in RAID 1, with 120 GB SSD as cache in front of 12 X 2 TB HDD. 


Using CPR During Provisioning

Let's say you are going to deploy one of your reserved instances. An example call to the API might look like this: 

curl \ 
  -H "X-Auth-Token: token" \
  -H "Content-Type: application/json" \
  -d  '{
"facility": "ewr1",
"plan": "t1.small.x86",
"hostname": "custom-storage",
"operating_system":"ubuntu_18_04",
"storage": {
  // custom storage configuration
}' \
https://api.packet.net/projects/:id/devices

t1.small.x86 Partition Example

Using a simple t1.small.x86 to start, the following example shows you how to:

  • State which disks you want to format. 
  • How you want these disks formatted.
  • What filesystem should be created.  
  • Where to mount the partition once created. 
{
  "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"
          ]
        }
      }
    }
  ]
}


m1.xlarge.x86 example:


{  
   "disks":[  
      {  
         "device":"/dev/sda",
         "wipeTable":true,
         "partitions":[  
            {  
               "label":"BIOS",
               "number":1,
               "size":4096
            },
            {  
               "label":"SWAPA1",
               "number":2,
               "size":"3993600"
            },
            {  
               "label":"ROOTA1",
               "number":3,
               "size":0
            }
         ]
      },
      {  
         "device":"/dev/sdb",
         "wipeTable":true,
         "partitions":[  
            {  
               "label":"BIOS",
               "number":1,
               "size":4096
            },
            {  
               "label":"SWAPA2",
               "number":2,
               "size":"3993600"
            },
            {  
               "label":"ROOTA2",
               "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/md/ROOT",
            "format":"ext4",
            "point":"/",
            "create":{  
               "options":[  
                  "-L",
                  "ROOT"
               ]
            }
         }
      },
      {  
         "mount":{  
            "device":"/dev/md/SWAP",
            "format":"swap",
            "point":"none",
            "create":{  
               "options":[  
                  "-L",
                  "SWAP"
               ]
            }
         }
      }
   ]
}


UEFI Partition Requirement

For the c1.large.arm and c2.medium.x86 servers, it requires a FAT32 boot partition for /boot/efi. An example of this particular partition would be:

       // snip      
       {  
         "mount":{  
            "format":"vfat",
            "point":"/boot/efi",
            "create":{  
               "options":[  

                  32
                  "-n",
                  "BIOS"
               ]
            }
         }
      },

      // snip