You are here: Advanced Concepts > Creating DynaCenter Software Components > Creating a Component

Creating a Component

This topic provides an overview of the process for creating a component and gives an example of a simple one-file component. Sample Windows Components and Sample Linux Components provide more complex examples you can use as a reference when building your component.

Prerequisites

Before you can work with components, ensure the following:

  • You must have root permissions on the Management Workstation (MWS)
  • You must make the component management commands (also referred to as the “r commands”) available in your path

Process Overview

When you create a component, you create a source tree that contains all the directories and files for the component. All directories and files must have the appropriate permissions and ownership.

Step Description
1 Create the component directory structure on the MWS
2 Move (copy, download, etc.) the component content files to a root directory in the component directory structure
3 Set the appropriate ownership and permissions for the component content files (non-Windows component files only)
4

Create a postprovision script

Note: This is only needed when the image manipulation involves more than dropping files on the new server. For example, if you want to place files on the deployed server and then install them, you need a postprovision script to install the files after the component is deployed.

5 Create the component archive
6 Convert the component archive into a component
7 Deploy the component with an image

Procedure

The following instructions are for creating a simple component.

  1. Create a component working directory on the MWS.

    Example: In /home/<your_directory>, type mkdir components

  2. Create a component directory in the working directory.

    Example: In the components directory, type mkdir my_new_component

  3. Create a directory named root in the component directory.

    Example: In the my_new_component directory, type mkdir root

  4. Download or copy the component content file to the subdirectory named root in the component directory.
  5. For Linux/Unix components, set the appropriate ownership and permissions for the file.

    Tip: When you set the ownership and permissions appropriately during component creation, you do not have to customize the ownership and permissions on each deployed server where the component is installed.

  6. Do one of the following:
    • If the purpose of the component is simply to place files on the deployed server, go to Step 7.
    • If the component being deployed must be processed after it is deployed, create a shell-compatible postprovision script to run the component.

      The postprovision script must be named postprovision or postprovision.cmd (depending on the environment you are going to deploy to) and must be located in the component directory.

  7. Create the component archive:

    Example: In the components directory, type:

    msa --name=<component_name> --desc=<description> \
    --ostype=<ostype> <pathname>
    

    Where:

    Options--nameComponent name; if not specified, the pathname is used
    --descHelpful description for the component
    --ostype

    Operating system of the component and the image it will be applied to

    Note: Each component must have the same os-type as the image that will use it or the deploy will not complete successfully. The dccmd list ostypes command lists valid operating system types. The format supports wildcards; however, it is always best to select the most specific value possible.

    --vendor

    Vendor of the component

    The default value is Racemi, Inc.

    ArgumentpathnameComponent directory where the component control files should be placed
  8. Convert the archive into a component.

    rinstallsnapshot --description=<component_description> \
    --os-type=<ostype> --prefix=<directory> \
    --vendor=<vendor> <name> <source> <repository>
    

    Where:

    Options --description Helpful description for the component
    --os-type

    Operating system of the component and the image it will be applied to

    Note: Each component must have the same os-type as the image that will use it or the deploy will not complete successfully. The dccmd list ostypes command lists valid operating system types. The format supports wildcards; however, it is always best to select the most specific value possible.

    --prefix

    Directory where the component will be installed relative to the root directory on the deployed server

    --vendor

    Vendor of the component

    Note: You can specify any custom value here.

    Argument name Descriptive name for the software component
      source Source of the files for the component
      repository Repository that will hold the component
  9. Add the component statement to the deploy profile that will be used with the image deploy task.

    Example:  

    #Deploy my component
    component <component_name>
    

 

© Copyright Racemi Incorporated 2017. All rights reserved.