SoftLayer API: How to specify OS Reload with RAID options?
<p>Using the Python SoftLayer library, I've been attempting to submit an OS reload via the SoftLayer API to get consistent disk setup for provisioned servers. These servers have either RAID10 or RAID1 setup, using all available disks in the array. Upon initial provisioning, the servers are setup properly. </p>

<p>When I submit the OS reload using the Python library using a method like the following: </p>

<pre><code>def reload_server(server_id):
    conf = {
        "upgradeHardDriveFirmware": "1",
        "upgradeBios": "1",
        "hardDrives": [
            {
                "complexType": "SoftLayer_Hardware_Component_HardDrive",
                "partitions": [
                    { "name": "/boot", "minimumSize": "1"},
                    { "name": "/swap0", "minimumSize": "20"},
                    { "name": "/", "minimumSize": "15"},
                    { "name": "/disk", "minimumSize": "1", "grow": "1"}
                ]
            }
        ]
     }

     return client['Hardware_Server'].reloadOperatingSystem('FORCE', conf, id=server_id)
</code></pre>

<p>The reload is initiated, but the partitions setup only use the first disk rather than a RAID block device. Consequently, they do not have the RAID setup. In other words, for a 6 disk server intending to have RAID10, which should have a single block device visible in the OS (<code>/dev/sda</code>), <code>/dev/sda</code> is setup to with those partitions and the other disks - <code>/dev/sdb</code>, <code>/dev/sdc</code>, <code>/dev/sdc</code> et al - are block devices: </p>

<pre><code>root@server ~ $blkid
/dev/sda1: UUID="6c80b9ef-0228-4f6d-8ff9-7ed851f383f9" TYPE="ext2"
/dev/sda5: UUID="58e05f19-aa62-42cd-858b-568f415a0201" TYPE="swap"
/dev/sda6: UUID="8d7c0396-a3d3-4e72-847e-f8b3bbbda120" TYPE="ext4"
/dev/sda7: UUID="TmNPZO-V1Dq-xSRU-hHM2-02A8-9mJi-mRPLjo" TYPE="ext4"
/dev/sdb1: LABEL="/disk1" UUID="a19883ec-1fd0-472d-a2ef-188f943a0ab3" TYPE="ext4"
/dev/sdc1: LABEL="/disk2" UUID="c6bd0fc6-3d5c-4c29-9b33-a61b15793d5d" TYPE="ext4"
/dev/sdd1: LABEL="/disk3" UUID="5bda0575-1bfa-473b-83bc-519f705f2213" TYPE="ext4"
/dev/sde1: LABEL="/disk4" UUID="43fe460d-8ad4-41f9-b840-11f3d36d8788" TYPE="ext4"
/dev/sdf1: LABEL="/disk5" UUID="9b34ca0f-bc54-41fe-934a-daabdaa8521b" TYPE="ext4"
</code></pre>

<p>How do I submit an OS reload to ensure that the RAID is setup appropriately and is not lost upon reload? And how do I do this consistently, because we've submitted OS reloads via cURL using a similar payload and the reload resulted in a correct RAID setup.</p>

<p><strong>Edit:</strong> To clarify, I'm not trying to change the RAID configuration. I want to keep the existing RAID configuration. I am only attempting to change the partitions. Namely, resize swap, decrease root partition, and specify the grow partition for our automated tools. When I submit the OS reload and change the partition structure, the RAID arrays are gone. </p>

<p>That is the expected behavior for reload, the partitions are applied only to the first disk and it is not possible to specify RAID configuration via API for reload.</p>

<p>You have two options to mantain your RAID configuration:</p>

<p>1.- Do not specify any partition configuration for the reload, so the OS of your server will be reload, but it will mantain the same RAID configuration.</p>

<p>2.- You can spececify a script which will be executed after the reload (customProvisioningScripUri that is name of the property you need to add see more <a href="http://sldn.softlayer.com/reference/datatypes/SoftLayer_Container_Hardware_Server_Configuration" rel="nofollow">here</a>), in that script you can automate the creation of RAID you want.</p>

<p>Regards</p>

python softlayer