automatic installation and system updates with fai ... · automatic installation and system updates...

39
About systems installation About FAI Functions Usage of FAI Outlook Automatic Installation and System Updates with FAI Overview, Functionality, Possibilities Henning Sprang Silpion IT Solutions GmbH/ Linux Solution Park GmbH 2008-07-3 Henning Sprang Automatic Installation and System Updates with FAI

Upload: trancong

Post on 28-Apr-2018

219 views

Category:

Documents


0 download

TRANSCRIPT

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Automatic Installation and System Updates withFAI

Overview, Functionality, Possibilities

Henning Sprang

Silpion IT Solutions GmbH/ Linux Solution Park GmbH

2008-07-3

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

The speaker - Henning Sprang

FAI team memberSoftware developer, author, admin, consultantInterests: Virtualization, systems management, Java, Web, QAFree Software enthusiast since first contact - about 1996

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Overview

1 About systems installation

2 About FAI

3 Functions

4 Usage of FAI

5 Outlook

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Disk imagesInstallation with shell scriptsUsage of available auto-installers

Some Questions. . .

What do you do. . .When your main server did explode?When a developer needs a new test system?

With EXACTLY the same config as the production system!When you bought yourself a new laptop?When you have to change Apache settings on a web cluster?

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Disk imagesInstallation with shell scriptsUsage of available auto-installers

About system installation - Needs

Need to recover system after a crashNeed to reproduce systems exactly for testingNeed to install multiple systems, fastAnd after install: you need to manage changes!

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Disk imagesInstallation with shell scriptsUsage of available auto-installers

About system installation - how?

Manual installation has some some downsides:Unreproducable - Humans make errorsUnefficient - install many systems takes a long time

Solution: AutomationSide effect: System setup is documented in code/config

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Disk imagesInstallation with shell scriptsUsage of available auto-installers

disk images

.img?Create templates from “proper” installationsCopy when needed and adjust them as neededPros:

Low learning costSimple and fast implementation – cp/rsync/tar, README

Cons:Inflexible - the smallest change requires rebuilding the imageStill manual work needed to get a installed systemStorage cost linear to number of different configurations

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Disk imagesInstallation with shell scriptsUsage of available auto-installers

Installation with shell scripts

#!/bin/bashManual work replaced by shell scriptsPros:

Much lower storage cost than imagesHigher flexibilityTailor made

Cons:Full-blown development project (you’ll realize after a while)You solve every problem on your own, instead of reusing workof others

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Disk imagesInstallation with shell scriptsUsage of available auto-installers

Usage of available auto-installers

Solutions are available. . .

The most important projects and target distributions:Anaconda und Kickstart: Fedora-basedAutoyast: SuSE-basedNlite/Unattend: Windows in many flavoursFAI: Debian-based, Fedora-based, SuSE-based, Mandriva,Windows, SolarisOthers: Solaris Jumpstart, RedHat Cobbler/Koan

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Why FAIHistoryWho is using it for what?

Why FAI?

Flexible and easy to extendSimple, powerful architecture – “everything is a shell script”Open development modelCommunity support seasoned „Installers“Diverse client- and server- distributionsMultiple installation types and system updateCan be used for real hardware and virtualization systems

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Why FAIHistoryWho is using it for what?

History

Started 1999 by Thomas Lange at the University of cologneBase idea: structured and planned installation„Plan your installation, and FAI installs your plan“Part of the Debian DistributionToday about 10 active developers, small but nice communitySince 2005 softupdates from Henning Glawe included

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Why FAIHistoryWho is using it for what?

Who is using it for what?

EDF uses FAI (with GOSA) for some research clustersLiMux in Munich: installs/updates 400(to be 14000)clients/serversMultiple top 500 High Performance ClustersSmall home networks starting from 3 systemsGRML admin live CD built with FAI

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

OverviewInstallation typesThe installation/update process

Overview I

FAI classesA class defines system properties and actions to be takenClass-assignment with simple texfile, database, or scriptsSystems can be assigned to multiple classes, combined at will

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

OverviewInstallation typesThe installation/update process

Overview II

Server-distribution: Debian-based (Dependencies Perl, NFS,TFTP, debootstrap - easy to port)Target-distributions: Redhat, Debian, Ubuntu, SuSE,Mandriva, Fedora, WindowsDifferent installation types (networked, CD/USB, chroot)Integrated versioning with subversion, CVS, gitSoftupdate for updates

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

OverviewInstallation typesThe installation/update process

Installation types

Network installation with central install serverClient/Server architecture

Directly calling dirinstall for chrootsdirinstall for chroots and virtualization - xen-tools, ganeti)fai-cd / fai-usb (environments without network)With grml-live: Live-CD generation!

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

OverviewInstallation typesThe installation/update process

The most important FAI tasks/steps of installation:defclass: Class definition of the target systempartition: Partitioningextrbase: Unpack a minimal base imagedebconf: read and apply Debconf preseedingsinstsoft: Software package installationconfigure: Run configuration scriptssavelog: Push logfiles onto the install Server

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Considerations – installation

Decide the matching install type (net/cd/dirinstall)Plan your installation

Use casesNetwork and environmentSoftware-packagesAdditional files and config adjustments

Using mirrors of Internet software repositories

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Considerations - Updates

How and when should which patches be applied?Testing processes - where do I know from, which effect apatch/update has?Mirrors of security update repositories?Automatic(regular, timebased) or manual updates?

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

FAI setup and configuration I

Installation on Debian:apt-get install fai-quickstart

Adjust install server setup in /etc/fai:fai.conf: LOGUSER=fai, LOGPROTO=ssh for Logging via sshapt/sources.list: use local mirror if available

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

FAI setup and configuration II

FAI server is configured - create NFSroot:fai-setup

For PXE-Boot: fai-chboot to set boot-kernel and optionsWithout PXE: make-fai-bootfloppyInstallation from CD: fai-cd

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Setup infrastructure services

For network install:DNS entry for server and clientsDHCP config - Host/IP/MAC as usualFAI-specific:authoritative; # wegen IP_PNP_DHCPoption root-path "/usr/lib/fai/nfsroot ..."server-name "faiserver"; # boot-servernext-server 172.20.2.64; # tftp server fuer kernelfilename "pxelinux.0";

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Create System configurations

Configurations for installation are stored in FAI configspaceSimple text files and scriptsThe requirements from the installation plan are reflected hereExample included in /usr/share/doc/fai/examples/simpleDefault location: /srv/fai/config

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

The FAI configspace

Contents of configspace:basefilesclassdebconfdisk_configfileshookspackage_configscripts

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace - class

class contains class- and variable definitions.Simplest way: assign classes based on hostnamesSome sample classes: FAISERVER, GNOME, DEMO, XORGAny script can be used to assign classesE.G.: check specific hardware, MAC or IP, disk size, . . .

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace – basefiles

Contains minimal base images for special uses or non-DebiandistributionsAt the start of the install, this directory is checked for imagesfor defined classesYou could also put an image here and skip the rest :)

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace – disk_config

Define harddisk configuration and mount points as needed#<type> <mountpoint> <size mb> [mount options][;extra options]

disk_config disk1primary / 150-300 rw,errors=remount-ro ; -c -j ext3logical swap 40-500 rwlogical /var 90-1000 rw ; -m 5 -j ext3logical /tmp 50-1000 rw ; -m 0 -j ext3logical /usr 200-4000 rw ; -j ext3logical /home 50- rw,nosuid ; -m 1 -j ext3# logical /home preserve9 rw,nosuid ; -m 1 -j ext3

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace - debconf

Presets for package install scriptsOnly for dpkg-based distributionsWorks analog to Debian Installer

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace - package_config

Contents: files named by class namesPurpose: Define packages to be installedSupports many installation methods:

install (apt-get)aptitudetaskinst (Debian tasks=Package collections)urpmi (mandriva)yumi (Fedora)y2i (SuSE y2pmsh)yast (SuSE yast -i)Some more special ones. . .

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace - package_config II

Example package_config/DEMO from simple examples:PACKAGES aptitudefortune-mod fortunesrstat-client #rstatdrusers rusersd

# only when also class XORG is definedPACKAGES aptitude XORGbb frozen-bubble xpenguins

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust Configspace - scripts

scripts contains scripts to be executed after packageinstallationUsually shell-, Perl- and cfengine-scriptsNeed for others: just install Interpreter in the NFS-RootNaming scheme:<CLASSNAME>/<NUMBER>-<SCRIPTNAME>Number defines order of executionSCRIPTNAME arbitrary just for readability

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

scripts example:.|-- AMD64| ‘-- 99-discover-bug|-- DEMO| |-- 10-misc| ‘-- 30-demo|-- FAIBASE| |-- 10-misc| |-- 20-removable_media| |-- 30-interface| ‘-- 40-misc|-- FAISERVER| |-- 10-conffiles| ‘-- 20-copy-mirror|-- GRUB| ‘-- 10-setup‘-- LAST‘-- 50-misc

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace - files

Structure of a filesystem, starting with /For usage with fcopy/ftar = classbases copy/unpackCopy single files explicitly, or recursive from / in a DEFAULTscript

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace - files II

Target file=directoryactually copied source file=CLASSNAME

.‘-- etc|-- X11| ‘-- xorg.conf| |-- ATI| ‘-- NVIDIA|-- apache2| ‘-- conf.d| ‘-- debian-mirror.conf| ‘--FAISERVER‘-- fai

‘-- fai.conf|-- FAISERVER‘-- FAI_SOFTUPDATE_CLIENT

...Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Adjust configspace - hooks

Hook naming scheme: .<CLASSNAME>[.source]Execution before the according taskOptional skip_task: The actual task will not be executed, forexample for skipping partitioning of Xen DomainsExample:partition.XENUinstsoft.FAIBASEsavelog.LAST.source

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Do the Installation

Depending on chosen install type:Boot via PXE/Bootfloppy/install-CD/USB Stick

PXE-config can be set with fai-chbootStart Xen VM with xm create vm-name.cfg install=1fai dirinstall <TARGETDIR> into mounted blockdeviceCall dirinstall in xen-tools, Ganeti, . . .Start system with fai-cd/fai-usbRun grml-live

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

ConsiderationsFAI setup and configurationSetup infrastructure servicesCreate System configurationsDo the InstallationRun System

Run System

Depending on number of packages system is installed in 3-30minutes (Server/Desktop)Restart with production configurationFunctionality tests

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Outlook

Support stuff for more distributions: fai-distributionsGOSA as LDAP and FAI GUIAutomatic Tests of the installed systems:

hooks/scripts could check files and configurationsCrucible Test Framework

No LDAP? Management-Tool/lightweight GUI without GOSA

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Further informations

WWW:http://www.informatik.uni-koeln.de/fai/http://faiwiki.informatik.uni-koeln.de/http://www.infrastructures.org/

Email and Chat:IRC-Channel #fai at OFTC-Networklinux-fai-users and linux-fai-devel mailing list

Henning Sprang Automatic Installation and System Updates with FAI

About systems installationAbout FAIFunctions

Usage of FAIOutlook

Questions?

Questions?

Henning Sprang Automatic Installation and System Updates with FAI