N1 Grid Service Provisioning System 5.0 Plan and Component Developer's Guide

Chapter 1 Plan and Component Development Concepts

This chapter describes plan and component concepts that relate to the N1 Grid Service Provisioning System software, henceforth referred to as the provisioning system.

This chapter covers the following topics:

Component Concepts

A component is a logical grouping of resources that defines an application. It also includes a set of instructions that specifies how to handle the resources that make up the application. A component might be a collection of the following:

You can use the provisioning system to manage applications in a data center. Before you can manage your applications with this product, you must first model them as components. The provisioning system enables you to do the following:

The provisioning system supports two basic types of components:

A composite component contains references to components. The referenced components are referred to as contained components (child components), and the referencing component is referred to as the container component (parent component).

A composite component declares whether each of its contained components is to be installed as a top-level component or a nested component. If a contained component is installed as top-level, it can be used by any component just as if it had been directly installed by a plan. However, if a contained component is installed as nested, its services are only available to the container component. A nested contained component defines a finer-grained unit of functionality required by the container component, but is not otherwise useful to other components. Whereas a top-level contained component defines services that will be used by the container component, it can also be used by other components.


Note –

Composite components contain only references to other components, not to the components themselves. The referenced components are other existing components that are updated and managed separately from the container component. A component can be referenced by any number of composite components. A component's name is not affected by whether it is referenced by other composite components. Name conflicts are resolved using paths.


The provisioning system manages the physical resources associated with a component. It also includes a number of predefined components that you can use directly, or as samples for constructing other components.

A component also includes procedures. A procedure is a program that is contained in a component that controls deployment of the component. Typical component procedures are defined for installation, uninstallation, and capturing snapshots. Other procedures can be defined in the control block. A control is a series of instructions in a component that can be used to manage the deployed application. For example, controls might be used to start or shut down an application. A component might include instructions that test for dependencies on other components or that verify that a particular process is running.

A component can also declare substitution variables that can be used within the component itself or for any resources that the component contains. These variables can be used as placeholders for values that will be substituted when the plan is run.

Modeling a Component

The provisioning system offers great flexibility when you model components. The application that you are modeling determines which of the following approaches to use:

When you check in a component, it is built, and particular versions of the component resources are assigned to it. The build also assigns a version number to the component and ensures that that version of the component is always associated with particular versions of the component's resources.

Component Characteristics

A component is distinguished by many characteristics. The following list describes some of the more common component characteristics:

Component Procedures

A component procedure (or procedure) is a program that is contained in and manages a component. A component procedure might install, uninstall, or control a component. A procedure is created when you build the component.

You can run a procedure in these ways:

Your component can have several procedures. For example, a component might include a control procedure to start or stop the application that it models.

When you create a component that extends from a component type, the component inherits the procedures that are defined by the component type.

When you create a composite component, it inherits default installation and uninstallation procedures. Usually, components inherit procedures from the associated component type.

Component Inheritance

Component inheritance is the means by which a component obtains attributes and behavior from another component. When you create a component, it inherits any variables, snapshots, and procedures from the associated component type.

The use of inheritance makes the component model powerful and flexible. For example, suppose that you have a thousand components that are based on the IIS Application component type. You want to add more functionality to these components. By adding the functionality to the IIS Application component type, each of the thousand components that extend it will inherit the new functionality.

Component Variables

Components support the use of variables, which are user-definable containers that store values and are used during deployment.

A component variable is used to make parts of a component accessible and configurable by objects that are external to the component. For example, a component might have a variable named installPath that is overridden on a per-host basis. This variable defines where to install each component.

The value of a component variable can be a reference to another component variable, which includes variables that are defined by the component's container. When a nested component is added to a container component, the browser interface verifies that the referenced variable is defined in the container. If the variable is not defined in the container component, the browser interface automatically adds the referenced variable to the list of the container's variables.

For example, simple components typically define their installPath variable to have the value of the container component's installPath variable. In this example, the syntax of the referenced variable is :[container:installPath]. For more information about variable substitution, see Chapter 6, Configuration Generation.

Component variables are evaluated and assigned a value when the component is deployed. Component variables are used to specify information (such as host names, IP addresses, and paths) that is required to implement a deployment.

Variable Settings

Variable settings are collections of variable values that can be used to override the default values of one or more component variables. Based on the variable settings that you use, you can specify different values for component variables. You specify which variable settings to use when you run a plan.

For example, a component is deployed to different environments, such as a production environment and a development environment. If the defined component variables are set up to recognize the differences between environments, you can use variable settings to configure the component for each environment. For example, use one set to configure the production environment and another set to configure the component for the development environment.

Variable Overrides

Variable overrides enable you to override variable default values for composite components. They cannot be used for simple components.

When a component contains other components, called child components, variable settings only affect the top-level parent component. All child components use the default values for their variables. A child component can obtain variable values from its parent component in these two ways:

Steps

Steps are simple instructions that can be part of both plans and components.

For information about steps, see Step Overview.

Component Type Concepts

A component type is a component that has been designed as an encapsulation of behavior for reuse by other components. A component type usually represents behavior that is specific to a particular type of application. For example, an Enterprise JavaBeansTM (EJBTM) component type might contain generic procedures that can be used to deploy and undeploy an EJB archive to and from an application server. When a component extends from a component type, it automatically inherits the behavior that is defined in that component type.

Components are usually associated with a component type. If you select untyped from the browser interface, your component will not extend from any other component type. The provisioning system includes some built-in component types. See Chapter 3, Built-in Component Types.

The files, directories, and other tree structures that are referred to by a simple component are managed as a discrete unit in a component.

For example, an IIS application, which the provisioning system would manage as referenced resources, might include the following:

Some of the resources that are referenced by components, such as files and directories, can be copied from a gold server or another data source. Others, such as IIS web site settings or Microsoft Windows registry entries, must be extracted from a data source in a special way so that they can be treated as independent, manageable entities.

With its built-in component types, the provisioning system can recognize the most common source items that are used for JavaTM 2 Platform, Enterprise Edition (J2EE platform) and Microsoft Windows applications. These component types can accurately extract data for use as a component resource, store the component resource in a repository, and correctly install the resources in the specified location.

System Services Concepts

System services are components that are automatically deployed to all applicable hosts when the hosts are prepared. System services define utility controls and resources that can be used by other components for component installation and management.

System services enrich the set of services that are available during plan execution.

Plan Concepts

A plan, also called an execution plan, is a sequence of instructions that is used to manage one or more components on the specified hosts. For example, an execution plan might install three components and initiate the “startup” control of another component.

A plan can also include a sequence of other plans, which enables common instruction sequences to be written as plans and then shared among plans. For example, a plan might instruct the provisioning system to install three components and initiate the startup control for another.

The provisioning system provides an in-memory representation of the objects expressed by the XML schema. This representation also defines a process for the validation, persistence, and version control for those objects.

When the provisioning system executes a plan, substitution variables that are declared by a component are replaced by actual values. The provisioning system also supports a notification feature that can send email in response to events that are related to plan execution.

Plan Types

The provisioning system supports two types of plans:

The XML schema enforces the distinction between the two types of plans. Thus, you can use a top-level plan that contains calls to other subplans, or a simple plan that contains simple steps but no calls to subplans.

This distinction is important because the steps in a simple plan can only execute on the same set of target hosts, whereas the steps of a composite plan can execute on different sets of target hosts. A composite plan can use one set of target hosts for each simple plan that it contains.

Step Overview

Steps are simple instructions that can be part of both plans and components. The provisioning system supports the following kinds of steps:

Component References

A number of steps can reference components in the following situations:


Example 1–1 Using Component References

Assume that the “Apache” component is installed on a host with the following attribute settings.

Component Instance 

installPath

version

installDate

/opt

1.3 

6/1/01 6:00 p.m. 

/usr/local

1.4 

6/1/01 5:00 p.m. 

/opt

1.2 

6/2/01 5:00 p.m. 

/usr/local/bin

1.4 

6/3/01 5:00 p.m. 

/export

1.1 

6/4/01 5:00 p.m. 

The following shows which installed component is referenced when values for various combinations of the installPath and version attributes are supplied.

installPath

version

versionOp

Result 

Explanation 

None 

None 

None 

The most recently installed component on the target host is used, regardless of the values of version and installPath.

/opt

None 

None 

The most recently installed component in the named install path is used regardless of the value of version.

/usr/bin

None 

None 

ERROR 

No component is installed in the specified path. 

None 

1.4 

=

The most recently installed component that has the specified version is chosen, regardless of the value of installPath.

None 

1.5 

Any 

ERROR 

No component is installed with the specified version. 

/usr/local

1.4 

=, >=

The component that matches the specified installPath and version attribute values is chosen.

/usr/local

1.2 

=

ERROR 

No such version is installed at the specified install path. 

/usr/local

1.2 

>, >=

The values for installPath, version, and versionOp match.

/opt

Any 

ERROR 

If two or more components are installed in the same path and they have the same name, the most recently installed component effectively overwrites any other components that have been installed earlier. Components that have been installed at an earlier time cannot be accessed, even if directly specified. 


Session Variable Concepts

A session is initiated when you log in to the browser interface or use the CLI. A session persists until you log out or inactivity causes the session to expire. Logically, a session represents the authenticated credentials of a particular user. A session is used to identify the user throughout a series of related requests without reauthentication.

Each session can have a set of session variables that are initialized from the database when you log in. You can use session variables to preserve session-related information, such as user authentication and other credentials. You can modify the session variables in the current session without affecting the session variables that are saved in the database. If you make changes to session variables and their values, you can save them to the database. When saved, all of the variables and their values are saved and are available in future sessions. You can make session variable references when you execute plans and comparisons.

If you have initiated more than one session and try to save the session variables at the same time, only the first session to save the variables succeeds. After the first session successfully saves the session variables, the other sessions are prevented from saving changes to their session variables. To save those changes, do the following:

  1. Log out of all sessions.

  2. Log in again to restart a session.

    The new set of session variables and values are retrieved from the database based on the last successful save.

  3. Make the changes you want to the session variables.

  4. Save the changes to the session variables.

Session variables exist in a global namespace, which means that the session variable names you declare are available to all user sessions. For example, suppose that you define a session variable named passwd. Any plan that requests the passwd session variable is referring to the same variable. Session variable names are not scoped to current plans, components, blocks, or hosts. Thus, you must ensure that your session variable names are unique. For example, you might use your initials and birthday month and day, or some other identifier, to make your session variables unique.

Secure Session Variables

A session variable is made up of a name, value, and the secure flag. The session variable name has the same limits as a host-type variable name. The secure flag is a Boolean value that describes whether the value should be securely stored.

When a value is securely stored, the secure flag is set to true. The value of the session variable appears as *** and is encrypted when the variable is saved. When this value is used during plan execution, the value of this variable is obscured from plan history output, as well. Use this secure flag when the variable value is sensitive data, such as passwords. By default, session variables are created with the secure flag set to true.

If any secure variables are saved to the database, you must type your password, which is used as the encryption key. If you supply the wrong password, you are prompted for the password again.

If the password you enter is not recognized, an error is issued. This might occur if the system administrator has changed your password or your login configuration. You are given the following options: