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
1.1k views
in Technique[技术] by (71.8m points)

ibm cloud - How to create duplicate block storage from snapshot using Softlayer rest api

I have created snapshot but unable to create block storage from snapshot. We cant find any Api document. Anyone help me on this request


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

1 Answer

0 votes
by (71.8m points)

Try using the following slcli command to order a duplicate volume:

slcli block volume-duplicate --origin-snapshot-id 11111 --billing monthly 22222

Replace 11111 for your snapshot id and 22222 for your volume id.

To get the list of the snapshot ids for your volume you can use the following command:

slcli block snapshot-list 1234

Replace 1234 for your volume id.

You can order a duplicate volume through rest call too see the below example:

Method: POST

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Product_Order/verifyOrder

Body: Json

{"parameters": [{
"complexType":"SoftLayer_Container_Product_Order_Network_Storage_AsAService",
"packageId": 759,
"location":449600,
"quantity": 1,
"prices": [ 
        { "id": 225129,
          "item": {
              "id": 13215,
              "description": "Storage space for 2 IOPS per GB"
          }},
        { "id": 192043,
          "item": {
              "id": 5938,
              "description": "0.25 IOPS per GB"
          }},            
        {"id": 192473,
        "item": {
              "id": 5130,
              "description": "20 GB Storage Space"
          }}, 
        {"id":189433,
         "item": {
              "id": 9571,
              "description": "Storage as a Service"
          }},
        {"id":189443,
         "item": {
              "id": 5944,
              "description": "Block Storage"
          }}],
"useHourlyPricing": false,
"duplicateOriginSnapshotId": 11111,
"duplicateOriginVolumeId": 22222,
"osFormatType": {  
        "id":12,
        "keyName":"LINUX"
        },
"volumeSize": 16000
}
]}

Replace 11111 for your snapshot id and 22222 for your volume id.


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

...