Presentation Structure: 1. Intro 2. Description 3. Install 4. Using It Not sure about a demo -------------------------------- 1. Intro -------------------------------- Title: System Imager Web site: http://www.systemimager.org Software Author: Brian Elliott Finley Oringinal Proj: Pterodactyl (used to patch Solaris ) Scope of Related Projects: -------------------------- System Installation Suite --------------------------- - Mother project - URL: http://sisuite.org/ - Mother project. - A collection of open source software projects designed to work together to automate the installation and configuration of networked workstations. These software projects fit around a - modular framework design - cross-platform, - Distrobution independant - scalable --> 1. SystemImager http://www.systemimager.org Automates Linux installs, software distribution, and patch deployment. 2. SystemConfigurator - URL: http://sisuite.org/systemconfig/ - A standalone programm, run after installation has finished. - Offers a consistant API for the configuration of Network Scripts, Hardware, and Bootstrapping, other configuration data, accross all Linux distributions and all architectures that Linux runs on. (RedHat, Mandrake, SuSE, Debian, Turbo Linux, Conectiva Linux, Red Flag, MSC.Linux, Caldera) PentiumItanium, PowerPC, and Alpha in version 3. SystemInstaller - URL: http://systeminstaller.sourceforge.net/ - A front end (gui and cli) to System Installation Suite - It calls System Configurator and System Imager programs. --------------------------------- 2. Description --------------------------------- What does it do: - Automated installs (clones), software distribution, patch updates. What makes it uniqe: - Relys on uncompressed "Golden Image"(s). - One netwrok install system for many types of Linux. - Non-RPM based system. How does it work: - The server can grab (via rsh) a systems image from a "golden client" on the network. - The image can be deploied to many clients over the netwrok (rsh or rsync). - System Imager uses a uncompressed "golden image" You can modify the image on the server easily, as it is uncompressed. - Updates to the image can be pushded out to the clients over the netwrok (rsh or rsync). - A modified client can be used to update the image on the server. - Clients booting from PXE can grab the boot kernel or a fresh image. *Note from John: This has been very powerful for testing new kenrels from remote. - Clients can boot from an install floppy to get a new image. Where is it used: - Internet server farms, - database server farms, ' - high performance clusters, - computer labs, - corporate desktop environments. --------------------------------- 3. Install of system imager: --------------------------------- ================= -- SERVER: -- ================= I set this up on Mandrake9.1. 1. Prerequisits: 1.1 Install a bunch of stuff urpmi -a --auto syslinux urpmi -a --auto rsync urpmi -a --auto perl-DBI urpmi -a --auto perl-Tk urpmi -a --auto perl-XML-Simple urpmi -a --auto dhcp urpmi -a bc urpmi -a --auto pxe urpmi -a --auto perl-MLDBM * if you run the 'perl -MCPAN' and are prompted for manual configuration, select no, and allow auto configure to run. 1.2 Setup ssh key authentication for joe user ssh-keygen -t rsa # hit enter all the way through (im lazy) chmod 700 ~/.ssh cd .ssh cp id_rsa.pub authorized_keys2 chmod 644 authorized_keys2 2. Install SystemImager: Directions: http://www.systemimager.org/download/ cd /tmp wget http://sisuite.org/installer.pl chmod +x installer.pl ./installer.pl --verbose --download --install server rpm -i sis-packages/systemimager-client-3.0.1-1.noarch.rpm (or ./installer.pl --verbose --download --install client) (or ./installer.pl --verbose --download --install both) *Note from John: At the end of the command, if all goes well, it will print this, but you can ignore it, as they are all installed. cd /tmp/sis-packages ./installer --install TYPE *Note from John: if something fails delete /tmp/sys-packages and re-run script after fixing the error. 3. Enable SSH Support This step creates /usr/share/systemimager/boot/i386/ssh/systemimager_ssh.tar.gz Due to export restrctions of crypto, ssh supported is not enabled in the rpm. To get around this, perform the nex to steps. 3.1 Download the systemimager-source tarball to your imageserver. cd /tmp/ wget -w http://aleron.dl.sourceforge.net/sourceforge/systemimager/systemimager-3.0.1.tar.bz2 3.2 Unpack it urpmi -a --auto bzip bzip2 -d systemimager-3.0.1.tar.bz2 tar -xvpf systemimager-3.0.1.tar cd systemimager-3.0.1 3.3 Execute the following command: gpg --keyserver wwwkeys.uk.pgp.net --recv-keys 0x86FF9C48 *Note from John: This next step failed until I installed 'bc' echo "ssh" >> FLAVOR make WITH_SSH=1 install_ssh_tarball 3.4 Add this to your apache config: (i.e. /etc/httpd/conf/httpd2.conf ) Alias /systemimager/boot/ /usr/share/systemimager/boot/ Options Indexes MultiViews AllowOverride None Order allow,deny Allow from all 3.5 Restart apache /etc/init.d/httpd restart 4. Prepare the system to accept syslogs from remote clients: 4.1 Add this to /etc/services syslog 514/udp 4.2 In LSB, modify /etc/sysconfig/syslog Change Line: SYSLOGD_OPTIONS="-m 0" To: SYSLOGD_OPTIONS="-r -s .stilen.com -x -m 0" 4.2 Restart syslog deameon /etc/init.d/syslog restart 4.3 Make sure it is running. lsof -i udp |grep sys syslogd 10964 root 27u IPv4 32810 UDP *:syslog 5. Create your dhcpd.conf file. 5.1 /usr/sbin/mkdhcpserver Welcome to the SystemImager "mkdhcpserver" command. This command will prepare this computer to be a DHCP server by creating a dhcpd.conf file for use with your ISC DHCP server (v2 or v3). If there is an existing file, it will be backed up with the .beforesystemimager extension. Continue? (y/[n]):y --- Page clears ---------------------------- Type your response or hit to accept [defaults]. If you don't have a response, such as no first or second DNS server, just hit and none will be used. What is your DHCP daemon major version number (2 or 3)? [2]: 3 Are you using the fixed-address patch (Y or N)? [n]: n Use of uninitialized value in concatenation (.) or string at /usr/sbin/mkdhcpserver line 202, line 3. What is the name of your DHCP daemon config file? []: dhcpd.conf What is your domain name? [localdomain.domain]: stilen.com What is your network number? [192.168.1.0]: 192.168.0.0 What is your netmask? [255.255.255.0]: 255.255.255.0 What is the starting IP address for your dhcp range? [192.168.1.1]: 192.168.0.100 What is the ending IP address for your dhcp range? [192.168.1.100]: 192.168.0.150 What is the IP address of your first DNS server? []: 63.195.58.123 What is the IP address of your second DNS server? []: 206.13.28.12 What is the IP address of your third DNS server? []: 4.2.2.1 What is the IP address of your default gateway? [192.168.1.254]: 192.168.0.60 What is the IP address of your image server? [192.168.1.254]: 192.168.0.224 What is the IP address of your boot server? []: 192.168.0.224 What is the IP address of your log server? []: 192.168.0.224 If your log server uses a non-standard port, enter it here: []: Will your clients be installed over SSH? (y/[n]): y What is the base URL to use for ssh installs? [http://192.168.0.224/systemimager/boot/]: What... is the air-speed velocity of an unladen swallow? []: african or eruopean? --- Page clears ---------------------------- Ahh, but seriously folks... Here are the values you have chosen: ####################################################################### ISC DHCP daemon version: 3 DHCP daemon using fixed-address patch: N ISC DHCP daemon config file: dhcpd.conf DNS domain name: stilen.com Network number: 192.168.0.0 Netmask: 255.255.255.0 Starting IP address for your DHCP range: 192.168.0.100 Ending IP address for your DHCP range: 192.168.0.150 First DNS server: 63.195.58.123 Second DNS server: 206.13.28.12 Third DNS server: 4.2.2.1 Default gateway: 192.168.0.60 Image server: 192.168.0.224 Boot server: 192.168.0.224 Log server: 192.168.0.224 Log server port: SSH files download URL: http://192.168.0.224/systemimager/boot/ ####################################################################### Are you satisfied? (y/[n]): y --- Page clears ---------------------------- The dhcp server configuration file (/etc/dhcpd.conf) file has been created for you. Please verify it for accuracy. If this file does not look satisfactory, you can run this command again to re-create it: "mkdhcpserver" WARNING!: If you have multiple physical network interfaces, be sure to edit the init script that starts dhcpd to specify the interface that is connected to your DHCP clients. Here's an example: Change "/usr/sbin/dhcpd" to "/usr/sbin/dhcpd eth1". Depending on your distribution, you may be able to set this with the "INTERFACES" variable in either "/etc/default/dhcp" or in your dhcpd initialization script (usually "/etc/init.d/dhcpd"). Also, be sure to start or restart your dhcpd daemon. This can usually be done with a command like "/etc/init.d/dhcpd restart" or similar. Would you like me to restart your DHCP server software now? (y/[n]): n --- Page clears ---------------------------- 5.1 Put config file into position cp dhcpd.conf /etc/ 5.2 Restart daemon /etc/init.d/dhcpd restart 5.3 Check to see if it loaded lsof -i udp |grep dhcp dhcpd 11514 root 6u IPv4 52351 UDP *:bootps * Note from John: I did steps 6. on the first server install, but not on this one. 6. Open up rshos for clients to connect 6.1 installed rshd server rpm 6.2 added + to /etc/hosts.equiv 6.3 added all stilen.com names to /etc/hosts.allow 7. Add Daemons to the startup 7.1 System Imager chkconfig --add systemimager /etc/init.d/systemimager start 7.2 DHCPD to the startup chkconfig --add dhcpd /etc/init.d/dhcpd start ======================== -- GOLDEN CLIENT: -- ======================== 1. Prerequisits: urpmi -a --auto syslinux urpmi -a --auto rsync urpmi -a --auto perl-DBI urpmi -a --auto perl-Tk urpmi -a --auto perl-XML-Simple urpmi -a --auto wget 2. Install SystemImager: Directions: http://www.systemimager.org/download/ cd /tmp wget http://sisuite.org/installer.pl chmod +x installer.pl ./installer.pl --verbose --download --install client 3. Run the perepare client script -Reads partition information, -Stores it in /etc/systemimager/mounted_filesystems -Creates /tmp/rsync.conf -Starts rsyncd using the config file. * Note from John: For SuSE8.2 I had to copy the mandrake version of sfdisk to the SuSE golden client in order to get the prepareclient to work. Mandrake uses util-linux-2.11x-4tex, and SuSE uses util-linux-2.11z-25. Go figure. :) 3.1 /usr/sbin/prepareclient Welcome to the SystemImager prepareclient command. This command may modify the following files to prepare your golden client for having its image retrieved by the imageserver. It will also create the /etc/systemimager directory and fill it with information about your golden client. All modified files will be backed up with the .before_systemimager-3.0.1 extension. /etc/services: This file defines the port numbers used by certain software on your system. I will add appropriate entries for rsync if necessary. /etc/inetd.conf: This is the configuration file for the inet daemon, which starts up certain server software when the associated client software connects to your machine. SystemImager needs to run rsync as a standalone daemon on your golden client until it's image is retrieved by your image server. I will comment out the rsync entry in this file if it exists. The rsync daemon will not be restarted when this machine is rebooted. /tmp/rsyncd.conf.1416: This is a temporary configuration file that rsync needs on your golden client in order to make your filesystem available to your image server. See "prepareclient -help" for command line options. Continue? (y/[n]): Y --- Page clears ---------------------------- *********************************** WARNING *********************************** This utility starts an rsync daemon that makes all of your files accessible by anyone who can connect to the rsync port of this machine. This is the case until you reboot, or kill the 'rsync --daemon' process by hand. By default, once you use getimage to retrieve this image on your image server, these contents will become accessible to anyone who can connect to the rsync port on your imageserver. See rsyncd.conf(5) for details on restricting access to these files on the imageserver. See the systemimager-ssh package for a more secure method of making images available to clients. *********************************** WARNING *********************************** Continue? (y/[n]): Y --- Page clears ---------------------------- Using "sfdisk" to gather information about /dev/hda... Using "sfdisk" to gather information about /dev/hdb... done! Starting or re-starting rsync as a daemon.....done! This client is ready to have its image retrieved. You must now run the "getimage" command on your imageserver. updateclient -autoinstall -server 192.168.0.224 > -configure-from eth0 ======================== -- GET IMAGE: -- ======================== 1. From the SystemImager Server, run getimage -Connects to the golden client, -gets /etc/systemimager/mounted_filesystems, -creates an excluson list for unsupported filesystems. (supported filesystems: ext2, ext3, reiserfs) -rsync over the entire system image (excluding unsupported filesystems) -Image is stored on /var/lib/systemimager/images/ -Creates autoinstall master script in /var/lib/systemimager/scripts/.master 1.1 getimage -golden-client 192.168.0.150 -image suse8.2_minimum -ssh-user root This program will get the "suse8.2_minimum" system image from "192.168.0.150" making the assumption that all filesystems considered part of the system image are using ext2, ext3, jfs, FAT, reiserfs, or xfs. This program will not get /proc, NFS, or other filesystems not mentioned above. *********************************** WARNING *********************************** All files retrieved from a golden client are, by default, made accessible to anyone who can connect to the rsync port of this machine. See rsyncd.conf(5) for details on restricting access to these files on the imageserver. See the systemimager-ssh package for a more secure (but less effecient) method of making images available to clients. *********************************** WARNING *********************************** See "getimage -help" for command line options. Continue? ([y]/n): y root@192.168.0.150's password: wrote 348396 bytes read 427266670 bytes 345826.98 bytes/sec total size is 425694030 speedup is 1.00 ------------- suse8.2_minimum IMAGE RETRIEVAL FINISHED ------------- Press to continue... --- Page clears ---------------------------- IP Address Assignment --------------------- There are four ways to assign IP addresses to the client systems on an ongoing basis: 1) DHCP ---------------------------------------------------------------- A DHCP server will assign IP addresses to clients installed with this image. They may be assigned a different address each time. If you want to use DHCP, but must ensure that your clients receive the same IP address each time, see "man mkdhcpstatic". 2) STATIC ---------------------------------------------------------------- The IP address the client uses during autoinstall will be permanently assigned to that client. 3) REPLICANT ---------------------------------------------------------------- Don't mess with the network settings in this image. I'm using it as a backup and quick restore mechanism for a single machine. Which method do you prefer? [1]: You have chosen method 1 for assigning IP addresses. Are you satisfied? ([y]/n): y Would you like to run the "addclients" utility now? (y/[n]): ======================== -- ADD CLIENT: -- ======================== - Asks about names of hosts that will try to get an image from this server - Creates a soft link from the '.master' to the host name. Link created in /var/lib/systemimager/scripts/ - Updates /etc/hosts, and coppies it to /var/lib/systemimager/scripts/ Welcome to the SystemImager "addclients" utility -------------------------------------------------------------------------------- This utility has 3 sections. "Section 1" will ask you for your hostname information. "Section 2" will allow you to create softlinks from each client hostname to your "master" script in the "/var/lib/systemimager/scripts" directory. Example: www297.sh -> web_server_image_v1.master "Section 3" will ask you for IP address information that will be combined with the hostname information provided in Section 1 to create entries in "/etc/hosts" for each of these same clients. New entries will be appended to the end of "/etc/hosts". If you specify new hostnames for existing IP addresses, those entries will be re-written in place to reflect the new host names. Continue? ([y]/n): y --- Page clears ---------------------------- addclients -- Section 1 (hostname information) -------------------------------------------------------------------------------- The next series of questions will be used to create a range of hostnames. You will be asked for your domain name, the base host name, a beginning number, and an ending number. For example, if you answer: domain name = systemimager.org base host name = www starting number = 7 ending number = 11 Then the result will be a series of hostnames that looks like this: www7.systemimager.org www8.systemimager.org www9.systemimager.org www10.systemimager.org www11.systemimager.org What is your domain name? []: stilen.com What is the base host name that you want me to use? [-domainname]: suse_workstation What number should I begin with? []: 1 What number should I end with? []: 10 I will work with hostnames: suse_workstation1 through suse_workstation10 in the domain: stilen.com Are you satisfied? (y/[n]): y --- Page clears ---------------------------- addclients -- Section 2 (soft links to master script) -------------------------------------------------------------------------------- Would you like me to create soft links to a "master" script so that hosts: suse_workstation1 through suse_workstation10 can be autoinstalled with that image? ([y]/n): y Here is a list of available autoinstall scripts: suse8.2_minimum Which script would you like these hosts to be installed with? [suse8.2_minimum]: suse8.2_minimum Your soft links have been created. Press to continue... --- Page clears ---------------------------- addclients -- Section 3 (adding or modifying /etc/hosts entries) -------------------------------------------------------------------------------- Your target machines need to be able to determine their host names from their IP addresses, unless their host name is specified in a local.cfg file. The preferred method for doing this is with DNS. If you have a working DNS that has IP address to hostname resolution properly configured for your target machines, then answer "n" here. If you don't have a working DNS, or you want to override the information in DNS, then answer "y" here to add entries to the "/etc/hosts" file on your image server. After adding these entries, the /etc/hosts file will be copied to "/var/lib/systemimager/scripts" where it can be retrieved by your target machines. I will ask you for your clients' IP addresses one subnet at a time. Would you like me to continue? (y/[n]):y --- Page clears ---------------------------- addclients -- Section 3 (adding or modifying /etc/hosts entries -- continued...) -------------------------------------------------------------------------------- subnet 1 The first host in subnet 1 will be: suse_workstation1 What is the starting IP address for subnet 1? []: 192.168.0.100 What is the ending IP address? []: 192.168.0.150 I will work with IP addresses: 192.168.0.100 through 192.168.0.150 Are you satisfied? (y/[n]): These entries have been added to /etc/hosts. Press to continue... 5. Now you have an image in /var/lib/systemimager/images ls -alF /var/lib/systemimager/images total 28 drwxr-xr-x 3 root root 4096 Jun 6 17:28 ./ drwxr-xr-x 5 root root 4096 Jun 4 15:26 ../ -rw-r--r-- 1 root root 744 Mar 30 14:45 ACHTUNG -rw-r--r-- 1 root root 702 Mar 30 14:45 CUIDADO -rw-r--r-- 1 root root 617 Mar 30 14:45 DO_NOT_TOUCH_THESE_DIRECTORIES -rw-r--r-- 1 root root 617 Mar 30 14:45 README drwxr-xr-x 18 root root 4096 Jun 6 09:21 suse8.2_minimum/ =========================== -- NEW-INSTALL CLIENT: -- =========================== * 3 Methods: FLOPPY, CDROM, HARDDRIVE, PXE 1.1 By hand, create a file in / named local.cfg containing these lines: BROADCAST=192.168.0.255 DEVICE=eth0 DOMAINNAME=stilen.com GATEWAY=192.168.0.60 GATEWAYDEV=eth0 HOSTNAME=my_image10 IMAGESERVER=192.168.0.224 # Minimum IMAGENAME=my_image # Minimum IPADDR=192.168.0.110 NETMASK=255.255.255.0 NETWORK=192.168.0.0 SSH_USER=jstile 1.2 Put amkautoinstalldiskette floppy in the drive. 1.3 Run mkautoinstalldiskette mkautoinstalldiskette \ -floppy /dev/fd0 \ -flavor ssh \ -ssh-key /home/jstile/.ssh/id_rsa \ -append ttyS1 \ -config /home/jstile/local.cfg Here is a list of available flavors: standard Which flavor would you like to use? [standard]: standard --- Page clears ---------------------------- This program assumes that you have a 1.44MB floppy drive and that it is /dev/fd0. You can use the -floppy command line option to change this value. If you do use -floppy, this command will run non-interactively!!! Use the -help option to see all options. Insert your floppy diskette now. This will overwrite all information on your diskette. Continue? (y/[n]): y Formatting floppy as 1.44MB ... Double-sided, 80 tracks, 18 sec/track. Total capacity 1440 kB. Formatting ... done Verifying ... done Creating DOS filesystem on floppy... mkdosfs 2.8 (28 Feb 2001) Using "syslinux" to make floppy bootable... Creating temporary mount point... Mounting floppy... Couldn't copy /usr/share/systemimager/boot/i386/standard/initrd.img to /tmp/.autoinstalldiskette.11729! 1.4 Run mkautoinstallcd mkautoinstallcd 1.5 Boot from the hard drive updateclient -autoinstall -server 192.168.0.224 -configure-from eth0 * Note from John: To test the disk, boot off it. from the boot prompt, this would list all the anonymous rsync modules available on the host 192.168.0.224 # rsync 192.168.0.224:: boot overrides scripts