6.2 Implementation

6.2.1 Overview

The autoyast parameter at the boot prompt of the installation boot medium points to the URL http://<AutoYaST-Server>/xml/ and therefore finds and retrieves the initial default control file, which contains class statements to configure general aspects of the system.

The specified classes contain template variables for their dynamic content. These classes are retrieved from the AutoYaST server and merged by standard AutoYaST functionality into the initial control file, /tmp/profile/autoinst.xml. This merged file still contains the template variables.

AutoYaST then enters the pre-script stage and retrieves the pre-fetch.sh script via HTTP as defined in the scripts section of the default control file.

pre-fetch.sh is the command center of the Novell Consulting Installation Framework that manages all aspects of building the customized control file for the new server.

It first retrieves and sources the CUSTOMER.txt customer configuration file and the main library. From this point on, pre-fetch.sh uses functions from the main ay_lib.sh library.

It then locates and parses the entry for the server being installed in the server.txt server configuration file.

In the next step, the original control file, /tmp/profile/autoinst.xml, is copied to /tmp/ profile/modified.xml. All subsequent modifications of the control file happen on this copy.

If the new server requires a tree name configuration file or a location configuration file, they are retrieved and sourced next.

Additional template files are retrieved based on the information obtained from the configuration files and are merged into the control file. Among other things, these files determine the disk partitioning of the new server and which patterns and packages need to be installed.

The service type specified in Field 14 of the server configuration file is evaluated next and the required XML files are also merged into the control file. These files contain information about the configuration of the various OES services such as eDirectory, NSS, and CIFS, but they are also used to specify some SLES configuration information, such as the memory reservation for the kdump kernel.

The custom library is retrieved and sourced next. As the last execution step, pre-fetch.sh replaces all placeholders that originated from the different template files and XML snippets that are now part of the /tmp/profile/modified.xml control file with the values that have been derived from the various configuration files.

If an error occurs during this process, pre-fetch.sh prints an appropriate error message indicating where the error has occurred. The administrator can inspect the error message and decide whether to abort or to continue the installation.

When pre-fetch.sh terminates without error, AutoYaST recognizes the /tmp/profiles/modified.xml control file and processes it as explained in autoinst.xml, modified.xml, and pre-autoinst.xml.

The remainder of this section explains this process in detail.

6.2.2 Directory Structure

Figure 6-1 illustrates the Novell Consulting Installation Framework stored in the directory structure underneath .../autoyast.

Figure 6-1 Directory Structure

.../autoyast/xml is the control file repository directory introduced and explained in Control File Repository.

The .../isos and .../install subdirectories are used to store the installation sources as discussed in Directory Layout for the Installation Repositories.

The .../update subdirectory holds the signed YUM repositories containing updates for the operating system (SLES 11 SP2) and the add-on product (OES 11 SP1) being installed.

These YUM repositories are integrated into the installation process as additional add-on products.

This is a temporary workaround that is required because ZENworks Configuration Management cannot sign the YUM repositories it creates, and unsigned repositories cause warning messages whenever they are accessed in YaST.

The purpose of the other directories underneath .../autoyast is explained in the following table, using the default names for files and directories suggested by Novell Consulting.

Table 6-1 Directory Layout for the Novell Consulting Installation Framework

Directory

Description

.../configs

All configuration files are stored in the following locations:

  • AY_MAIN.txt

  • CUSTOMER.txt

  • Your <TreeName>.txt files

  • Your location files

  • server.txt

.../files/addon

Holds the XML class files defining the add-on products for the various server types used in Field 02 of server.txt.

.../files/partitioning

Holds the XML class files for the partitioning of the various Disk Types used in Field 07 of server.txt.

.../files/services/oes11

Holds the XML class files configuring the OES 11 services that are part of the service types defined in CUSTOMER.txt.

.../files/services/sles11

Holds the XML class files configuring the SLES 11 services that are part of the service types defined in CUSTOMER.txt.

.../files/software

Holds the XML class files for the different software selections used in Field 08 of server.txt.

.../files/tools

Stores the check_errors.xml ask file that is required for error handling.

.../lib/customer

Stores the custom library customer_lib.sh that can be used to implement customer-specific functions to further customize the installation process.

.../lib/novell

Stores the main library ay_lib.sh provided by Novell Consulting.

Most of the functionality of the Novell Consulting Installation Framework is implemented in this library. It must not be changed or modified in any way.

Use the customer library instead.

.../scripts

All scripts that are executed in the pre-, post- or init- phases of the installation process are stored in this directory.

6.2.3 The Default File

The full default file used by the Novell Consulting Installation Framework is displayed below:

<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
   <classes config:type="list">
    <class>
        <class_name>general</class_name>
        <configuration>bootloader.xml</configuration>
    </class>
    <class>
        <class_name>general</class_name>
        <configuration>ca_mgm.xml</configuration>
    </class>
    <class>
        <class_name>general</class_name>
        <configuration>system.xml</configuration>
    </class>
    <class>
        <class_name>general</class_name>
        <configuration>general.xml</configuration>
    </class>
    <class>
        <class_name>scripts</class_name>
        <configuration>scripts.xml</configuration>
    </class>
    <class>
        <class_name>general</class_name>
        <configuration>net.xml</configuration>
    </class>
   </classes>
 <scripts>
<!--
    This section is mandatory and must not be removed.
    Amongst other things it is used to determine the
    IP address of the AutoYaST server in the post-inst
    phase
-->
    <pre-scripts config:type="list">
  <script>
  <interpreter>shell</interpreter>
  <filename>pre-fetch.sh</filename>
        <location>http://10.0.4.221/bs/scripts/pre-fetch.sh</location>
  <feedback config:type="boolean">false</feedback>
  <debug config:type="boolean">false</debug>
  </script>
    </pre-scripts>
  </scripts>
</profile>

This file contains two different kinds of information. First, class directives define class files that need to be merged to create the initial /tmp/profile/autoinst.xml control file and that configure the following aspects of the system:

  • bootloader.xml contains boot loader specific settings.

  • ca_mgm.xml configures the local certificate authority (CA).

  • system.xml configures settings for system users (root), and the default runlevel and sysconfig entries.

  • general.xml contains settings for language, time zone, keytable, and local firewall configurations.

  • scripts.xml is a class file that specifies scripts that are executed in different installation stages (mainly in the post-installation stage).

    Scripts are used to configure system properties that cannot be handled by YaST, because no XML tags exist to configure these system properties.

    For example, Novell Consulting is using an init-script to install the ZCM agent and to register the new device at the ZCM server.

  • net.xml configures network-specific parameters.

The second type of information in the file is in the scripts section, which defines the pre-fetch.sh pre-script file located in the scripts directory on the AutoYaST server. This information causes the AutoYaST engine to retrieve and execute this script.

This section is one of the few places where customer-specific values must be hard-coded. The IP address of the AutoYaST server is unique to every customer environment and cannot be derived from environment parameters. Therefore it must be explicitly specified in the URL to the pre-fetch.sh script in the location directive of the pre-script definition in the default file.

6.2.4 pre-fetch.sh

The first action of this script is to retrieve the AY_MAIN.txt system configuration file. This is implemented in the get_main_config_files( ) function that first derives the address of the AutoYaST server to be used from the command line.

The script needs three other pieces of information to be able to retrieve the required files from the installation server:

  • The name of the top-level directory of the installation framework (PREFIX=autoyast)

  • The directory where the configuration files are stored (AY_CONFIG_DIR=configs)

  • The name of the system configuration file (MAIN_CONFIG_FILE=AY_MAIN.txt)

This information must be available from within the script, so it is hard-coded. If you want to use different names for this file or any of the two directories, ensure that you set the correct values here.

All other file names, directory names, and URLs required to retrieve files from the AutoYaST server are always derived from the system configuration file.

The same function also retrieves and sources the ay_lib.sh main library (a set of shell functions that can be reused to reduce code fragments) and the CUSTOMER.txt customer configuration file (or whatever name is defined for it in AY_MAIN.txt).

Certain configuration information such as the default gateway, a list of name servers, or a suffix search list, and also OES-specific information such as the name of the installation user or the IP address of an existing replica server can be specified in three different places:

  • The customer configuration file (default name CUSTOMER.txt; mandatory)

  • The eDirectory tree configuration file (must be named <TreeName>.txt; mandatory)

  • A location configuration file (can use any name; optional)

The configuration files that need to be incorporated into the installation of a particular server are defined in Field 10 and Field 13 of the server.txt server configuration file. pre-fetch.sh sources these files in the following sequence:

customer configuration file > eDirectory tree configuration file > location configuration file

Values defined in global configuration files are overwritten by values for the same variable from more specific configuration files. For example, a list of NTP time servers specified in the customer configuration file as a company-wide default can be overwritten by specifying a different set of NTP servers in a configuration file representing an eDirectory tree. This NTP server list can be further modified by specifying yet another list of NTP servers in a location configuration file representing a particular site.

In some cases, a customer might have a requirement that cannot be accommodated by the ay_lib.sh main library. For these cases, the customer_lib.sh file has been provided. Code contained in this file is evaluated after code from the main library but before the replacement of the template variables takes place.

One of the central functions executed by pre-fetch.sh is the replacement of the placeholders with their real values. The following XML snippet illustrates how placeholders are specified and used:

<dns>
   <dhcp_hostname config:type="boolean">false</dhcp_hostname>
   <dhcp_resolv config:type="boolean">true</dhcp_resolv>
      <hostname>%%HOST_NAME%%</hostname>
   <domain>%%DOMAIN%%</domain>
   <searchlist config:type="list">
    <search>%%SEARCH_LIST%%</search>
   </searchlist><nameservers config:type="list">
    <nameserver>%%NAMESERVER%%</nameserver>
   </nameservers>
</dns>

At some point after parsing the server-specific line in server.txt and processing the specified configuration files, every variable will have its final value assigned. The replacement process now searches for every placeholder (enclosed in %%-signs, such as %%HOST_NAME%%) within /tmp/profile/modified.xml and replaces the whole string with the value of the corresponding $HOST_NAME variable. The replacement itself is using a sed function.

Another important function ensures the merging of complete XML snippets into the final control file. The function is using XSLT techniques by utilizing the /usr/share/autoinstall/xslt/merge.xslt file, which is part of any installation RAM disk provided by SUSE.

In particular, the partitioning, software, and service XML files are merged completely into the final /tmp/profile/modified.xml control file.

The last action performed by pre-fetch.sh is a basic error check. First, it checks to see if the /tmp/profile/modified.xml control file still contains %%-signs (which implies that “%%” must exclusively be used to identify placeholders. Any other usage, even in comments, results in an error).

Then it checks for a /tmp/profile/errors.txt file. This file is created by functions from ay_lib.sh when the retrieval of a remote file fails. If this file exists, a pop-up is generated that displays the content of /tmp/profile/errors.txt and queries whether the installation process should be continued or aborted.

6.2.5 Libraries

The framework provides two libraries. The main ay_lib.sh library developed by Novell Consulting contains nearly all code used by the pre-fetch.sh script. This library must not be changed or modified in any way. Any potential update to the Novell Consulting Installation Framework almost certainly results in a newer version of this library that overwrites any customer-specific modifications.

To accommodate customer-specific functionality, the empty .../autoyast/lib/ customer/customer_lib.sh library file is available. It can use functions that are already implemented in the main library, but also can implement new functions to provide additional functionality. The content of this file is sourced and executed by pre-fetch.sh just before the replacement of the placeholders takes place. No update to the framework ever touches this particular library.

6.2.6 Configuration Files

Configuration files have been mentioned several times in preceding sections. The purpose of these files, stored in the directory defined by the AY_CONFIG_DIR variable in pre-fetch.sh, is to separate information that is applicable to multiple servers from server-specific information.

Name servers, time servers, the distinguished name of the UNIX configuration object, or the list of LDAP servers are examples of settings that can be configured.

Configuration file entries provide three pieces of information:

  • The type of the information

    This can be a string, an IP address or DNS name, a URL, a file or directory name, a list of values, or any custom definition.

  • A short description

  • The actual definition in the format VARIABLE=”value”

The following example defines the name of the admin group for Linux User Management:

## Type String
## Description: fully distinguished name of the LUM admingroup
##              in LDAP syntax
LUM_ADMIN_GROUP="cn=admingroup,ou=Cluster1,ou=Servers,ou=DUS,ou=EMEA,o=Novell"

Although it is not always required in a strictly technical sense, we recommend that you always include values in double quotes. There is one notable exception: Because the password for the root user typically contains “$”, it must be enclosed in single quotes. As a best practice, any setting that is not used in a particular configuration file should be commented.

AY_MAIN.txt System Configuration File

This is the system configuration file of the Novell Consulting Installation Framework. It is the only configuration file where file and directory names are defined.

IMPORTANT:As explained in Section 6.2.4, pre-fetch.sh, the name and path of this file must be hard-coded in pre-fetch.sh. If you need to use a different name or path for the system configuration file, do not forget to make the appropriate changes in the script.

The framework has been tested only with the default names used in this document and defined in the version of AY_MAIN.txt provided by Novell Consulting. If you need to use different names, you can do so at your own risk, making the appropriate changes in AY_MAIN.txt.

However, we strongly recommend that you use the default name wherever possible.

Environment Configuration Files

To allow for sufficient flexibility to accommodate a wide variety of environments, the framework supports up to three configuration files where the same set of variables can be defined. They are discussed below in a global-to-local order.

Customer Configuration File (CUSTOMER.txt)

This file is the most global configuration file. It is mandatory for pure SLES systems as well as for OES systems. Some information is found only here, such as the customer name (informational only) or the information on the system used for software updates. It is also the only place where service types are configured.

Other parameters, such as GATEWAY, REPLICA_SERVER, OES_INSTALL_USER, or the LUM_ ADMIN_GROUP can be defined in any configuration file.

Tree Name Configuration File (<TREE_NAME>.txt )

Most customers have more than one eDirectory tree in their environment. Each of these eDirectory trees requires its own configuration file.

In small environments with only a few servers with identical settings, the CUSTOMER.txt configuration file can provide all required settings. However, the environment file responsible for the eDirectory tree environment must exist (the values can be left empty) if it is intended to install OES servers.

The name of this file is derived from the eDirectory tree name specified in Field 10 of the server.txt server configuration file and the suffix “.txt“. For example, if an eDirectory tree is named MY-COMPANY-TREE, then pre-fetch.sh searches for a .../autoyast/configs/MY-COMPANY-TREE.txt file (case-sensitive).

Location Configuration File

Configuration information defined in the customer configuration file or in the tree name configuration file can be overwritten by an optional location configuration file. You can choose any file name you want for this type of configuration file. This file is optional. If it is used, it must be specified in Field 13 of the server configuration file.

“Location” can represent a country, a city, a site, a building, a data center or a server room, or even just a LAN segment—basically anything that defines a group of servers that needs different configuration information.

Server Configuration File (server.txt)

The server configuration file defines the server-specific information for the Novell Consulting Installation Framework.

Each server configuration is represented by a single line, with its fields separated by semicolons. The current server file contains 14 fields explained in the following table:

Table 6-2 Field Descriptions for the server.txt Server Configuration File

No.

Field Name

Meaning

Example

Multivalue/Required

1

HOST_NAME

Short name of the server being installed.

machine01

No

Mandatory

2

IP_ADDRESS/CIDR

IP address and net mask of the server being installed; used as system identifier.

Net mask in CIDR notation. For example, 255.255.240.0 = 20

10.10.10.101/24

No

Mandatory

3

GATEWAY

IP address of the default gateway

10.10.10.1

No

Mandatory

4

SERVER_TYPE

Pure SLES or OES systems, including version, feature pack (FP, OES 11 only) and support pack level. An ovl at the end of the identifier denotes that the system will be installed from the combined SLES/OES installation medium.

Server types for different environments can be created by appending them with identifiers such as -DEV or -TEST.

IMPORTANT:There must always be a corresponding addon_products-$SERVER_TYPE.xml file in the ../files/addon directory, even when you are installing a pure SLES system.

sles11sp2, oes11fp0sp1, oes11fp0sp1ovl

No

Mandatory

5

DEVICE_NAME0

Name of the first system disk device.

/dev/sda, /dev/hda, /dev/vmx, /dev/cciss /c0d0

No

Mandatory

6

DEVICE_NAME1

Name of the second system disk device.

/dev/sdb, /dev/hdb, /dev/vmx, /dev/cciss /c0d1

No

Optional

7

PART_FILE

Partitioning class file. Must be located in .../files/partitioning.

The file name should identify the type and size of the device for which the partitioning has been defined. For example:

part-Xen-20GB.xml

part-cciss-146GB.xm

No

Mandatory

8

SOFT_FILE

Software class file. Must be located in. .../files/software.

The file name should identify the SERVER_ TYPE and the purpose of the server for which the software selection is valid. For example:

soft-oes11fp0sp1ovl-login.xml

soft-oes11fp0sp1ovl-NCS.xml

No

Mandatory

9

ZCM_KEY_LIST

Keys for the registration of the new device with a ZCM server. Multiple keys are possible, separated by ':'

The first key is used for registration with the ZCM server,. All other keys are used for subscribing to device groups in ZENworks Configuration Management for managing configuration and software updates.

Examples for valid ZCM keys for a production environment are:

Location:

PROD_EDIR

Config:

PROD_EDIR_GRP

Update:

PROD_OES11FP0SP1_GRP

Yes

Optional

10

TREE_NAME

eDirectory tree name.

There must be a configuration file <TREE_NAME>.txt in .../configs. The file name is case sensitive.

MyTree

No

Mandatory for OES servers

11

TREE_TYPE

Determines whether a new tree will be created or the server will join an existing tree.

existing|new

No

Mandatory for OES servers

12

SERVER_CONTEXT

Server context in LDAP syntax.

ou=servers, ou=services, o=Novell

No

Mandatory for OES servers

13

SERVER_LOCATION

Configuration file determining all aspects of the physical server location such as the following:

  • Default gateway

  • LDAP server list

  • NTP server list

There must be a configuration file <SERVER_LOCATION>.txt in .../configs. The file name is case-sensitive.

In smaller environments, all of this information can be provided in the configuration file corresponding to the tree name or in CUSTOMER.txt.

Provo.txt

Utah.cfg

DC1.info

No

Optional

14

SERVICE_TYPE

XML profile as defined in CUSTOMER.txt. The file names are case-sensitive.

The XML files referenced by the profile must exist in .../files/services/oes11 and .../files/services/sles11.

OES11FP0SP1_eDir

OES11FP0SP1_NCS

No

Mandatory

The question sometimes arises about how the installation process determines which line of the server configuration file represents the server that is being installed.

This is another task managed by pre-fetch.sh and processed within the parse_line $ (get_unique_line IP) function of the main library.

The unique key that is used to identify the correct server configuration line is the IP address of the server being installed. It is compared to the IP address part of Field 02 in the server configuration file, line by line. The first match completes the parse mechanism and the resulting line is used to configure the server.

6.2.7 XML Snippets

The files stored in the directory structure underneath .../files have been obtained by retrieving the relevant portion from an autoinst.xml file saved after a manual installation and by replacing dynamic information with placeholders.

You should carefully inspect each of these files to ensure that the various settings meet your specific requirements.

Add-On Products

Each server installed by the Novell Consulting Installation Framework requires one add-on XML file. This file must be named addon_products-$SERVER_TYPE.xml, where $SERVER_ TYPE is the value of Field 04 in server.txt.

For pure SLES systems, these files determine which patches (YUM repositories) are deployed as part of the installation process.

For OES systems, they also define the installation source for OES (single CD or combined SLES/OES DVD) as well as the OES patches included in the installation process.

These files can either use the full path to the directory where a YUM repository is stored on the installation server, or you can define additional alias directives in the Apache configuration to shorten these URLs.

Partitioning

Files in this subdirectory contain partitioning information. The sample file implements the following partitions on the first system device with a capacity of 146 GB. This could be a single device or a hardware RAID1:

Table 6-3 Partition Layout for a Server With a 146 GB Disk

Partition

Type

Volume Group

Volume

Mount Point

File System

Size (GB)

1

Linux

n/a

n/a

/boot

ext3

0.2

2

LVM

system

swap

swap

swap

4

2

LVM

system

root

/temp

ext3

5

2

LVM

system

root

/var

ext3

90

2

LVM

system

root

/

ext3

10

2

LVM

system

unused

36

More complex partition layouts can easily be developed by using this sample file as a template.

Software

The files in this subdirectory are referenced in Field 08 of server.txt and determine which patterns and packages are installed on the target system. The guideline for software selection should always be to install only what is required.

Carefully plan these files by following the concept “As many as needed, as few as possible.” You might want to define one software selection for dedicated eDirectory/Login/iManager servers and another one for cluster nodes providing print and file services accessed through AFP, CIFS, or NCP. Branch office servers providing additional services such as DHCP and DNS might require yet another software selection.

Services

The configuration of the software that has been installed is defined by the files in two directories.

Services - OES

The oes11fp0sp1_base.xml file contains all of the configuration settings that are required by each OES11 SP1 server, no matter which additional software might be installed on the system, such as the LDAP servers for the OES services, the eDirectory, SLP, and NTP configuration information, or the configuration of the LUM, NCP Server, and SMS OES services. This file needs to be part of any service type definition in CUSTOMER.txt.

The other files in this directory configure individual OES services such as AFP, NSS, or iManager. You cannot configure Novell Cluster Services as part of the initial installation. You must do this manually after you have completed your storage configuration and verified proper storage access.

Services - SLES

Currently the only configuration for a SLES service through an XML snippet is the memory reservation for the kdump kernel required to obtain kernel dumps for analysis in case of a software issue.

For SLES 11, a minimum of 128 MB is recommended for servers with up to 12 GB of RAM. However, the total amount of memory required by the kdump kernel is also dependent on the number of storage devices assigned to a server. For more information, see Novell Support TID 3374462, “Configure kernel core dump capture”.

As a consequence, a memory reservation of 128 MB might be considered a baseline for eDirectory servers and stand-alone servers with a small number of devices, but cluster nodes that have access to a larger number of devices require a higher memory reservation.

Tools

This directory currently only holds the check_errors.xml file that is part of the error checking mechanism of the pre-fetch.sh script.

6.2.8 Post-Installation Scripts

Post-installation scripts are necessary to perform installations that cannot be covered by AutoYaST. They must be specified within the <scripts> section of an AutoYaST control file.The framework uses a separate class-file (.../autoyast/xml/classes/scripts/ scripts.xml) that specifies where these scripts are retrieved from and execute. For example:

<?xml version="1.0"?>
<!DOCTYPE profile>
<profile xmlns="http://www.suse.com/1.0/yast2ns" 
xmlns:config="http:/www.suse.com/1.0/configns">
  <scripts>
    <!-- init-scripts (during the first boot of the installed system,
                       all services up and running) -->
    <init-scripts config:type="list">
      <listentry>
        <!-- Miscellaneous changes -->
        <filename>post-inst.sh</filename>
        <interpreter>shell</interpreter>
        <location>%%AY_SERVER%%/%%PREFIX%%/scripts/post-inst.sh</location>
      </listentry>
      <listentry>
        <!-- Install ZCM agent -->
        <filename>zcm-install.sh</filename>
        <interpreter>shell</interpreter>
        <location>%%AY_SERVER%%/%%PREFIX%%/scripts/zcm-install.sh</location>
      </listentry>
    </init-scripts>
  </scripts>
</profile>

The scripts are executed in the init stage as specified by the<init-scripts> tag. The initial release of the Novell Consulting Installation Framework uses two post-installation scripts:

The post-inst.sh Script

This script is used to correct or change configuration settings that have not been configured as expected by AutoYaST. It might be obsolete in future releases. Currently, it takes care of the following configuration settings:

  • Disabling IPv6

  • Removing “localhost” from the IPv6 loopback entry in /etc/hosts

  • Enabling X forwarding for SSH connections

The zcm-install.sh Script

The zcm-install.sh script is responsible for downloading the ZENworks Configuration Management agent binary from the source defined in CUSTOMER.txt, and for installing it and subscribing the new server to the ZENworks Configuration Management system by using the ZENworks Configuration Management keys specified in Field 09 of the server configuration file. This process ensures the creation of the server device object in ZENworks Configuration Management in the desired folder (using the first key specified) and the assignment to server device groups (all other keys). The latter step implements update and software assignments for this server.

As a result of the subscription process configuration, bundles from the ZENworks Configuration Management system are immediately installed on the server and the patch channels become visible after the script has been executed.