Creating a vGPU device with second disk

梦想与她 提交于 2020-01-16 19:42:12

问题


Thanks for the previous asked question(Creating and recognition of a vGPU device), I know that, to create a new VSI using GPU, I can use this rest api:

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/createObject

With payload json string.

My question is, what if I need a second disk when creating a vgpu device, how to add that information into the above payload json string?


回答1:


To add second disks, you need to add the attribute ¨blockDevices¨ into the payload json, where you can put the size of the disk.

The GPU option to create a new VSI are ¨AC¨ and ¨ACL¨

• For the GPU ¨AC¨ the size of the disks are from 10 GB to 2.00 TB (SAN) and the attribute ¨localDiskFlag¨ must be ¨false¨ because the disk is SAN.

• The the GPU ¨ ACL¨ has to 2 options:

 "ACL1_8X60X100", where the second and third disk has only the size 300 GB (LOCAL).

 "ACL1_16X120X100", where the second and third disk has only the size 600 GB (LOCAL).

The attribute ¨localDiskFlag¨ must be "true" because the disk is LOCAL.

You can use this rest api example to create a VSI with the GPU ¨AC¨ option:

Method: POST

https://[username]:[apiKey]@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/createObject

Body: Json

{
    "parameters": [
        {
            "hostname": "test",
            "domain": "test.local",
            "datacenter": {
                "name": "dal13"
                },
            "hourlyBillingFlag": "true",
            "localDiskFlag": false,
            "operatingSystemReferenceCode": "CENTOS_7_64",
            "supplementalCreateObjectOptions": {
                         "flavorKeyName": "AC1_8X60X25"
           },
           "blockDevices": [ 
           { 
               "device": "2", 
               "diskImage": { 
                  "capacity": 50 
               } 
            }
          ]
        }
    ]
}

To create another VSI with the GPU ¨ACL¨ option, you can use this other rest api example changing the values mentioned above:

{
    "parameters": [
        {
            "hostname": "test",
            "domain": "test.local",
            "datacenter": {
                "name": "dal13"
                },
            "hourlyBillingFlag": "true",
            "localDiskFlag": true,
            "operatingSystemReferenceCode": "CENTOS_7_64",
            "supplementalCreateObjectOptions": {
                         "flavorKeyName": "ACL1_8X60X100"
           },

           "blockDevices": [
           { 
               "device": "2", 
               "diskImage": { 
                  "capacity": 300
               } 
            }
           ]
        }
    ]
}


来源:https://stackoverflow.com/questions/50026130/creating-a-vgpu-device-with-second-disk

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!