Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
525 views
in Technique[技术] by (71.8m points)

ibm cloud infrastructure - How to add two or more disk to softlayer virtual server while provisioning

Add two or more disk to virtual server while provisioning in softlayer using rest query

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Answer

0 votes
by (71.8m points)

you can set the disk at order time, see the documentation about

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

basically you have to configure them at the block devices section:

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

Then you can add more disk after the Virtual server has been provisioned vi Upgrading the Virtual Server.

To upgrade the server you need to use this method: http://sldn.softlayer.com/reference/services/SoftLayer_Product_Order/placeOrder

see this example:

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"
        }]
    }

basically you need to specify:

  1. the ID of the VSI you want to upgrade
  2. The prices of the items you want to add, to get the list of prices you can use this method: http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/getUpgradeItemPrices
  3. You need to specify the date when the VSI must be ugraded

Regards


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome to OStack Knowledge Sharing Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...