To learn how to use the "base" ServerTemplate as a starting point to develop custom ServerTemplates.
Note: The following ServerTemplate uses Chef cookbooks and recipes. If you prefer to use RightScripts, see Base ServerTemplate for Linux (RSB).
This tutorial describes how you can quickly develop custom ServerTemplates by starting with a "base" ServerTemplate that contains the minimum set of scripts that are required to support monitoring, alerts, logging, and audit entries. Instead of building a ServerTemplate from scratch, it's recommended that you start your development with the "base" ServerTemplate if you cannot find an existing ServerTemplate in the MultiCloud Marketplace (MCM) that more closely meets your needs.
Import and Clone the ServerTemplate
- Create a new deployment. See Create a New Deployment.
- Go to Design > MultiCloud Marketplace > ServerTemplates. Import the Base ServerTemplate for Linux ServerTemplate.
- Clone the imported ServerTemplate to create an editable HEAD version. Change the name of the ServerTemplate so that it more accurately describes the type of ServerTemplate you are going to build.
- Before you make changes to the ServerTemplate, it's recommended that you first commit the ServerTemplate so that the first committed revision (Rev 1) of the ServerTemplate matches the original version that you imported from the MCM without any changes. You can use a simple commit message such as "Matches original imported version. No changes." This way, you'll be able to easily perform a differential between the current HEAD version and the "original" version to see an exhaustive list of all the changes.
Modify the ServerTemplate
The "Base" ServerTemplate uses a committed revision of a RepoPath object that you cannot change. Therefore, if you want to add new Chef recipes to the ServerTemplate from a different cookbooks, you will need to attach each cookbook to the ServerTemplate.
- Add a repository. Before you can attach a new cookbook, you must import the cookbook into your RightScale account by creating a reference to the source repository. See Add a Repository.
- Import cookbooks that you want to use in the cloned ServerTemplate. See Import Cookbooks from a Repository.
- Attach new cookbooks to the cloned ServerTemplate. Go to the Scripts tab of the editable HEAD version of the cloned ServerTemplate. Click Modify. Attach new cookbooks.
- Add new Chef recipes from the attached cookbooks to the appropriate script list and rearrange the order or scripts, as necessary. Note: You can also add RightScripts.
- Go to the Inputs tab and set any default values that you want to set at the ServerTemplate level.
Add a Server to a Deployment
- While viewing the HEAD version of the ServerTemplate, click the Add Server button to create a new server in the deployment. Since you are going to make modifications to the ServerTemplate for customization purposes, you will want to launch a server with the HEAD (editable) version of the ServerTemplate so that you can easily add scripts to the ServerTemplate and test them on a running server without having to relaunch the server each time you make a change. For more information, see Add a Server to a Deployment.
Launch the Server
The "base" ServerTemplate only contains the bare minimum set of scripts that are common to all ServerTemplates published by RightScale, which support monitoring, alerts, logging, and detailed audit entries.
- Launch the server that you just created.
- Because there are no boot scripts that are missing any required inputs, scroll to the bottom of the page and click Launch. In a few minutes you will have an operational server. You can now click the server's Monitoring tab to view real-time monitoring graphs, set up alerts, and use the audit entries for troubleshooting information as you continue your ServerTemplate development.
Customize the ServerTemplate
Now that you have a running server the next step is to add new scripts to the ServerTemplate that you want to test. Since a server's scripts are defined by its ServerTemplate, you can easily add a new script to the HEAD version of the ServerTemplate and then execute it on the running server.