Search code examples
ibm-cloud-infrastructure

Private or Public Image Setting for Autoscale in SL


I am trying to set Operating System for autoscale.

In case of Operating System, I have set the code with API below.

        /**
         * Operating System
         */
        String operatingSystem = "WIN_2012-STD-R2_64";
virtualGuestMemberTemplate.setOperatingSystemReferenceCode(operatingSystem);

It works fine with Operating system, but what about private or public image ?

            /**
             * Public Image
             */
            String GlobalIdentifier = "1176d22b-176a-499a-8d94-f9aaf29155a3";
virtualGuestMemberTemplate.setGlobalIdentifier(GlobalIdentifier);

It returns an error, invalid guest template. How can I set VirtualGuestMemberTemplate for public and private Image ?

Select Operating system


Solution

  • keep in mind that the configuration of the VM in autoscale group is almost the same like the configuiration when you create a new VM using the SoftLayer_Virtual_Guest::createObject so to set the image template you need to do it like this:

    { 
        "blockDeviceTemplateGroup": { 
            "globalIdentifier": "07beadaa-1e11-476e-a188-3f7795feb9fb" 
        } 
    }
    

    see http://sldn.softlayer.com/reference/services/SoftLayer_Virtual_Guest/createObject for more information

    Regards