Automated installations /kickstarts Objectives Creating automated installations Contents Auto install variants AutoYast XML file configuration autoinst.xml Server Configuration Auto install with SuSE CD1 Making your own Autoyast Boot CD Booting with Autoyast boot CD Practicals Perform one kickstart installation Summary This chapter show howto make totally unattended installation’s, well almost unattended. There are several ways of doing mass deployment of unix servers and workstations.
Autoinstall variants There are several ways to perform unattended installations: DISK IMAGE DISK IMAGE + CONFIG CD + XML CD + FLOPPY +XML Full PXE boot FLOPPY + XML + NET CD + XML + NET CD + NET FLASH stick + XML + NET and many more…. You can use almost any protocol: ftp, nfs, http, ssh, smb and tftp. Most popular is CD + XML + NET and CD + NET This demands only the install server sharing files and autoyast plus possible SLP and DHCP server This is used in small to medium size companies and organizations Next most popular is Full PXE boot This demand all of the above plus tftp boot server, which is many step to setup This is used in enterprice larger companies and organizations The variant of CD + XML on floppy Is nice to have for single setups, special servers and clients. Post RSYNC configuration Used in enterprice and other system after installation is performed to add special configuration and install appz. Disk images is basically created with dd disk dump or cpio. They are crude, the simply run over the destination disk with original image content. All clients must basically have the same configuration. The CD above is SuSE standard boot CD1 or a modified SuSE boot CD. PXE boots directly over the network, without any local boot media, althought it needs lot of setup work plus trial and errors. PXE must be supported on your plateform in either BIOS or BOOTROM on your NIC.
AutoYAST toolkit AutoYast can be used to make install configuration data. AutoYast is used to inform the installing client where to get the configuration data, as kernel argument at boot. Autoyast fileformat is plain XML (Extended Markup Language) defult placeholder is /var/lib/autoinstall/repository You can edit the .xml directly with texteditor of your choise Autoyast can import RedHat kickstart .ks files and other kickstarts. (anaconda.ks) Choose to open file and import Once you have created the kickstart configuration file you can copy it to: A directory on the install server A boot diskette or CD/DVD A regular Linux diskette # yast autoyast Boot Options: autoyast=nfs://server.net05.se/xml-install/autoinst.xml Autoyast look like the standard installation dialogue, but differs slightly. It is possible to make very complicated setups and into the deep configuration. SuSE professional workstation series is not intended to do more complicated Auto installations, most info you will find belong to SuSE Enterprice series. Autoyast takes some time to learn, you can find more information on autoyast here: http://www.suse.de/~nashif/autoinstallation/9.0/html/ and here: Unattended installations are usally called kickstart installations. XML is widely used in HTML-world and other situations to transport information like variables, forms, config-data, authentication and much other.
AutoYAST settings for clients Autoyast will try to probe and install proper modules as well as solve dependencies. All unconfigured modules will recieve standard settings. There are however sections that need some information: 1. Software Package selection This set the system mandatory standards 2. Hardware Partitioning At least one device like /dev/hda or /dev/sda 3. System general options Language, Keyboard, TZ, Mouse Confirm installation ? = NO Start System without Reboot = YES 4. System services default runlevel (depend on step 1) 5. Network devices at least dhcp (if not set, device will be disabled after install) 6. Security and User you need at least local root and one local user # yast autoyast This is the most difficult task, you must first make one setup and then test it to see if it works and do nessesary modifications if it fails. Most common problems are related to step 2 and 5. Also it is known to arrive problems from bootmanagers. If using the settings above, the client harddisk will be totally wiped out and system installed on new. Setups can be very complicated and detalied, althought the SuSE Professional series does not offer the full flagship interface for autoinstallations.
The autoyast XML file name conventions After doing your configuration it is time to save the settings, the result will be an XML file As standard this file does not have any name, you have to give it an proper name: If you use a filename like: my-host.xml then you must give exact path as kernel argument at boot: autoyast=ftp://server.com/inst-conf/my-host.xml If you give kernel argument autoyast=default and the file autoinst.xml then autoyast will try to find this file here: local client floppy (you can copy it to a floppy) installation root (usally the local CD-rom) initial ram disk (loaded from initrd) If you give the path to the XML file only, then autoyast will search for a file with name = IP address of client in hexadecimal form. Using the command gethostip you can get the hex representation of filename: If this is not found, autoyast will try with same name exept one digit less: And continue removing digits until it is found, if not it will then try the MAC address of client and lastly it tries the name default autoyast=ftp://server.com/inst-conf/ Using different xml filenames, you can control which client is using what configuration and have a pool of various client and server xml-file settings to deploy when needed. You can pinpoint exactly which config file you want to use or let the system choose one for you automatically by using the simple rules above. Note that it is also possible to program in XML, it can make use of conditions and loops, with a little help, almost like shellscripts. In the Network class we will see howto deploy configuration and settings plus applications in a much more open and common way using RDIST. But it is still nessesary to have a way of deploying mandatory installations. And Autoyast is one of them only. # gethostip 192.168.1.55 192.168.1.55 192.168.1.55 C0A80137 C0A8013 C0A80 C0A C0A801 C0A8 C 005022E3A7DC C0
Copying The XML File To A Floppy The file should have the name ”autoinst.xml" or names like previous page Should be placed in the top directory of the diskette. As most floppyes are in MSDOS format you will have to use the "mcopy" command to copy the file: The kickstart process will fail to read your configuration file if you just use the regular "cp" command. Copying the file to a Regular Linux diskette Now you can boot on your SuSE CD1 and have the floppy inserted. Autoyast will read the autoinst.xml on the floppy and use that configuration data. # mcopy autoinst.xml a:autoinst.xml Note that SuSE bootfloppies are not directly writable! This above is intended for a supplemental floppy at the client booted from standard SuSE CD1 och CD2. You can offcourse add the autoinst.xml to the boot cd, then type autoyast=default at the boot prompt as kernel argument before you hit enter. This way you can deploy preconfigured systems with CD’s Exercise, try to make SuSE installation CD + XML on floppy with floppy, if your PC does not have floppy, you must wait. Allways check that you have something on your floppy before starting any installation: Type: mdir a: # cp autoinst.xml /media/floppy/autoinst.xml
Copying the XML To Your Kickstart Server No when we have ”kickstart” files ready, we need to setup the server! Any of these servers will do: NFS, FTP, HTTP, SSH, SMB, TFTP Whether you are using NFS, HTTP or FTP for your network installation it is best to place your XML files in a directory beside the installation source directory. Common SuSE source: /export/network-install/SuSE/9.3 Or /export/network-install/SuSE/ Remember that autoyast will look for filenames described on previous pages. XML files does not nessesary need to rest on installation server You find a sample XML file here: http://student.ing-steen.se/unix/unix-sysadmin/autoinst.xml If you want to use it, you will either have to open it with yast autoyast or with some texteditor to correct NIC settings and others. It is a very basic minimal installation without X that will be performed running this XML. It is also a good starting point of making your own XML.
Booting With Your Kickstart Files This method is not fully automatic, but very practial Allways use this methode to develop your XML files before making it fully automatic It will save you lot of time searching for possible errors Practical when doing sample installations, only little to enter Boot from your boot device, the standard SuSE CD1. When boot is done, the regular bootmenu is presented choose INSTALL You can enter any kernel parameters as Boot Options install= Where are the sources ? Allways Protocol://path/to/files Review SLP autoyast= Where are the XML kickstart files ? Review autoyast=default Allways Protocol://path/to/files Boot Options: install=nfs://server.net05.se/exports/network-install/SuSE/9.3/CD1 autoyast=nfs:// server.net05.se/exports/network-install/SuSE/9.3/autoinst.xml Above we have one install server, with the setup from previous chapter 15. We have copied over the autoinst.xml files to proper directories. Protocol can be one of these: File:// The local boot CD standard is instmod=cd if you do not type anything. floppy:// nfs:// http:// tftp:// ftp:// If the installation is broken with an error, you have to look in the terminals for hints and the server logfiles: On Client CTRL + ALT + F1 through F4, F7 brings back the install screen if X is activated. On server: tail /var/log/messages or /var/log/apache2 if using http protocol Common errors are wrong install path or wrong autoyast path. Also name lookup is a common error and wrong XML filename. When the installation is running, it can be ”impossible configurations” or fully wrong XML file for that client. Common problem is partition and boot manager after rebooting client. Also missing NIC’s is common. If your system is correctly setup, it is possible to select SLP with F3 and type autoyast=nfs:// server.net05.se/exports/network-install/SuSE/9.3/ and hit enter to start unattended installation. Note that it is not possible to type autoyast=default if you do not have local floppy with autoinst.xml on, or tweaking the SuSE CD1 standard cd-rom first by adding the autoinst.xml
Create a Custom Suse Autoyast Boot CD Download the latest default suse boot.iso from any suse mirror: suse/current/boot/boot.iso First login as root then Preparing space for ISO tree Mounting the downloaded boot.iso image Copy over content from ISO image to your new ISO tree Add/Change in your isolinux.cfg to suit your install server IP and path. This is the SySLINUX bootmanager in which we add one new way to start installation wget ftp://ftp.suse.com/pub/suse/i386/9.3/boot/boot.iso mkdir /mnt/suseisonew ; mkdir /mnt/suseiso ; cd /mnt/suseisonew mount -o loop -t iso9660 -rw /root/boot.iso /mnt/suseiso cp -pr /mnt/suseiso/* /mnt/suseisonew/ When you are done with you install and autoyast phrases on previous page and feel that they are rock solid, it is time to make a special Autoyast boot CD. This CD will boot the client and start the installation automatically, no need to interact (if not any errors appair). This is how you create a custom boot cd for SUSE Autoyast installations. I was using SuSE 9.3 here! It is nessesary to change the BOOTMANAGER on the CD to make it work, the phrases you developed is needed to be entered as Boot Option automatically Thsi si done by tweaking SySLINUX configuration file isolinix.cfg by adding one entry for net installation with autoyast. It is possible to fully customize your CD, by adding and removing appz to it. This also works with the SuSE standard CD1, if you make a fully new one lets say! vim /mnt/suseisonew/boot/loader/isolinux.cfg
Boot CD SySLINUX bootmanager settings In top of isolinux.cfg file you find the entry default This is the bootmanager default label to boot in 60 seconds Change to the new label We need to declare the new label, go to last label and after it add your new label Label is the virtual kernel name, here autoyast Kernel is the real name for our kernel to boot, here linux Append is the kernel attribute, what kernel should do, here: Initrd, ramdisk, dhcp and install, autoyast is declared showopts will show the kernel attribute line, more easy to change NOTE! Append must be ONE line, here it is broken just to make it more easy to see it! Also note that we use my-host.xml as configuration for the client default autoyast # autoyast label autoyast kernel linux append initrd=initrd ramdisk_size=65536 showopts ip=dhcp install=nfs://192.168.1.60/exports/network-install/SuSE/9.3/CD1 autoyast=nfs://192.168.1.60/exports/network-install/SuSE/9.3/my-host.xml Note how we simply add one label. In the new label we add kernel options needed. It is called append to add kernel options. append initrd=initrd ramdisk_size=65536 showopts ip=dhcp install=nfs://192.168.1.60/exports/network-install/SuSE/9.3/CD1 autoyast=nfs://192.168.1.60/exports/network-install/SuSE/9.3/my-host.xml If you enter FDQN instead of IP address, it is more easy to change server in future. Also it is recomended not to use a delicated my-host.xml file, just use the PATH to XML files. This way it is easy to have one CD for many different clients and server, just by changing the filenames so they are dependent on MAC addresses or IP addresses. If you skip the keyword showopts, the installer will not see any kernel boot options. You can remove all the other labels if you like to.
Making the bootable ISO image from sourcetree You make the ISO image from your sourcetree -r Rock Ridge protocol -o /tmp/bootcd.iso our ISO file -b bootloader image file -c boot directory -no-emul-boot for eltorito -boot-load-size number of 512 byte sectors to load for bootloader -boot-info-table el-torito cd layout specification /mnt/suseisonew/ our source tree to become ISO image! Note! The mkisofs is broken for visibility, it must in one line! Unmount ISO image Your ISO image is now resting here: /tmp/bootcd.iso Now it is left to burn the ISO image to a CD-ROM ! # cd /mnt/suseisonew # mkisofs -r -o /tmp/bootcd.iso \ -b boot/loader/isolinux.bin \ -c boot.cat \ -no-emul-boot \ -boot-load-size 4 \ -boot-info-table \ /mnt/suseisonew/ El-Torito is the specification for booting on CD-ROM. Burn the ISO image to CD-ROM with software of your choise! CD buring programs are many, one of them is cdrecord! ISO is standard among all plateforms, so the IMAGE you made can be burnt to CD using almost any operating system having a CD/DVD-Burner If there is some error in your setup, you must generate a new CD again. umount /mnt/suseiso
Booting With Your Autoyast Boot CD Boot the client with Autoyast boot CD! Just sit and wait, the standard splash screen arrives After splash screen the standard bootmenu arrives with your new label You can see your boot options if using my isolinux.cfg The counter counts down to zero, then your label is booting The installation now starts and continues fully automatic This is called KICK STARTING or JUMP STARTING with CD Very common in Unix workstation enviroment Comfortable to setup large enviroments fast Easy to maintain centrally In the netadmin class we look at PXE boot No bootCD or floppy is needed at all ps
Booting from FLASH stick boot.iso is 54MByte, that is to large for some cheap sticks We will make bootimage from bootfloppies, as root: Merge the images to one image and mount the image: Edit the syslinux.cfg bootmanager with your new label, like for the CD before: Unmount and apply syslinux IMPORTANT! To know what devicename your flash stick has: lsscsi # mkdir /mnt/myflash ; cd # mkbootdisk /media/SUSE930_F01 # mkfs.msdos /dev/sda1 or mkfs.vfat /dev/sda1 # cat bootdsk? >/tmp/bootdisk # mount -oloop /tmp/bootdisk /mnt/myflash default autoyast # autoyast label autoyast kernel linux append initrd=initrd ramdisk_size=65536 showopts ip=dhcp install=nfs://192.168.1.60/exports/network-install/SuSE/9.3/CD1 autoyast=nfs://192.168.1.60/exports/network-install/SuSE/9.3/my-host.xml Floppies become more and more rare, instead FLASH sticks arrives. First a warning! This is not fully tested! Flash sticks seems to behave strange sometimes! FLASH stick can use a special filesystem called CRAMFS, the methode above uses FAT! To know what devicename the flash stick has lssci When done with the above, your flash stick should boot, lets say if your PC can boot from flash! # umount /mnt/myflash # syslinux /dev/sda1