Automatic System Installations And Change Management

208
FAI Automatic System Installations And Change Management with

Transcript of Automatic System Installations And Change Management

Page 1: Automatic System Installations And Change Management

FAI

Automatic System Installations And Change Management

with

Page 2: Automatic System Installations And Change Management

Speaker

Page 3: Automatic System Installations And Change Management

Henning Sprang

Page 4: Automatic System Installations And Change Management
Page 5: Automatic System Installations And Change Management

OpenSource consultant, developer, author

Page 6: Automatic System Installations And Change Management

Interests

Page 7: Automatic System Installations And Change Management

Systems managementSoftware developmentQA and testingVirtualization

Page 8: Automatic System Installations And Change Management

FAI Team member

Page 9: Automatic System Installations And Change Management

About system installations

Page 10: Automatic System Installations And Change Management

Do You...

Page 11: Automatic System Installations And Change Management

...use FAI already?

Page 12: Automatic System Installations And Change Management

Another auto-installer or config management tool?

Page 13: Automatic System Installations And Change Management

wonder how to rebuilt/restore configurations?

Page 14: Automatic System Installations And Change Management

manually tinkered and tweaked over long time

Page 15: Automatic System Installations And Change Management

Exactly, really

Page 16: Automatic System Installations And Change Management

quick

Page 17: Automatic System Installations And Change Management

Disk images

Page 18: Automatic System Installations And Change Management

Create templates from ``proper'' installations

Page 19: Automatic System Installations And Change Management

Copy when needed and adjust them as needed

Page 20: Automatic System Installations And Change Management

Pros

Page 21: Automatic System Installations And Change Management

low learning cost

Simple and fast implementation: cp/rsync/tar/dd

Page 22: Automatic System Installations And Change Management

Cons

Page 23: Automatic System Installations And Change Management

Inflexible - the smallest change requires rebuilding the image

Still manual work needed to get a installed system

Storage cost linear to number of different configurations

Page 24: Automatic System Installations And Change Management

Configuration with shell scripts

Page 25: Automatic System Installations And Change Management

Manual work replaced by shell scripts

Page 26: Automatic System Installations And Change Management

Pros

Page 27: Automatic System Installations And Change Management

Much lower storage cost

Higher flexibility

Tailor made

Page 28: Automatic System Installations And Change Management

Cons

Page 29: Automatic System Installations And Change Management

Full-blown development project(you'll realize after a while)

You solve every problem on your own, instead of reusing work of others

Page 30: Automatic System Installations And Change Management

Use available Auto-Installer

Page 31: Automatic System Installations And Change Management

Anaconda / Kickstart: Fedora-based

Page 32: Automatic System Installations And Change Management

Autoyast: SuSE-based

Page 33: Automatic System Installations And Change Management

Nlite/Unattend:Windows in many flavours

Page 34: Automatic System Installations And Change Management

FAI:Debian-based, Fedora-based, SuSE-based,Windows experimental,Solaris possible

Page 35: Automatic System Installations And Change Management

Others:Solaris JumpstartRedHat Cobbler/Koan

Page 36: Automatic System Installations And Change Management

About FAI

Page 37: Automatic System Installations And Change Management

Why FAI?

Page 38: Automatic System Installations And Change Management

Shellscript-based

Simple, Flexible, easy to extend

Page 39: Automatic System Installations And Change Management

Community support by seasoned "`Installers"'

Page 40: Automatic System Installations And Change Management

Diverse client- and server- distributions

Page 41: Automatic System Installations And Change Management

Multiple installation typesandsystem updates

Page 42: Automatic System Installations And Change Management

Can be used for real hardware and virtualization systems

Page 43: Automatic System Installations And Change Management

One-Step-Install

bare metal to fully working system

Page 44: Automatic System Installations And Change Management

Easily integrate other tools

CFEnginePuppetCustom scripts

Page 45: Automatic System Installations And Change Management

History

Page 46: Automatic System Installations And Change Management

Started 1999 by Thomas Lange at the University of cologne

Page 47: Automatic System Installations And Change Management

Base idea: structured and planned installation

Page 48: Automatic System Installations And Change Management

Plan your installation, and FAI installs your plan

Page 49: Automatic System Installations And Change Management

Part of the Debian Distribution

Page 50: Automatic System Installations And Change Management

Today about 10 active developers, small but nice community

Page 51: Automatic System Installations And Change Management

Since 2005 softupdates from Henning Glawe included

Page 52: Automatic System Installations And Change Management

Who is using it for what?

Page 53: Automatic System Installations And Change Management

EDF uses FAI (with GOSA) for some research clusters

Page 54: Automatic System Installations And Change Management

LiMux in Munich: installs/updates 400(to be 14000) clients/servers

Page 55: Automatic System Installations And Change Management

Multiple top 500 High Performance Clusters

Page 56: Automatic System Installations And Change Management

Small home networks starting from 2 systems

Page 57: Automatic System Installations And Change Management

GRML admin live CDbuilt with FAI

Page 58: Automatic System Installations And Change Management

Functionality

Page 59: Automatic System Installations And Change Management

Overview

Page 60: Automatic System Installations And Change Management

FAI classes

Page 61: Automatic System Installations And Change Management

A class defines system properties and actions to be taken

Page 62: Automatic System Installations And Change Management

Class-assignment with simple texfile, database, or scripts

Page 63: Automatic System Installations And Change Management

Systems can be assigned to multiple classescombined at will

Page 64: Automatic System Installations And Change Management

Server-distribution:

Page 65: Automatic System Installations And Change Management

Debian-based

Dependencies:Perl, NFS, TFTP, debootstrap

So, easy to port!

Page 66: Automatic System Installations And Change Management

Target-distributions:

Page 67: Automatic System Installations And Change Management

Debian, Redhat, Ubuntu, Suse, Mandriva

Page 68: Automatic System Installations And Change Management

Different installation types (networked, CD/USB, chroot)

Page 69: Automatic System Installations And Change Management

Integrated versioning with subversion, CVS, git

Page 70: Automatic System Installations And Change Management

System updates

Page 71: Automatic System Installations And Change Management

Installation types

Page 72: Automatic System Installations And Change Management

Network installation with central install server

Page 73: Automatic System Installations And Change Management

Client/Server architecture

Page 74: Automatic System Installations And Change Management

Directly calling „dirinstall“for chroots

(Can be easy integrated into xen-tools, ganeti, ...)

Page 75: Automatic System Installations And Change Management

With grml-live: Live-CD generation!

Page 76: Automatic System Installations And Change Management

The installation/update process

Page 77: Automatic System Installations And Change Management

Most important FAI "tasks"(steps of installation)

Page 78: Automatic System Installations And Change Management

defclass: Class definition(assignment)for the target system

Page 79: Automatic System Installations And Change Management

partition: guess what?! :)

Page 80: Automatic System Installations And Change Management

extrbase: Unpack a minimal base image

Page 81: Automatic System Installations And Change Management

debconf: apply Debconf preseedings

Page 82: Automatic System Installations And Change Management

instsoft: Software package installation

Page 83: Automatic System Installations And Change Management

Configure:Run configuration scripts

Page 84: Automatic System Installations And Change Management

savelog: Push logfiles on the install Server

Page 85: Automatic System Installations And Change Management

Usage details

Page 86: Automatic System Installations And Change Management

ConsiderationsandPlanning

Page 87: Automatic System Installations And Change Management

Installation

Page 88: Automatic System Installations And Change Management

Decide the matching install type (net/cd/dirinstall)

Page 89: Automatic System Installations And Change Management

Plan your installation

Page 90: Automatic System Installations And Change Management

Use casesNetwork and environmentSoftware-packagesAdditional files and config adjustmentsAcess control, Identity Management, ...

Page 91: Automatic System Installations And Change Management

Using mirrors of Internet software repositories

Page 92: Automatic System Installations And Change Management

Updates

Page 93: Automatic System Installations And Change Management

How and when should which patches be applied?

Page 94: Automatic System Installations And Change Management

Testing processes

how do I know the effect of a patch/update?

Page 95: Automatic System Installations And Change Management

Mirrors of security update repositories?

Page 96: Automatic System Installations And Change Management

Automatic(scheduled, timebased) or manually started?

Page 97: Automatic System Installations And Change Management

Setup and configuration

Page 98: Automatic System Installations And Change Management

Installation on Debian:

apt-get install fai-quickstart

Page 99: Automatic System Installations And Change Management

Adjust install server setup in /etc/fai

Page 100: Automatic System Installations And Change Management

fai.conf: LOGUSER=fai, LOGPROTO=ssh (for Logging via ssh)

apt/sources.list: use local mirror if available

make-fai-nfsroot.conf:local mirror for debootstrap

Page 101: Automatic System Installations And Change Management

FAI server is configured!

Now create NFSroot:

fai-setup / make-fai-nfsroot

Page 102: Automatic System Installations And Change Management

For PXE-Boot:

fai-chboot

to set boot-kernel, -options

Page 103: Automatic System Installations And Change Management

Without PXE / Installation from CD:

fai-cd

Page 104: Automatic System Installations And Change Management

Infrastructure services for network install

Page 105: Automatic System Installations And Change Management

DNS entry for server and clients

Page 106: Automatic System Installations And Change Management

DHCP config:Host/IP/MAC as usual

Page 107: Automatic System Installations And Change Management

some FAI-specific stuff:

option root-path "/srv/fai/nfsroot ..."server-name "faiserver"; # boot-servernext-server 172.20.2.64; # tftp server: kernelfilename "pxelinux.0";

Page 108: Automatic System Installations And Change Management

System configurations

Page 109: Automatic System Installations And Change Management

Configurations for installation are stored in FAI „configspace“

Page 110: Automatic System Installations And Change Management

Simple text files and scripts

Page 111: Automatic System Installations And Change Management

requirements from installation plan are reflected here

Page 112: Automatic System Installations And Change Management

Example included in /usr/share/doc/fai/examples/simple

Page 113: Automatic System Installations And Change Management

Default location: /srv/fai/config

Page 114: Automatic System Installations And Change Management

Contents of configspace

Page 115: Automatic System Installations And Change Management

classdisk_configbasefilesdebconfpackage_configscriptsfileshooks

Page 116: Automatic System Installations And Change Management

Adjust configspace: class

Page 117: Automatic System Installations And Change Management

class contains class- and variable definitions/assignments

Page 118: Automatic System Installations And Change Management

Simplest way: assign classes based on hostnames

Page 119: Automatic System Installations And Change Management

Some sample classes: FAISERVER, GNOME, DEMO, XORG

Page 120: Automatic System Installations And Change Management

Any script can be used to assign classes

Page 121: Automatic System Installations And Change Management

E.G.: check specific hardware, MAC or IP, disk size, . . .

Page 122: Automatic System Installations And Change Management

Adjust configspace: basefiles

Page 123: Automatic System Installations And Change Management

Minimal base images for non-Debian distributions and special uses

Page 124: Automatic System Installations And Change Management

Task "extrbase" checks this directory for matching images

Page 125: Automatic System Installations And Change Management

Images named by classes

Page 126: Automatic System Installations And Change Management

You could also put an image here and skip the rest :)

Page 127: Automatic System Installations And Change Management

Adjust configspace: disk_config

Page 128: Automatic System Installations And Change Management

detailed control over partitions and mounting

Page 129: Automatic System Installations And Change Management

new tool includes lvm and raid setups

Page 130: Automatic System Installations And Change Management

hard sizes or ranges

Page 131: Automatic System Installations And Change Management

# example of new config file for setup-storage## <type> <mountpoint> <size> <fs type> <mount options> <misc options> disk_config disk1 disklabel:msdos primary / 250 ext3 rw,errors=remount-rological swap 200-1000 swap rw logical /var 600-1300 ext3 rw createopts="-m 5" \

tuneopts="-c 0 -i 0"logical /tmp 100-1G ext3 rw createopts="-m 0" \

tuneopts="-c 0 -i 0"logical /usr 1G-8G ext3 rwlogical /home 100-50% ext3 rw,nosuid createopts="-m 1" \

tuneopts="-c 0 -i 0"

Page 132: Automatic System Installations And Change Management

Adjustconfigspace:

debconf

Page 133: Automatic System Installations And Change Management

Presets for package install scripts

Page 134: Automatic System Installations And Change Management

Only for dpkg-based distributions

Page 135: Automatic System Installations And Change Management

Works analog to Debian Installer

Page 136: Automatic System Installations And Change Management

Adjust configspace:

package_config

Page 137: Automatic System Installations And Change Management

Contents:

files named by class names

Page 138: Automatic System Installations And Change Management

Purpose:

Define packages to be installed

Page 139: Automatic System Installations And Change Management

Supports many installation methods:

Page 140: Automatic System Installations And Change Management

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

Page 141: Automatic System Installations And Change Management

PACKAGES aptitudefortune-mod fortunesrstat-client #rstatdrusers rusersd

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

Example package_config/DEMO from simple examples:

Page 142: Automatic System Installations And Change Management

Adjust Configspace:

scripts

#!/bin/bash

#!/usr/bin/cfagent

#!/bin/perl

Page 143: Automatic System Installations And Change Management

scripts to be executed after package installation

Page 144: Automatic System Installations And Change Management

Usually shell-, Perl- and cfengine-scripts

Page 145: Automatic System Installations And Change Management

Need for others?

just install Interpreter in the NFS-Root

Page 146: Automatic System Installations And Change Management

Naming scheme: <CLASSNAME>/<NUMBER>-<SCRIPTNAME>

Page 147: Automatic System Installations And Change Management

Number defines order of execution

Page 148: Automatic System Installations And Change Management

SCRIPTNAME arbitrary just for readability

Page 149: Automatic System Installations And Change Management

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

scripts example:

Page 150: Automatic System Installations And Change Management

Adjust configspace: files

Page 151: Automatic System Installations And Change Management

Structure of a filesystem, starting with /

Page 152: Automatic System Installations And Change Management

classbased copy/unpack

Page 153: Automatic System Installations And Change Management

For usage with fcopy/ftar

Page 154: Automatic System Installations And Change Management

Copy single files explicitly, or recursive from /

Page 155: Automatic System Installations And Change Management

ftar unpacks an archive

Page 156: Automatic System Installations And Change Management

Target file=directory

Page 157: Automatic System Installations And Change Management

actually copied source file=CLASSNAME

Page 158: Automatic System Installations And Change Management

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

sample:

Page 159: Automatic System Installations And Change Management

Adjust configspace: hooks

Page 160: Automatic System Installations And Change Management

Naming scheme:

<TASKNAME>.<CLASSNAME>[.source]

Page 161: Automatic System Installations And Change Management

Execution before the according task

Page 162: Automatic System Installations And Change Management

partition.XENUinstsoft.FAIBASEsavelog.LAST.source

Examples:

Page 163: Automatic System Installations And Change Management

Do the installation

Page 164: Automatic System Installations And Change Management

Depending on chosen install type

Page 165: Automatic System Installations And Change Management

Boot via

PXEBootfloppyinstall-CDUSB Stick

Page 166: Automatic System Installations And Change Management

fai dirinstall <TARGETDIR>

into mounted blockdevice

Page 167: Automatic System Installations And Change Management

Call dirinstall from xen-tools, Ganeti, . . .

Page 168: Automatic System Installations And Change Management

Run grml-live

Page 169: Automatic System Installations And Change Management

Depending on number of packages it takes 3-30 minutes

Page 170: Automatic System Installations And Change Management

(automatic)Restart with production configuration

Page 171: Automatic System Installations And Change Management

Functionality tests

Page 172: Automatic System Installations And Change Management

Advanced stuff Outlook

Page 173: Automatic System Installations And Change Management

Support stuff for more distributions: fai-distributions

Page 174: Automatic System Installations And Change Management

GOSA as LDAP and FAI GUI

Page 175: Automatic System Installations And Change Management

Automatic Tests of the installed systems

Page 176: Automatic System Installations And Change Management

hooks/scripts could checkfiles and configurations

Crucible Test Framework

Page 177: Automatic System Installations And Change Management

No LDAP? Management-Tool/lightweight GUIwithout GOSA

Page 178: Automatic System Installations And Change Management

better configspace layout

Page 179: Automatic System Installations And Change Management

Comparison

with Puppet

Page 180: Automatic System Installations And Change Management

LIMITED VALIDITY

Page 181: Automatic System Installations And Change Management

I Only scratched Puppet's surface yet!

Page 182: Automatic System Installations And Change Management

But I try to be unbiased

Page 183: Automatic System Installations And Change Management

I actually like puppet quite well

Page 184: Automatic System Installations And Change Management

The Points

Page 185: Automatic System Installations And Change Management

Puppet has data encryption functionality!

can distribute secrets!

Page 186: Automatic System Installations And Change Management

FAI has a simplerfile copying structure

Could be „emulated“ with some code in puppet.

Page 187: Automatic System Installations And Change Management

Puppet: only "configuration"

FAI: also partition and base install

Page 188: Automatic System Installations And Change Management

FAI has multiple specific logs

Puppet logs into syslog

Page 189: Automatic System Installations And Change Management

FAI: config files + scripts

Puppet: everything is a script (most „config-filish“ - found some strange syntax skimming through)

Page 190: Automatic System Installations And Change Management

Puppet: advanced client/server config push

FAI: (scripted) ssh into amanged host, additional tool

Page 191: Automatic System Installations And Change Management

FAI is a bit more mature - no youth problems

Page 192: Automatic System Installations And Change Management

Puppet has some more advanced distribution abstractions

Page 193: Automatic System Installations And Change Management

FAI is still lacking a nice Logo and website :)

Page 194: Automatic System Installations And Change Management

BOTH:

cool toolsthat you should use!

Page 195: Automatic System Installations And Change Management

Can work together well and easy

Page 196: Automatic System Installations And Change Management

Conclusions

Page 197: Automatic System Installations And Change Management

FAI is a powerful tool for

Page 198: Automatic System Installations And Change Management

Automatic installation

Page 199: Automatic System Installations And Change Management

System-Change-Management

Page 200: Automatic System Installations And Change Management

Structuredapproachrequired

Page 201: Automatic System Installations And Change Management

Expect some learning curve on the way

Page 202: Automatic System Installations And Change Management

The Big Reward:

less worries about...

Page 203: Automatic System Installations And Change Management

getting a config cloned

setting up new machines

restoring after a crash

changing configs on multiple systems

Page 204: Automatic System Installations And Change Management

Further information:

http://www.informatik.uni-koeln.de/fai/

http://faiwiki.informatik.uni-koeln.de/

IRC-Channel #fai at OFTC-Network

linux-fai-users and linux-fai-devel mailing list

Commercial Support: multiple companies and freelancers

Page 205: Automatic System Installations And Change Management

ADVERTISEMENT:

to

learn moreor

implement

CALL ME! :)

Page 207: Automatic System Installations And Change Management

THANKS FOR LISTENING!

Page 208: Automatic System Installations And Change Management

QUESTIONS?