home *** CD-ROM | disk | FTP | other *** search
/ DOS/V Power Report 2004 March / VPR0403.ISO / talks / 147 / paper.dkb < prev    next >
Encoding:
Extensible Markup Language  |  2003-09-18  |  16.8 KB  |  498 lines

  1. <?xml version="1.0" encoding="ISO-8859-1"?>
  2.  
  3. <article id="paper-147">
  4.   <articleinfo>
  5.     <title>Automated Installation and System Configuration with AutoYaST</title>
  6.     <author>
  7.       <firstname>Anas</firstname>
  8.       <surname>Nashif</surname>
  9.     </author>
  10.     <copyright>
  11.       <year>2003</year>
  12.       <holder>Anas Nashif</holder>
  13.     </copyright>
  14.   </articleinfo>
  15.  
  16.  
  17.   <section>
  18.     <title>Introduction</title>
  19.  
  20.     <para>
  21.      AutoYaST is a system for installing one or more SuSE Linux systems
  22.       automatically and without user intervention. AutoYaST installations
  23.       are performed using  a control file with installation and configuration
  24.       data. The control file can be created using the configuration insterface
  25.       of AutoYaST and can be  provided to YaST2 during installation in
  26.       different ways.   
  27.   
  28.     </para>
  29.     </section>
  30.  
  31.    
  32.  
  33.     <section>
  34.       <title>Availability</title>
  35.       <para>
  36.     AutoYaST is available with recent  SuSE products starting
  37.     from <emphasis>SuSE Linux 8.0</emphasis> and will be available with
  38.     business products based on <emphasis>SLES 8</emphasis>.
  39.       </para>
  40.       <para>Old products prior to SuSE Linux 8.0 and business products based
  41.     on <emphasis>SLES 7</emphasis> have an auto-installation
  42.     system relying on <emphasis>YaST</emphasis>. A configuration management
  43.     system is provided by <emphasis>Alice</emphasis> for these products.
  44.       </para>
  45.   
  46.     </section>
  47.     <section>
  48.       <title>Motivation</title>
  49.       <para>
  50.     The <ulink url="http://www.linuxjournal.com/">Linux Journal</ulink>, in
  51.     an article in <ulink
  52.       url="http://www.linuxjournal.com/categories.php?op=newindex&catid=178">issue 78</ulink> writes:
  53.       </para>
  54.       <para>
  55.     <quote>
  56.       A standard Linux installation asks many questions about what to
  57.       install, what hardware to configure, how to configure the network
  58.       interface, etc. Answering these questions once is informative and maybe
  59.       even fun. But imagine a system engineer who has to set up a new Linux
  60.       network with a large number of machines. Now, the same issues need to
  61.       be addressed and the same questions answered repeatedly. This makes the
  62.       task very inefficient, not to mention a source of irritation and
  63.       boredom. Hence, a need arises to automate this parameter and option
  64.       selection.</quote>
  65.       </para>
  66.       <para>
  67.     <quote>The thought of simply copying the hard disks naturally crosses one's
  68.       mind. This can be done quickly, and all the necessary functions and
  69.       software will be copied without option selection. However, the fact is
  70.       that simple copying of hard disks causes the individual computers to
  71.       become too similar. This, in turn, creates an altogether new mission of
  72.       having to reconfigure the individual settings on each PC. For example,
  73.       IP addresses for each machine will have to be reset. If this is not
  74.       done properly, strange and inexplicable behavior results.</quote>
  75.       </para>
  76.  
  77.       <para>
  78.     Regular installation of SuSE Linux is semi-automated by default. The user is
  79.     requested to select the necessary information at the beginning of the
  80.     installation (Normally Language only) and YaST2  generates a
  81.     proposal for the underlying system depending on different factors. In
  82.     most cases, and especially for new systems, such a proposal needs not
  83.     to be changed and can be used to install the system and provides a
  84.     usable installation.
  85.       </para>
  86.       <para>
  87.     The  steps following the proposal are  fully automated and the user is only
  88.     prompted at the end of the installation to provide more information
  89.     about the system.
  90.       </para>
  91.      <para>
  92.     AutoYaST can be used where no user intervention is  required or
  93.     where customization is required. Using  a control file, YaST2
  94.     prepares the system for a custom installation and avoids any
  95.     interaction with the user, unless specified in the file controling the installation.
  96.       </para>
  97.       <para>
  98.     AutoYaST is not an automated GUI system. This means that in most
  99.     cases many screen will be skipped, i.e. you will never see the language
  100.     selection interface. AutoYaST will simply pass the language
  101.     parameter to the sub-system without displaying any language related
  102.     interface.
  103.       </para>
  104.  
  105.        </section>
  106.  
  107.     <section>
  108.       <title>Overview and Concept</title>
  109.       <para>
  110.     Using AutoYaST multiple systems sharing the same environment and
  111.     similar but not necesserily  identical hardware performing similar
  112.     tasks   can easily be installed in parallel and in a short time. A
  113.     configuration  file (referred to as "control  file") is created using
  114.     existing configuration resources. The control file can be easily
  115.     tailored for any specific environment.
  116.       </para>
  117.  
  118.  
  119.       <para>
  120.     Unlike autoinstallation systems available with older SuSE
  121.     releases, AutoYaST is fully integrated and provides various options for
  122.     installing and configuring a system. The main advantage over older
  123.     systems and other auto-installation systems is the possibility to configure a
  124.     computer  by using existing modules and avoiding using custom scripts which
  125.     are normally executed at the end of the installation.
  126.       </para>
  127.     </section>
  128.  
  129.     <section>
  130.       <title>Reasons why automated setup is needed?</title>
  131.  
  132.       <para>
  133.     Several situations can make non-interactive installations necessary:
  134.       </para>
  135.       <itemizedlist>
  136.     <listitem>
  137.       <para>
  138.         Installation of a large number of similar systems</para>
  139.       <para>
  140.         A large numer of client systems or servers for a special service, i.e. compute servers
  141.         in a high performance cluster have to be installed in a similar manner. It
  142.         would be too tedius to install every computer interactively. Automation is a
  143.         necessary tool.
  144.       </para>
  145.     </listitem>
  146.     <listitem>
  147.       <para>
  148.         Installation by less trained operators
  149.       </para>
  150.       <para>
  151.         Server layout and selection of software and configuration of the main services
  152.         is a challenging task normally done by well trained administrators and system
  153.         architects. On the other hand, time of this well paid personal is very limited
  154.         and often installations have to take place at distant locations. With the use
  155.         of automation it is possible to \textit{design} and configure certain systems
  156.         in advance and delegate the actual installation to operators in the local
  157.         subsidary, for instance.
  158.  
  159.       </para>
  160.     </listitem>
  161.  
  162.     <listitem>
  163.       <para>
  164.         Installation over a large distance
  165.       </para>
  166.       <para>
  167.  
  168.         Sometimes installation have to be made in locations without techical IT
  169.         personal or over such large distances that travel expenses are too high. In
  170.         these situations, it would be ideal if one could send a well prepared
  171.         installation CD to the location and after booting the computer with this CD
  172.         installed and a few minutes the computer is configured correctly and
  173.         reachable through network services.
  174.  
  175.       </para>
  176.     </listitem>
  177.     <listitem>
  178.       <para>
  179.         Quality assurance for important server systems
  180.       </para>
  181.       <para>
  182.  
  183.         In a productive environment, one wishes to have a consistent set of
  184.         servers who are identical in the layout and basic configuration. It is very
  185.         hard to ensure this by written installation guides, etc. Using automation this
  186.         is done by design and additionally one archives a good documentation of the
  187.         installed systems.
  188.  
  189.       </para>
  190.     </listitem>
  191.       </itemizedlist>
  192.     </section>
  193.  
  194.  
  195.  
  196.  
  197.     <section>
  198.       <title>Architecture</title>
  199.       <para>
  200.     The complete auto-installation process can be divided in three phases:
  201.     Preparation, Installation and Configuration:
  202.       </para>
  203.       <para>
  204.   <inlinemediaobject>
  205.     <imageobject>
  206.       <imagedata fileref="figure1-147.png" format="PNG"/>
  207.     </imageobject>
  208.   </inlinemediaobject>
  209.     </para>
  210.       <itemizedlist>
  211.     <listitem>
  212.       <para>
  213.         Preparation: All relevant information about the target system is collected
  214.         and turned into the appropriate directives of the control file. The control
  215.         file is transferred onto the target system where its directives will be parsed
  216.         and transformed to YaST2 conforming data.
  217.       </para>
  218.     </listitem>
  219.     <listitem>
  220.       <para>Installation: follows the instructions given in the control file and installs
  221.         a base system.</para>
  222.     </listitem>
  223.     <listitem>
  224.       <para>Configuration: YaST2 and some user-defined post-install scripts accomplish
  225.         the system configuration</para>
  226.     </listitem>
  227.       </itemizedlist>
  228.     </section>
  229.  
  230.  
  231.     <section>
  232.  
  233.       <title>
  234.     Features
  235.       </title>
  236.       <para>
  237.     AutoYaST provides a lot of new features, starting from a graphical
  238.     configuration management system to user defined postinstall options.
  239.       </para>
  240.  
  241.       <section>
  242.     <title>
  243.       Configuration management system
  244.     </title>
  245.     <para>
  246.       In order to create a control file or a certain class of control files, one can
  247.       use a YaST module.
  248.     </para>
  249.       </section>
  250.  
  251.       <section>
  252.     <title>
  253.       Installation sources
  254.     </title>
  255.     <para>
  256.       There are quite a number of different installation sources and control file
  257.       sources.
  258.  
  259.       In the simplest scenario, one can use the standard SuSE Linux Enterprise Server CDs as installation
  260.       sources and provide the control file on a DOS formatted floppy disk.
  261.  
  262.       In a more advanced situation, but without network connectivity, YaST can
  263.       create a ISO image file wich contains all packages and the control file.
  264.  
  265.       Using the network, installation can be done using NFS (Network File System).
  266.       Then the control file can be provided in different places:
  267.  
  268.     </para>
  269.     
  270.  
  271.     <itemizedlist>
  272.       <listitem><para>on a floppy disk</para></listitem>
  273.       <listitem><para>in an NFS repository</para></listitem>
  274.       <listitem><para>via HTTP, SMB or FTP</para></listitem>
  275.       <listitem><para>TFTP</para></listitem>
  276.     </itemizedlist>
  277.     <para>
  278.       Booting can be done via network (etherboot/PXE) or via CDROM.
  279.     </para>
  280.  
  281.       </section>
  282.       <section>
  283.     <title>Hardware detection</title>
  284.     <para>
  285.       During autoinstall, the same convenient hardware detection is used as for
  286.       interactive install using YaST. This is archieved through the complete
  287.       integration of AutoYaST into the installation and configuration system.
  288.     </para>
  289.       </section>
  290.  
  291.       <section>
  292.     <title>System Customization</title>
  293.     <para>
  294.       Most of the system customization is done in the second stage of the
  295.       installation. YaST provides most of the important resources needed to bring
  296.       up a system to a usable, general state. However, you may have other
  297.       requirements for the installed system. If the required customizations can't be
  298.       done using YaST resources, then the post-install scripts can be used to
  299.       accomplish this task. You can define an unlimited number of custom scripts in
  300.       the control file either by editing the control file or by using the
  301.       configuration system.
  302.     </para>
  303.       </section>
  304.     <section>
  305.       <title>Rule Based Installation</title>
  306.       
  307.       <para>
  308.     Rules offer the possibility to configure a system depending on system
  309.     attributes by merging multiple control file during installation. The
  310.     rules based installation is controlled by a rules file.
  311.       </para>
  312.       <para>
  313.   <inlinemediaobject>
  314.     <imageobject>
  315.       <imagedata fileref="figure2-147.png" format="PNG"/>
  316.     </imageobject>
  317.   </inlinemediaobject>
  318.     </para>
  319.       <para>
  320.     The rules file is an XML based file that contains
  321.     rules for each group of systems (or single systems) that you want to
  322.     automatically install. A set of rules distinguish a group of systems based on
  323.     one or more system attributes, after passing all rules, it links each
  324.     group of rules to a profile. Both the rules file and the profiles must be
  325.     located in a pre-defined and accessible location.
  326.       </para>
  327.       <para>
  328.     If more than one rule apply, the final profile for each group is generated
  329.     on the fly using a merge script. The merging process is based on the
  330.     order of the rules and later rules override configuration data in earlier rules.
  331.       </para>
  332.       <para>
  333.     The use of  a rules file is optional. If the rules file is not found,
  334.     system installation proceeds in the
  335.     classic way by just using the supplied profile or by searching for the
  336.     profile depending on the <emphasis>MAC</emphasis> or the
  337.     <emphasis>IP</emphasis> address of the system.
  338.       </para>
  339.       <para>
  340.     The following simple example illustrates how the rules file is used
  341.     to retrieve the configuration for a client with known hardware.
  342.       </para>
  343.       <programlisting>
  344. <![CDATA[
  345. <?xml version="1.0"?>
  346. <!DOCTYPE autoinstall SYSTEM "/usr/share/autoinstall/dtd/rules.dtd">
  347. <autoinstall xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns">
  348.   <rules config:type="list">
  349.     <rule>
  350.        <disksize>
  351.             <match>/dev/hdc 1000</match>
  352.             <match_type>greater</match_type>
  353.        </disksize>
  354.        <result>
  355.             <profile>machine1.xml</profile>
  356.             <continue config:type="boolean">false</continue>
  357.         </result>
  358.     </rule>
  359.     <rule>
  360.        <disksize>
  361.             <match>/dev/hda 1000</match>
  362.             <match_type>greater</match_type>
  363.        </disksize>
  364.        <result>
  365.             <profile>machine2.xml</profile>
  366.             <continue config:type="boolean">false</continue>
  367.         </result>
  368.     </rule>
  369.   </rules>
  370. </autoinstall>
  371. ]]>
  372.         </programlisting>
  373.  
  374.  
  375.     
  376.      <para>
  377.     The last example defines 2 rules and provides a different profile for
  378.     every rule. The rule used in this case is
  379.     <emphasis>disksize</emphasis>. After parsing the rules file, YaST2
  380.     attempts to match the system being installed to the rules in the
  381.     <filename>rules.xml</filename> file in order: first rule through the
  382.     last rule. A rule match occurs when the system being installed matches
  383.     all of the system attributes defined in the rule. As soon as a system
  384.     matches a rule, the result resource is added to the
  385.     stack of profiles AutoYaST will be using to create the final
  386.     profile.  The <emphasis>continue</emphasis> property tells AutoYaST if it should
  387.     continue with other rules or not.
  388.       </para>
  389.       <para>
  390.     If the first rule does not match,  next rule in the list is examined
  391.     until a match is found.
  392.       </para>
  393.       <para>
  394.     Using the <emphasis>disksize</emphasis> attribute, you can
  395.     provide different configurations for different hard drives with
  396.     different size. First rule checks if the device
  397.     <emphasis>/dev/hdc</emphasis> is available and if it is greater than 1
  398.     GB in size using the <emphasis>match</emphasis> property.
  399.       </para>
  400.  
  401.     
  402.       </section>
  403.  
  404.     </section>
  405.  
  406.   <section>
  407.     <title>The Control File</title>
  408.   <section id="Profile.Intro">
  409.     <title>
  410.       Introduction
  411.     </title>
  412.  
  413.     <para>
  414.       The control file is in most cases a  configuration description for a
  415.       single system. It consists of
  416.       sets of resources with properties including support for complex
  417.       structures representations such as lists, records,  trees and large
  418.       embedded or referenced objects.
  419.     </para>
  420.  
  421.  
  422.   </section>
  423.   <section id="Profile.Format">
  424.     <title>
  425.       Format
  426.     </title>
  427.  
  428.     <para>
  429.       The XML configuration format provides a consistent file structure, which is
  430.       easier to learn and remember when attempting to configure a new system.
  431.     </para>
  432.     <para>
  433.       Using XML, you can eliminate (nearly) all of the configuration
  434.       file parsing and error handling - an external  XML parser can do that instead
  435.       - (especially if it is a validating parser). To make sure the control file is
  436.       well-formatted and that the syntax is valid, you can run the control file
  437.       through a validating parser before it is actually used for automatic
  438.       installation. This is especially required if you prefer to edit the
  439.       profile manually.
  440.     </para>
  441.  
  442.     <para>
  443.       The following example shows a control file in XML format:
  444.     </para>
  445.  
  446.       <programlisting>
  447. <![CDATA[
  448. <?xml version="1.0"?>
  449. <!DOCTYPE profile SYSTEM
  450.  "/usr/share/autoinstall/dtd/profile.dtd">
  451.  <profile
  452.  xmlns="http://www.suse.com/1.0/yast2ns"
  453.  xmlns:cfg="http://www.suse.com/1.0/configns">
  454.  <install>
  455.    <partitioning  config:type="list">
  456.       <drive>
  457.          <device>/dev/hda</device>
  458.          <partition>
  459.             <filesystem>ext2</filesystem>
  460.             <size>520Mb</size>
  461.             <mount>/</mount>
  462.          </partition>
  463.          <partition>
  464.             <filesystem>reiser</filesystem>
  465.             <size>1200Mb</size>
  466.             <mount>/data</mount>
  467.          </partition>
  468.       </drive>
  469.    </partitioning>
  470.  </install>
  471.  <configure>
  472.    <scripts>
  473.     <pre-scripts>
  474.      <script>
  475.         <interpreter>shell</interpreter>
  476.     <filename>start.sh</filename>
  477.          <source>
  478. ]]>
  479.             <![CDATA[
  480.         #!/bin/sh
  481.         echo "Starting installation"
  482.         exit 0
  483.            ]]>
  484. <![CDATA[
  485.          </source>
  486.      </script>
  487.     </pre-scripts>
  488.    </scripts>
  489.  </configure>
  490. </profile>
  491. ]]>
  492.  
  493.       </programlisting>
  494.     
  495.  </section>
  496.  
  497.   </section>
  498. </article>