1

Is there a SoftLayer CLI command (or REST API) to boot an existing VSI from an ISO Image Template? This exists in the GUI as "Boot from Image", but not able to find any documentation on anything close that exists.

Closest CLI command I could find was the OS Reload command "slcli vs reload" and, unfortunately, it only works with Standard Image Templates, not ISO Image Templates.

19gary
  • 13
  • 2

1 Answers1

0

Try the following please:

Python Command Line (SLCLI)

slcli call-api Virtual_Guest mountIsoImage --id $vsiId $diskImageId

e.g:

slcli call-api Virtual_Guest mountIsoImage --id 22892000 14121207

Rest:

https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest/22892000/mountIsoImage

Method: Post

{  
   "parameters":[  
      14121207
   ]
}

Replace: $user, $apiKey, 22892000(vsiId) and 14121207(diskImageId) with your own information


Updated


According to the exception that you got, it seems that you are not sending a diskImageId valid, if you wish to get the diskImageId from your image template, try the following:

Python Command Line (SLCLI)

slcli call-api Virtual_Guest_Block_Device_Template_Group getChildren
--id $templateGroupId --mask=blockDevices.diskImageId

to get more details about disk images from the image template:

> slcli call-api Virtual_Guest_Block_Device_Template_Group getChildren
> --id $templateGroupId --mask=blockDevices.diskImage

Replace $templateGroupId with your image id


Rest:

https://$user:$apiKey@api.softlayer.com/rest/v3.1/SoftLayer_Virtual_Guest_Block_Device_Template_Group/$templateGroupId/getChildren?objectMask=mask[blockDevices[diskImage]]

Method: Get

References:

  • Got an error when running slcli call-api Virtual_Guest mountIsoImage --id xxxxxx xxxxxx SoftLayerAPIError(SoftLayer_Exception_InvalidValue): Invalid value provided for 'diskImageId'. – 19gary Sep 09 '16 at 18:00
  • I was trying to use a Private ISO Template from Object Storage, not sure if that matters. – 19gary Sep 09 '16 at 18:02
  • Review the **Updated** section in my answer, please make double check that you are sending a valid **diskImageId** – Ruber Cuellar Valenzuela Sep 09 '16 at 19:00
  • Sorry didn't get a chance to update, I figured that out that I was using ImageId instead of diskImageId. Thanks! – 19gary Sep 09 '16 at 21:51