Softlayer_Hardware:如何在同一组磁盘上设置多个raid10 storageGroups [英] Softlayer_Hardware: How to setup multiple raid10 storageGroups on the same set of disks

查看:87
本文介绍了Softlayer_Hardware:如何在同一组磁盘上设置多个raid10 storageGroups的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我正在致力于配置Softlayer裸机实例的自动化. 我有一个适合订购硬件的json,但似乎无法弄清楚如何指定磁盘布局.

I am working on automation of provisioning Softlayer baremetal instances. I have an appropriate json for ordering the hardware, but I can't seem to figure out how to specify the disk layout.

以下尼尔森的答案显示了该过程的关键部分:使用Chrome开发人员工具获取价格ID和RAID配置.

The Answer below from Nelson shows the key part to the process: Using the Chrome developer tools to obtain price ids and raid configuration.

在门户网站上,我订购了一个测试系统,指定了4个4000GB Western Digital WD RE驱动器并配置了存储组 具有1 TB的标准linux和7 TB的附加分区.

On the portal I ordered a test system, specifying 4 4000GB Western Digital WD RE drives and cofiguring the storage groups with 1 TB standard linux plus a 7 TB additional partition.

存储组配置

然后使用chrome dev工具捕获生成的json,我看到了存储组配置

And using the chrome dev tools to capture the resulting json, I see the storage group configuration

data[Order][primaryDiskPartitionId]:1
data[Order][storageGroups][storage-group-1][arrayTypeId]:5
data[Order][storageGroups][storage-group-1][arraySize]:1000
data[Order][storageGroups][storage-group-1][lvmFlag]:0
data[Order][storageGroups][storage-group-1][partitionTemplateId]:1
data[Order][storageGroups][storage-group-1][hardDrives][]:0
data[Order][storageGroups][storage-group-1][hardDrives][]:1
data[Order][storageGroups][storage-group-1][hardDrives][]:2
data[Order][storageGroups][storage-group-1][hardDrives][]:3
data[Order][storageGroups][storage-group-2][arrayTypeId]:5
data[Order][storageGroups][storage-group-2][arraySize]:7000
data[Order][storageGroups][storage-group-2][lvmFlag]:0
data[Order][storageGroups][storage-group-2][hardDrives][]:0
data[Order][storageGroups][storage-group-2][hardDrives][]:1
data[Order][storageGroups][storage-group-2][hardDrives][]:2
data[Order][storageGroups][storage-group-2][hardDrives][]:3

当系统恢复正常时,我看到了如下磁盘:

When the system materialzied, I saw the disks as follows:

/dev/sda6        1006602  1850    953597   1% / <------ sda - 1Tb linux parttion set
/dev/sda1            237    68       158  30% /boot 
/dev/sdb1        6553650    54   6487522   1% /disk1 <- sdb - remaining 7Tb 

磁盘结构是

-> fdisk -l /dev/sda
Disk /dev/sda: 1000 GiB, 1073741824000 bytes, 2097152000 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disklabel type: dos
Disk identifier: 0xab520822

Device     Boot   Start        End    Sectors   Size Id Type
/dev/sda1  *       2048     499711     497664   243M 83 Linux
/dev/sda2        501758 2097149951 2096648194 999.8G  5 Extended
/dev/sda5        501760    2500607    1998848   976M 82 Linux swap / Solaris
/dev/sda6       2502656 2097149951 2094647296 998.8G 83 Linux

Partition 2 does not start on physical sector boundary.

-> fdisk -l /dev/sdb
Disk /dev/sdb: 6.3 TiB, 6926708506624 bytes, 13528727552 sectors
Units: sectors of 1 * 512 = 512 bytes
Sector size (logical/physical): 512 bytes / 512 bytes
I/O size (minimum/optimal): 262144 bytes / 262144 bytes
Disklabel type: gpt
Disk identifier: ADFDCBE8-94E3-4C23-85C6-D43F332AA1BB

Device     Start         End     Sectors  Size Type
/dev/sdb1   2048 13528725503 13528723456  6.3T Linux filesystem

SL创建了一个raid 10设备,将其雕刻到2个单独的磁盘中,其中1个作为1 TB linux基本版,另外1个作为7 TB fs安装在/disk1上

SL created a raid 10 device, carved that into 2 separate disks, 1 as a 1 TB linux basic and 1 as a 7 TB fs mounted at /disk1

现在,我们需要弄清楚通过python创建相同语法的语法. SoftLayer API:具有基本功能的Provisioning Server RAID配置显示了如何创建基本的raid10 linux分区. 在订购时间配置软层磁盘分区扩展了该范围,以显示如何创建各种配置. 但是,都没有显示如何创建上面的配置.第二点指出当时是不可能的.

Now we need to figure out the syntax for creating the same via python. SoftLayer API: Provision Server with Basic RAID Configuration shows how to create a basic raid10 linux partition. And Configuring Softlayer Disk Partitions at Order Time extends that to show how to create various configurations. However, neither shows how to create the configuration above. And the second states that it was not possible at the time.

这是不带storageGroup块的json顺序.请注意,答案中讨论的chrome开发工具中提供了价格ID.

This is the order json without the storageGroup block. Note that the price ids are available in the chrome dev tool discussed in the answer.

worker_json = {
    "quantity" : 1,
    "packageId": 551,
    "location" : datacenterId,
    "hardware" : [
        {
            "hostname": module.params.get('hostname'),
            "domain": module.params.get('domain'),
            "primaryNetworkComponent": {
                "networkVlanId": public,
            },
            "primaryBackendNetworkComponent": {
                "networkVlanId": private,
            }
        }
    ],
    "prices": [
        { "id": 171621 },
        { "id": 177669 },
        { "id": 165723 },
        { "id":  29691 ,  "item" : {"description": "RAID 10 - SATA/SAS - MegaRAID SAS 9361-8i" }},
        { "id":  49841 ,  "item" : {"description": "Hard Drive 4000GB Western Digital WD RE" }},
        { "id":  49841 ,  "item" : {"description": "Hard Drive 4000GB Western Digital WD RE" }},
        { "id":  49841 ,  "item" : {"description": "Hard Drive 4000GB Western Digital WD RE" }},
        { "id":  49841 ,  "item" : {"description": "Hard Drive 4000GB Western Digital WD RE" }},
        { "id":  33483 },
        { "id":  35686 },
        { "id":  50359 }, 
        { "id":  34807 },
        { "id":  27023 },
        { "id":  35310 },
        { "id":  50223 },
        { "id":  25014 },
        { "id":  34996 },
        { "id":  32500 }
    ],
    "storageGroups": [
        { What to put here? }
    ]
}

这是最后一个由上面的chrome dev工具输出创建的storageGoup json.这产生了所需的raid配置:

Here is the final storageGoup json that was created from the chrome dev tools output above. This produced the desired raid configuration:

    "primaryDiskPartitionId": 1,
    "storageGroups": [
        {
            "arraySize": 1000,
            "arrayTypeId": 5,
            "hardDrives": [ 0, 1, 2, 3 ],
            "partitionTemplateId" : 1
        },
        {
            "arraySize": 7000,
            "arrayTypeId": 5,
            "hardDrives": [ 0, 1, 2, 3 ]
        }
    ]

推荐答案

这是我认为您正在执行的配置(如果您要发布屏幕截图会更容易)

this is the configuration I think you are doing (it would be easier if you wouald had post an screenshot)

该存储组的配置为:

"storageGroups": [
    {
    "arraySize": 8000,
    "arrayTypeId": 5,
    "hardDrives": [ 0, 1, 2, 3 ],
    "partitionTemplateId": 4
    }
]

无论如何,如果不是这样的配置,则可以使用 chrome开发人员工具查看控制门户使用的配置

Anyway if that is not the configuration you can see the configuration that the control portal is using with the chrome developer tools

您只需要控制进行订单的所有配置,然后在按保存到订单"之前打开开发人员工具,选择网络"选项卡并标记保留日志"复选框:

you just need to go to control make all the configuration for your order and before pressing the "SAVE TO ORDER" open the developer tools, selec the "Network" tab and mark "Preserve log" checkbox:

然后单击保存至订单"按钮,然后查找以下POST请求

then click the "Save to order" button and look for the following POST request

打开

,您将看到存储组配置,然后只需要在请求中转换相同的配置即可.如果您对此有疑问,请向我发送您在开发人员工具中看到的配置

and you will see the storage group configuration, then you just need to translate the same configuration in your request and that's it. If you have troubles with that send me the configuration that you see in developers tools

更新

根据您的图片,正确的配置似乎是这样的:

accordign your image the correct configuration seems be this:

"primaryDiskPartitionId": 1,
"storageGroups": [{
            "arraySize": 1000,
            "arrayTypeId": 5,
            "hardDrives": [0, 1, 2, 3],
            "lvmFlag": 1,
            "partitionTemplateId": 1
        },
        {
            "arraySize": 7000,
            "arrayTypeId": 5,
            "hardDrives": [0, 1, 2, 3]
        }
    ]

这篇关于Softlayer_Hardware:如何在同一组磁盘上设置多个raid10 storageGroups的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆