Presentation on theme: "Automated installations /kickstarts"— Presentation transcript:
1Automated installations /kickstarts ObjectivesCreating automated installationsContentsAuto install variantsAutoYastXML file configuration autoinst.xmlServer ConfigurationAuto install with SuSE CD1Making your own Autoyast Boot CDBooting with Autoyast boot CDPracticalsPerform one kickstart installationSummaryThis chapter show howto make totally unattended installation’s, well almost unattended.There are several ways of doing mass deployment of unix servers and workstations.
2Autoinstall variantsThere are several ways to perform unattended installations:DISK IMAGE DISK IMAGE + CONFIG CD + XML CD + FLOPPY +XMLFull PXE boot FLOPPY + XML + NET CD + XML + NET CD + NETFLASH 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 + NETThis demands only the install server sharing files and autoyast plus possible SLP and DHCP serverThis is used in small to medium size companies and organizationsNext most popular is Full PXE bootThis demand all of the above plus tftp boot server, which is many step to setupThis is used in enterprice larger companies and organizationsThe variant of CD + XML on floppyIs nice to have for single setups, special servers and clients.Post RSYNC configurationUsed 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.
3AutoYAST toolkitAutoYast 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/repositoryYou can edit the .xml directly with texteditor of your choiseAutoyast can import RedHat kickstart .ks files and other kickstarts. (anaconda.ks)Choose to open file and importOnce you have created the kickstart configuration file you can copy it to:A directory on the install serverA boot diskette or CD/DVDA regular Linux diskette# yast autoyastBoot Options: autoyast=nfs://server.net05.se/xml-install/autoinst.xmlAutoyast 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: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.
4AutoYAST 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 standards2. Hardware Partitioning At least one device like /dev/hda or /dev/sda3. System general options Language, Keyboard, TZ, MouseConfirm installation ? = NOStart System without Reboot = YES4. 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 autoyastThis 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.
5The autoyast XML file name conventions After doing your configuration it is time to save the settings, the result will be an XML fileAs 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.xmlIf 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 defaultautoyast=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.# gethostipC0A80137C0A8013C0A80C0AC0A801C0A8C005022E3A7DCC0
6Copying The XML File To A Floppy The file should have the name ”autoinst.xml" or names like previous pageShould 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 disketteNow 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.xmlNote 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’sExercise, 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
7Copying 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, TFTPWhether 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.3Or /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 serverYou find a sample XML file here: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.
8Booting With Your Kickstart Files This method is not fully automatic, but very practialAllways use this methode to develop your XML files before making it fully automaticIt will save you lot of time searching for possible errorsPractical when doing sample installations, only little to enterBoot from your boot device, the standard SuSE CD1.When boot is done, the regular bootmenu is presented choose INSTALLYou can enter any kernel parameters as Boot Optionsinstall=Where are the sources ?Allways Protocol://path/to/files Review SLPautoyast=Where are the XML kickstart files ? Review autoyast=defaultAllways Protocol://path/to/filesBoot 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.xmlAbove 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:// 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 protocolCommon 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
9Create a Custom Suse Autoyast Boot CD Download the latest default suse boot.iso from any suse mirror: suse/current/boot/boot.isoFirst login as root thenPreparing space for ISO treeMounting the downloaded boot.iso imageCopy over content from ISO image to your new ISO treeAdd/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 installationwget ftp://ftp.suse.com/pub/suse/i386/9.3/boot/boot.isomkdir /mnt/suseisonew ; mkdir /mnt/suseiso ; cd /mnt/suseisonewmount -o loop -t iso9660 -rw /root/boot.iso /mnt/suseisocp -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 automaticallyThsi 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
10Boot CD SySLINUX bootmanager settings In top of isolinux.cfg file you find the entry defaultThis is the bootmanager default label to boot in 60 secondsChange to the new labelWe need to declare the new label, go to last label and after it add your new labelLabel is the virtual kernel name, here autoyastKernel is the real name for our kernel to boot, here linuxAppend is the kernel attribute, what kernel should do, here:Initrd, ramdisk, dhcp and install, autoyast is declaredshowopts will show the kernel attribute line, more easy to changeNOTE! 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 clientdefault autoyast# autoyastlabel autoyastkernel linuxappend initrd=initrd ramdisk_size=65536 showopts ip=dhcp install=nfs:// /exports/network-install/SuSE/9.3/CD1 autoyast=nfs:// /exports/network-install/SuSE/9.3/my-host.xmlNote 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:// /exports/network-install/SuSE/9.3/CD1 autoyast=nfs:// /exports/network-install/SuSE/9.3/my-host.xmlIf 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.
11Making 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 imageYour ISO image is now resting here: /tmp/bootcd.isoNow 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-BurnerIf there is some error in your setup, you must generate a new CD again.umount /mnt/suseiso
12Booting With Your Autoyast Boot CD Boot the client with Autoyast boot CD!Just sit and wait, the standard splash screen arrivesAfter splash screen the standard bootmenu arrives with your new labelYou can see your boot options if using my isolinux.cfgThe counter counts down to zero, then your label is bootingThe installation now starts and continues fully automaticThis is called KICK STARTING or JUMP STARTING with CDVery common in Unix workstation enviromentComfortable to setup large enviroments fastEasy to maintain centrallyIn the netadmin class we look at PXE bootNo bootCD or floppy is needed at allps
13Booting from FLASH stick boot.iso is 54MByte, that is to large for some cheap sticksWe 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 syslinuxIMPORTANT! To know what devicename yourflash 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/myflashdefault autoyast# autoyastlabel autoyastkernel linuxappend initrd=initrd ramdisk_size=65536 showopts ip=dhcp install=nfs:// /exports/network-install/SuSE/9.3/CD1 autoyast=nfs:// /exports/network-install/SuSE/9.3/my-host.xmlFloppies 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 lssciWhen done with the above, your flash stick should boot, lets say if your PC can boot from flash!# umount /mnt/myflash# syslinux /dev/sda1