Page tree
Skip to end of metadata
Go to start of metadata

Methods for creating Farm Templates

Manually creating Farm Templates

Farm templates can be manually created from the Farm Templates page by selecting New Template and completing the configuration fields presented in the New Farm Template window:

Specify a Name for the template, and optionally provide a Description of the Farm Template contents:

If you want your template to be publicly available, be sure to set Published to Yes. If set to No, the template can be saved and edited later but will not be available for use.

If desired, the Icon for the Farm Template may be changed.  This is the icon that will be displayed for the Catalog item the Farm Template represents in the Service Catalog.

Example simple Farm Template:

Note: The contents of the Farm Template essentially provide all of the data that exists in the Template to the Scalr API.  When launching a new Farm from a Farm Template, the Service Catalog UI will present fields to be filled in by users dynamically based on the info provided from the template and what is still required to complete the necessary configuration for Farm launch.  If items are provided but violate Policy, an error will be presented and the user will be required to provide the appropriate value before Scalr will allow Farm launch from the template.

{
    "_meta": {
        "schema_version": "v1beta0-7.4.0"
    },
    "farm": {
        "name": "One server Template base",
        "description": "",
        "timezone": "America\/Denver",
        "launchOrder": "simultaneous"
    },
    "roles": [{
        "alias": "base-ubuntu1604-hvm",
        "platform": "ec2",
        "role": {
            "id": 82948
        },
        "scaling": {
            "enabled": true,
            "minInstances": 1,
            "maxInstances": 2,
            "scalingBehavior": "launch-terminate",
            "considerSuspendedServers": "running",
            "rules": []
        },
        "placement": {
            "region": "us-east-1",
            "placementConfigurationType": "AwsClassicPlacementConfiguration",
            "availabilityZones": null
        },
        "instance": {
            "instanceConfigurationType": "AwsInstanceConfiguration",
            "instanceType": {
                "id": "m3.medium"
            }
        },
        "orchestration": {
            "rules": []
        }
    }]
}

Farm Template Content may be entered manually:

Via a web URL, such as a GitHub repository:

Or via local file upload:

One you are finished, click the Save icon:

Your newly created Farm Template will be listed in the Farm Templates list:


Automatically creating Farm Templates from existing Farms:

You can also easily create a new template from any existing Farm from the Actions menu.  Typically this will be the best starting point for creating new Farm Templates rather than creating them manually:

Please note: This automatically generated template will be bound by the capabilities of APIv2 and may not contain all elements of your more complex farms.  If there are key configuration capabilities that you require for your use cases, please reach out to Support via your normal channels to discuss your use case.

You can then easily Change the Icon, alter details, and remove any items from the template body that you want your users to define manually.  

Be sure to set Published to Yes if you want your users to be able to access the template.

Click Save when done.