I was wondering how it would be possible to specify an extra partition to add to the boot drive (in this case a RAID1 storage group) at order time via the Softlayer Ppython API. That way the extra partition would persist on the server after transactions like OS reloads.
I assume it would be added as an extra option, similar to the storage_groups in the example below (I have redacted some information to keep it as general as possible), but I'm unsure of how to add this.
RAID_1 = 2
SERVERS = [
{
"types": [
{ "name": "NAME", "type": "TYPE" },
],
"package": PACKAGE_DESCRIPTION
"prices": [
"CPU",
"RAM",
"OS",
"DISK_CONTROLLER_RAID", # RAID
"HARD_DRIVE_960GB_SSD",
"HARD_DRIVE_960GB_SSD",
"HARD_DRIVE_4_00_TB_SATA",
"NETWORKING AND EXTRA OPTIONS"
],
"storage_groups": [
{ "arrayTypeId": RAID_1, # RAID 1
"hardDrives": [0,1] },
],
}
I have not found a documentation page on this in the SLDN, though I have found this gist page from SoftLayer which details how to add partitions during an OS reload, which seems to be similar.
At the moment to order a bare metal server with RAID configuration for the first configured storage group you cannot set a custom partition, you only can pick out a partition template (see the code below to get the partition templates maybe one of them meet your requirements). this is documented here: http://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Product_Order_Storage_Group
"partitions
Defines the partitions for the storage group. If this storage group is not a secondary storage group, then this will not be used."
Just in case I added a code to order bare metal servers and configure a custom partition in the second storage group (see below).
Another approach to order the bare metal server, with the partition configurations you want, is to order a bare metal server, after it has been provisioned configure it with the partitions you want and create a image template from that server, then you can use that image template to create new bare metal servers and they should end up with the partition configuration that you wanted.
Here an example to get the valid partition templates.
Here an example to order a server with Raid and set a custom partition for the second storage group: