Search code examples
ibm-cloud-infrastructure

How to find storage space of an Image Template is taking?


I was told that SoftLayer charges $0.25 per GB for storage space used by each of the image template created. I've created a virtual guest and create an image template using it. How do I know how much space it has taken for storing the generated image template?

How can I get this information using SoftLayer service APIs?

Thank you.


Solution

  • try this it will return all your images templates and the disk space for them:

    GET https://api.softlayer.com/rest/v3.1/SoftLayer_Account/getPrivateBlockDeviceTemplateGroups?objectMask=mask[children[blockDevices[diskImage]]]
    

    you can see the value for the "diskSpace" field under "blockDevices" e.g.

    blockDevices": 
      {
    "device": "0"
    "diskImageId": 12456903
    "diskSpace": 36381956096
    "groupId": 883223
    "id": 1065801
    "units": "B"
    

    in case your image template have more than 1 disk you have to sum all the diskspaces.

    Regards