Sun N1 Service Provisioning System 5.1 Plan and Component Developer's Guide

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 the appropriate 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.