如何在配置时将两个或更多磁盘添加到软层虚拟服务器

How to add two or more disk to softlayer virtual server while provisioning

在软层中配置时向虚拟服务器添加两个或更多磁盘 使用休息查询

您可以在订购时设置磁盘,请参阅有关

的文档

http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject

基本上你必须在块设备部分配置它们:

{ 
    "blockDevices": [ 
        { 
            "device": "0", 
            "diskImage": { 
                "capacity": 100 
            } 
        }
        { 
            "device": "2", 
            "diskImage": { 
                "capacity": 25 
            } 
        }
    ], 
    "localDiskFlag": true 
}

然后您可以在通过升级虚拟服务器配置虚拟服务器后添加更多磁盘。

升级服务器需要使用以下方法: http://sldn.softlayer.com/reference/services/SoftLayer_Product_Order/placeOrder

看这个例子:

POST https://api.softlayer.com/rest/v3.1/SoftLayer_Product_Order/placeOrder

body: 
    {
        "parameters": [{
            "virtualGuests": [{
                "id": 49495232
            }],
            "prices": [{
                    "id": 2277,
                    "categories": [{
                        "categoryCode": "guest_disk1",
                        "complexType": "SoftLayer_Product_Item_Category"
                    }],
                    "complexType": "SoftLayer_Product_Item_Price"
                },

                {
                    "id": 2270,
                    "categories": [{
                        "categoryCode": "guest_disk2",
                        "complexType": "SoftLayer_Product_Item_Category"
                    }],
                    "complexType": "SoftLayer_Product_Item_Price"
                }
            ],
            "properties": [

                {
                    "name": "NOTE_GENERAL",
                    "value": "adding disks"
                },

                {
                    "name": "MAINTENANCE_WINDOW",
                    "value": "2014-08-25T9:50:00-05:00"
                }
            ],
            "complexType": "SoftLayer_Container_Product_Order_Virtual_Guest_Upgrade"
        }]
    }

基本上你需要指定:

  1. 您要升级的 VSI 的 ID
  2. 您要添加的商品的价格,要获取价格列表您可以使用此方法: http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/getUpgradeItemPrices
  3. 您需要指定必须升级 VSI 的日期

此致