Note: If you cannot find a topic, go to docs.rightscale.com where all RightScale documentation will soon be located. Also, feel free to Chat with us!
Home > ServerTemplates > Infinity > ST > Base ServerTemplate for Linux (Chef) (v14 Infinity) > Base ServerTemplate for Linux (Chef) (v14 Infinity) - Tutorial

Base ServerTemplate for Linux (Chef) (v14 Infinity) - Tutorial

 

Table of Contents    

Long Term Support

Stable, tested ServerTemplate assets

   ►  Tutorial

Objective

To learn how to use the "base" ServerTemplate as a starting point to develop custom ServerTemplates.

Prerequisites

  • 'actor', 'designer', and 'library' user role privileges
  • For Amazon EC2, CloudStack, and other clouds that support security groups, you must have a security group defined with TCP port 22 open for SSH access and port 80 for client HTTP access.

Overview

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. 

diag-Chef_Dev_Server-v1.png

Steps

Add a Repository

  1. Go to Design > Repositories.
  2. Select Add Repository.


screen_AddRepository .png

 

  1. A screen will display with the fields that define your repository information. 

 

screen_AddaRepository2.png

 

  1. Select the Type to choose the repository you would like to use. Select just one of the following depending on the repository you are using:
  1. Once the information has been entered, click OK.
  2. Once added, RightScale will fetch the information from the repository and the cookbooks from that repository will appear when you refresh the page.

    Note: If you notice the cookbooks are not appearing after a few minutes, you can click on the repository and go to the Info tab. The Last fetch output section will notify you if there were errors occurred during the fetch.

Import a Cookbook from a Repository

  1. Go to Design > Repositories.
  2. Click on a repository. 
  3. Select the cookbooks in the repository. From the Action drop-down, select Import.
     

screen_ImportaCookbookRepository.png

 

  1. From here you can choose to:
    • Import to a Primary or Alternate namespace - We recommend that if you use your own cookbooks that you import them to the primary namespace, but if you want to use an alternate namespace you can. When you select an alternate namespace, you can choose to follow the cookbook. When you follow a cookbook, the new or updated versions of that cookbook that are refetched into the repositories section will automatically get imported. For more information about following a cookbook, see Follow a Cookbook. For more information about namespaces, see Primary and Alternate Namespace.
    • Import Dependencies - If the cookbook relies on other cookbooks to run recipes, they will have dependencies. You can select this option so the cookbooks that the other cookbooks rely on will be imported. If the dependencies are missing, you will not be able to import them.
  2. When your options are selected, click Import.

Import and Clone the ServerTemplate

  1. Create a new deployment. See Create a New Deployment.
  2. Go to Design > MultiCloud Marketplace > ServerTemplates. Import the Base ServerTemplate for Linux ServerTemplate.
  3. 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.
  4. 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. Click the Commit button and enter a simple commit message such as "Matches original imported version. No changes." This way, you will 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.

Attach a Cookbook to a ServerTemplate

  1. Go the Scripts tab of the editable HEAD version of the ServerTemplate.
  2. Click Modify.
  3. Click Attach Cookbooks.
  4. Find and select the cookbook(s), which you imported into the RightScale account in a previous step. If more than one version of the cookbook is listed, select the version that is in the "primary" namespace and click Attach Selected.

Add a Recipe to the ServerTemplate

You are now ready to add recipes from any of the newly attached cookbooks into one of the boot/operational/decommission sections of the ServerTemplate. For additional information, see Add a RightScript or Recipe to a ServerTemplate.

Add a Server to a Deployment

  1. While viewing the HEAD version of the ServerTemplate, click the Add Server button to create a new server in the deployment.

 

screen-BaseLinuxAddServer-v1.png

 

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. 

  1. Launch the server that you just created.
  2. 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. 

You must to post a comment.
Last modified
10:20, 27 Jan 2015

Tags

Classifications

This page has no classifications.

Announcements

None


© 2006-2014 RightScale, Inc. All rights reserved.
RightScale is a registered trademark of RightScale, Inc. All other products and services may be trademarks or servicemarks of their respective owners.