Chapter 21. Automated Installation

Contents

21.1. Simple Mass Installation
21.2. Rule-Based Autoinstallation
21.3. For More Information

AutoYaST allows you to install SUSE® Linux Enterprise on a large number of machines in parallel. The AutoYaST technology offers great flexibility to adjust deployments to heterogeneous hardware. This chapter tells you how to prepare a simple automated installation and lay out an advanced scenario involving different hardware types and installation purposes.

21.1. Simple Mass Installation

[Important]Identical Hardware

This scenario assumes you are rolling out SUSE Linux Enterprise to a set of machines with exactly the same hardware configuration.

To prepare for an AutoYaST mass installation, proceed as follows:

  1. Create an AutoYaST profile that contains the installation details needed for your deployment as described in Section 21.1.1, “Creating an AutoYaST Profile”.

  2. Determine the source of the AutoYaST profile and the parameter to pass to the installation routines as described in Section 21.1.2, “Distributing the Profile and Determining the autoyast Parameter”.

  3. Determine the source of the SUSE Linux Enterprise installation data as described in Section 21.1.3, “Providing the Installation Data”.

  4. Determine and set up the boot scenario for autoinstallation as described in Section 21.1.4, “Setting Up the Boot Scenario”.

  5. Pass the command line to the installation routines by adding the parameters manually or by creating an info file as described in Section 21.1.5, “Creating the info File”.

  6. Start the autoinstallation process as described in Section 21.1.6, “Initiating and Monitoring the Autoinstallation”.

21.1.1. Creating an AutoYaST Profile

An AutoYaST profile tells AutoYaST what to install and how to configure the installed system to get a completely ready-to-use system in the end. It can be created in several different ways:

  • Clone a fresh installation from a reference machine to a set of identical machines

  • Use the AutoYaST GUI to create and modify a profile to meet your requirements

  • Use an XML editor and create a profile from scratch

To clone a fresh reference installation, proceed as follows:

  1. Perform a normal installation.

  2. After you complete the hardware configuration and read the release notes, check Clone This System for AutoYaST, if it is not yet checked by default. This creates a ready-to-use profile as /root/autoyast.xml that can be used to create clones of this particular installation.

To use the AutoYaST GUI to create a profile from an existing system configuration and modify it to your needs, proceed as follows:

  1. As root, start YaST.

  2. Select Miscellaneous+Autoinstallation to start the graphical AutoYaST front-end.

  3. Select Tools+Create Reference Profile to prepare AutoYaST to mirror the current system configuration into an AutoYaST profile.

  4. As well as the default resources (like boot loader, partitioning, and software selection), you can add various other aspects of your system to the profile by checking the items in the list in Create a Reference Control File.

  5. Click Create to have YaST gather all the system information and write it to a new profile.

  6. To proceed, choose one of the following:

    • If the profile is complete and matches your requirements, select File+Save as and enter a filename for the profile, such as autoyast.xml.

    • Modify the reference profile by selecting the appropriate configuration aspects (such as Hardware/Printer) from the tree view to the left and clicking Configure. The respective YaST module starts but your settings are written to the AutoYaST profile instead of applied to your system. When done, select File+Save as and enter a suitable name for the profile.

  7. Leave the AutoYaST module with File+Exit.

Figure 21.1. Editing an AutoYaST Profile with the AutoYaST Front-End

Editing an AutoYaST Profile with the AutoYaST Front-End

21.1.2. Distributing the Profile and Determining the autoyast Parameter

The AutoYaST profile can be distributed in several different ways. Depending on the protocol used to distribute the profile data, different AutoYaST parameters are used to make the profile location known to the installation routines on the client. The location of the profile is passed to the installation routines by means of the boot prompt or an info file that is loaded upon boot. The following options are available:

Profile Location

Parameter

Description

File

autoyast=file://path

Makes the installation routines look for the control file in the specified path (relative to source root directory—file:///autoyast.xml if in the top directory of a CD-ROM).

Device

autoyast=device://path

Makes the installation routines look for the control file on a storage device. Only the device name is needed—/dev/sda1 is wrong, use sda1 instead.

Floppy

autoyast=floppy://path

Makes the installation routines look for the control file on a floppy in the floppy drive. This option is especially useful, if you want to boot from CD-ROM.

NFS

autoyast=nfs://server/path

Has the installation routines retrieve the control file from an NFS server.

HTTP

autoyast=http://server/path

Has the installation routines retrieve the control file from an HTTP server.

HTTPS

autoyast=https://server/path

Has the installation routines retrieve the control file from an HTTPS server.

TFTP

autoyast=tftp://server/path

Has the installation routines retrieve the control file from a TFTP server.

FTP

autoyast=ftp://server/path

Has the installation routines retrieve the control file from an FTP server.

Replace the server and path placeholders with values matching your actual setup.

AutoYaST includes a feature that allows the binding of certain profiles to the client's MAC address. Without having to alter the autoyast= parameter, you can have the same setup install several different instances using different profiles.

To use this, proceed as follows:

  1. Create separate profiles with the MAC address of the client as the filename and put them on the HTTP server that holds your AutoYaST profiles.

  2. Omit the exact path including the filename when creating the autoyast= parameter, for example:

    autoyast=tftp://192.168.1.115/
  3. Start the autoinstallation.

YaST tries to determine the location of the profile in the following way:

  1. YaST searches for the profile using its own IP address in uppercase hexadecimal, for example, 192.0.2.91 is C000025B.

  2. If this file is not found, YaST removes one hex digit and tries again. This action is repeated eight times until the file with the correct name is found.

  3. If that still fails, it tries locating a file with the MAC address of the clients as the filename. The MAC address of the example client is 0080C8F6484C.

  4. If the MAC address–named file cannot be found, YaST searches for a file named default (in lowercase). An example sequence of addresses where YaST searches for the AutoYaST profile looks as follows:

    C000025B 
    C000025 
    C00002 
    C0000 
    C000 
    C00 
    C0 
    C 
    0080C8F6484C 
    default
         

21.1.3. Providing the Installation Data

The installation data can be provided by means of the product CDs or DVDs or using a network installation source. If the product CDs are used as the installation source, physical access to the client to be installed is needed, because the boot process needs to be initiated manually and the CDs need to be changed.

To provide the installation sources over the network, set up a network installation server (HTTP, NFS, FTP) as described in Section 14.2.1, “Setting Up an Installation Server Using YaST”. Use an info file to pass the server's location to the installation routines.

21.1.4. Setting Up the Boot Scenario

The client can be booted in several different ways:

Network Boot

As with a normal remote installation, autoinstallation can be initiated with Wake on LAN and PXE, the boot image and control file can be pulled in via TFTP, and the installation sources from any network installation server.

Bootable CD-ROM

You can use the original SUSE Linux Enterprise media to boot the system for autoinstallation and pull in the control file from a network location or a floppy. Alternately, create your own custom CD-ROM holding both the installation sources and the AutoYaST profile.

The following sections provide a basic outline of the procedures for network boot or boot from CD-ROM.

21.1.4.1. Preparing for Network Boot

Network booting with Wake on LAN, PXE, and TFTP is discussed in Section 14.1.3, “Remote Installation via VNC—PXE Boot and Wake on LAN”. To make the setup introduced there work for autoinstallation, modify the featured PXE Linux configuration file (/srv/tftp/pxelinux.cfg/default) to contain the autoyast parameter pointing to the location of the AutoYaST profile. An example entry for a standard installation looks like this:

default linux 

# default label linux 
    kernel linux
    append initrd=initrd install=http://192.168.1.115/install/suse-enterprise/ 
	  
	

The same example for autoinstallation looks like this:

default linux 

# default label linux 
    kernel linux
    append initrd=initrd install=http://192.168.1.115/install/suse-enterprise/ \
           autoyast=nfs://192.168.1.110/profiles/autoyast.xml
	

Replace the example IP addresses and paths with the data used in your setup.

21.1.4.2. Preparing to Boot from CD-ROM

There are several ways in which booting from CD-ROM can come into play in AutoYaST installations. Choose from the following scenarios:

Boot from SUSE Linux Enterprise Media, Get the Profile over the Network

Use this approach if a totally network-based scenario is not possible (for example, if your hardware does not support PXE) and you have physical access to system to install during most of the process.

You need:

Boot and Install from SUSE Linux Enterprise Media, Get the Profile from a Floppy

Use this approach if an entirely network-based installation scenario would not work. It requires physical access to the system to be installed for turning on the target machine, or, in the second case, to enter the profile's location at the boot prompt. In both cases, you may also need to change media depending on the scope of installation.

You need:

  • The SUSE Linux Enterprise media

  • A floppy holding both the profile and the info file

    or

    Access to the boot prompt of the target to enter the autoyast= parameter

Boot and Install from Custom Media, Get the Profile from the Media

If you just need to install a limited number of software packages and the number of targets is relatively low, creating your own custom CD holding both the installation data and the profile itself might prove a good idea, especially if no network is available in your setup.

21.1.5. Creating the info File

The installation routines at the target need to be made aware of all the different components of the AutoYaST framework. This is done by creating a command line containing all the parameters needed to locate the AutoYaST components, installation sources, and the parameters needed to control the installation process.

Do this by manually passing these parameters at the boot prompt of the installation or by providing a file called info that is read by the installation routines (linuxrc). The former requires physical access to any client to install, which makes this approach unsuitable for large deployments. The latter enables you to provide the info file on some media that is prepared and inserted into the clients' drives prior to the autoinstallation. Alternatively, use PXE boot and include the linuxrc parameters in the pxelinux.cfg/default file as shown in Section 21.1.4.1, “Preparing for Network Boot”.

The following parameters are commonly used for linuxrc. For more information, refer to the AutoYaST package documentation under /usr/share/doc/packages/autoyast.

[Important]Separating Parameters and Values

When passing parameters to linuxrc at the boot prompt, use = to separate parameter and value. When using an info file, separate parameter and value with :.

Keyword

Value

netdevice

The network device to use for network setup (for BOOTP/DHCP requests). Only needed if several network devices are available.

hostip

When empty, the client sends a BOOTP request. Otherwise the client is configured using the specified data.

netmask

Netmask for the selected network.

gateway

Default gateway.

nameserver

Name server.

autoyast

Location of the the control file to use for the automatic installation, such as autoyast=nfs//192.168.1.110/profiles/.

install

Location of the installation source, such as install=nfs://192.168.1.110/CDs/.

vnc

If set to 1, enables VNC remote controlled installation.

vncpassword

The password for VNC.

usessh

If set to 1, enables SSH remote controlled installation.

netsetup

If set to 1, sets up the network. Normally this is done automatically, but you need to set netsetup=1 in case the installation repository is provided locally (e.g. via DVD or local iso image) and the info file is loaded from the network.

If your autoinstallation scenario involves client configuration via DHCP and a network installation source, and you want to monitor the installation process using VNC, your info would look like this:

autoyast:profile_source install:install_source vnc:1 vncpassword:some_password

If you prefer a static network setup at installation time, your info file would look like the following:

autoyast:profile_source \
install:install_source \ 
hostip:some_ip \ 
netmask:some_netmask \ 
gateway:some_gateway

The \ indicates that the line breaks have only been added for the sake of readability. All options must be entered as one continuous string.

The info data can be made available to linuxrc in various different ways:

  • As a file on a floppy or CD Rom that is in the client's drive at installation time. Add the info parameter similar to info=floppy:/info or info=cd:/info.

  • As a file in the root directory of the initial RAM disk used for booting the system provided either from custom installation media or via PXE boot.

  • As part of the AutoYaST profile. In this case, the AutoYaST file needs to be called info to enable linuxrc to parse it. An example for this approach is given below.

  • By means of an URL that points to the location of the info file. The syntax for this looks like info=http://www.example.com/info.

linuxrc looks for a string (start_linuxrc_conf) in the profile that represents the beginning of the file. If it is found, it parses the content starting from that string and finishes when the string end_linuxrc_conf is found. The options are stored in the profile as follows:

....
  <install>
....
    <init>
      <info_file>
<![CDATA[
#
# Don't remove the following line:
# start_linuxrc_conf
#
install: nfs:server/path
vnc: 1
vncpassword: test
autoyast: file:///info

# end_linuxrc_conf
# Do not remove the above comment
#
]]>

      </info_file>
    </init>
......
  </install>
....

linuxrc loads the profile containing the boot parameters instead of the traditional info file. The install: parameter points to the location of the installation sources. vnc and vncpassword indicate the use of VNC for installation monitoring. The autoyast parameter tells linuxrc to treat info as an AutoYaST profile.

21.1.6. Initiating and Monitoring the Autoinstallation

After you have provided all the infrastructure mentioned above (profile, installation source, and info file), you can go ahead and start the autoinstallation. Depending on the scenario chosen for booting and monitoring the process, physical interaction with the client may be needed:

  • If the client system boots from any kind of physical media, either product media or custom CDs, you need to insert these into the client's drives.

  • If the client is not switched on via Wake on LAN, you need to at least switch on the client machine.

  • If you have not opted for remote controlled autoinstallation, the graphical feedback from AutoYaST is sent to the client's attached monitor or, if you use a headless client, to a serial console.

To enable remote controlled autoinstallation, use the VNC or SSH parameters described in Section 21.1.5, “Creating the info File” and connect to the client from another machine as described in Section 14.5, “Monitoring the Installation Process”.

21.2. Rule-Based Autoinstallation

The following sections introduce the basic concept of rule-based installation using AutoYaST and provide an example scenario that enables you to create your own custom autoinstallation setup.

21.2.1. Understanding Rule-Based Autoinstallation

Rule-based AutoYaST installation allows you to cope with heterogeneous hardware environments:

  • Does your site contain hardware of different vendors?

  • Are the machines on your site of different hardware configuration (for example, using different devices or using different memory and disk sizes)?

  • Do you intend to install across different domains and need to distinguish between them?

What rule-based autoinstallation does is, basically, generate a custom profile to match a heterogeneous scenario by merging several profiles into one. Each rule describes one particular distinctive feature of your setup (such as disk size) and tells AutoYaST which profile to use when the rule matches. Several rules describing different features of your setup are combined in an AutoYaST rules.xml file. The rule stack is then processed and AutoYaST generates the final profile by merging the different profiles matching the AutoYaST rules into one. To illustrate this procedure, refer to Section 21.2.2, “Example Scenario for Rule-Based Autoinstallation”.

Rule-based AutoYaST offers you great flexibility in planning and executing your SUSE Linux Enterprise deployment. You can:

  • Create rules for matching any of the predefined system attributes in AutoYaST

  • Combine multiple system attributes (such as disk size and kernel architecture) into one rule by using logical operators

  • Create custom rules by running shell scripts and passing their output to the AutoYaST framework. The number of custom rules is limited to five.

[Note]

For more information about rule creation and usage with AutoYaST, refer to the package's documentation under /usr/share/doc/packages/autoyast2/html/index.html, Chapter Rules and Classes.

To prepare for a rule-based AutoYaST mass installation, proceed as follows:

  1. Create several AutoYaST profiles that contain the installation details needed for your heterogeneous setup as described in Section 21.1.1, “Creating an AutoYaST Profile”.

  2. Define rules to match the system attributes of your hardware setup as shown in Section 21.2.2, “Example Scenario for Rule-Based Autoinstallation”.

  3. Determine the source of the AutoYaST profile and the parameter to pass to the installation routines as described in Section 21.1.2, “Distributing the Profile and Determining the autoyast Parameter”.

  4. Determine the source of the SUSE Linux Enterprise installation data as described in Section 21.1.3, “Providing the Installation Data”

  5. Pass the command line to the installation routines by adding the parameters manually or by creating an info file as described in Section 21.1.5, “Creating the info File”.

  6. Determine and set up the boot scenario for autoinstallation as described in Section 21.1.4, “Setting Up the Boot Scenario”.

  7. Start the autoinstallation process as described in Section 21.1.6, “Initiating and Monitoring the Autoinstallation”.

21.2.2. Example Scenario for Rule-Based Autoinstallation

To get a basic understanding of how rules are created, think of the following example, depicted in Figure 21.2, “AutoYaST Rules”. One run of AutoYaST installs the following setup:

A Print Server

This machine just needs a minimal installation without a desktop environment and a limited set of software packages.

Workstations in the Engineering Department

These machines need a desktop environment and a broad set of development software.

Laptops in the Sales Department

These machines need a desktop environment and a limited set of specialized applications, such as office and calendaring software.

Figure 21.2. AutoYaST Rules

AutoYaST Rules

In a first step, use one of the methods outlined in Section 21.1.1, “Creating an AutoYaST Profile” to create profiles for each use case. In this example, you would create print.xml, engineering.xml, and sales.xml.

In the second step, create rules to distinguish the three hardware types from one another and to tell AutoYaST which profile to use. Use an algorithm similar to the following to set up the rules:

  1. Does the machine have an IP of 192.168.2.253? Then make it the print server.

  2. Does the machine have PCMCIA hardware and feature an Intel chipset? Then consider it an Intel laptop and install the sales department software selection.

  3. If none of the above is true, consider the machine a developer workstation and install accordingly.

Roughly sketched, this translates into a rules.xml file with the following content:

<?xml version="1.0"?>
<!DOCTYPE autoinstall SYSTEM "/usr/share/autoinstall/dtd/rules.dtd"> 
<autoinstall xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
  <rules config:type="list">
    <rule>
       <hostaddress>
	    <match>192.168.2.253</match>
            <match_type>exact</match_type>
       </hostaddress>
       <result>
            <profile>print.xml</profile>
            <continue config:type="boolean">false</continue>
        </result>
    </rule>
    <rule>
       <haspcmcia>
            <match>1</match>
            <match_type>exact</match_type>
       </haspcmcia>
       <custom1>
           <script>
if grep -i intel /proc/cpuinfo > /dev/null; then
echo -n "intel"
else
echo -n "non_intel"
fi;
           </script>
           <match>*</match>
           <match_type>exact</match_type>
       </custom1>
       <result>
            <profile>sales.xml</profile>
            <continue config:type="boolean">false</continue>
        </result>
        <operator>and</operator>
    </rule>
    <rule>
        <haspcmcia>
            <match>0</match>
            <match_type>exact</match_type>
        </haspcmcia>
 	<result>
            <profile>engineering.xml</profile>
            <continue config:type="boolean">false</continue>
        </result>
    </rule>
  </rules>
</autoinstall>

When distributing the rules file, make sure that the rules directory resides under the profiles directory, specified in the autoyast=protocol:serverip/profiles/ URL. AutoYaST looks for a rules subdirectory containing a file named rules.xml first then loads and merges the profiles specified in the rules file.

The rest of the autoinstallation procedure is carried out as usual.

21.3. For More Information

For in-depth information about the AutoYaST technology, refer to the documentation installed along with the software. It is located under /usr/share/doc/packages/autoyast2. The most recent edition of this documentation can be found at http://www.suse.de/~ug/autoyast_doc/index.html.