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

时间:2016-06-13 05:37:27

标签: ibm-cloud-infrastructure

在softlayer中进行配置时,将两个或更多磁盘添加到虚拟服务器 使用休息查询

1 个答案:

答案 0 :(得分:0)

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

的文档

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

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

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

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

要升级服务器,您需要使用此方法: 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的日期
  4. 此致