Automagisch installeren van OES en SLES Frank Korpershoek Jeroen Bannink
Agenda Waarom deze methode Installatie Server PXE Booting AutoYast scripts Subscription Management Server Slide: 2
Handmatig vs. Automatisch Handmatig CD's wisselen Veel input onderweg Automatisch Aan het begin van het proces de juiste gegevens verzamelen Slide: 3
Onderdelen Installatie Server PXE boot server AutoYast scripts Subscription Management Server Slide: 4
Installatie Server Voordelen Geen CD's meer nodig Snelheid Toevoegen pakketten eenvoudig Remote installaties Slide: 5
Installatie Server Installatie Diskruimte Installatie vanuit YaST (#yast instserver) sourcetype: HTTP/FTP/NFS directory, alias webserver alias sources toevoegen Source name (bv: sles10sp3-64) Source bestanden kopieeren Webbrowser test http://<installserver>/suse/ Slide: 6
Installatie Server Verdere configuratie SLP apache extra sources toevoegen Slide: 7
Installatie 'booten' Remaster van installatie CD /boot/i386/loader : append initrd=initrd splash=silent showopts install=http://<install>/suse/ sles10-sp3/cd1 autoyast=http://<install>/suse/<custom>.xml PXE Booten Geen CD's meer nodig PXE Boot proces Slide: 8
PXE Boot Server Configuratie TFTP Server installatie YaST Bootfiles SLES install DVD: pxelinux.0 linux initrd pxelinux.cfg/message pxelinux.cfg/default Slide: 9
PXE: default default harddisk implicit 0 display pxelinux.cfg/message prompt 1 timeout 200 # hard disk label harddisk localboot 0x80 # install sles10 sp3 32 bits label sles10sp3-32 kernel linux append initrd=initrd @ install=http://install.ix.org/suse/sles10sp3-32/cd1 showopts # install sles 10 sp3 32 bits with autoyast label sles10-autoyast kernel linux append initrd=initrd @ install=http://install.ix.org/suse/sles10sp3-32/cd1 @ autoyast=http://install.ix.org/suse/sles10-lab1130.xml @ showopts Slide: 10
PXE: message harddisk - Boot from Harddisk (this is default) sles10sp3-32 - Manual Installation of SLES10 SP3 sles10-autoyast - Installation of SLES 10 SP3 with autoyast Slide: 11
PXE informatie vanuit dhcp /etc/dhcpd.conf option domain-name "ix.org"; option domain-name-servers 10.1.1.2; option routers 10.1.1.2; ddns-update-style none; default-lease-time 14400; subnet 10.1.1.0 netmask 255.255.255.0 { range 10.1.1.100 10.1.1.200; default-lease-time 14400; max-lease-time 172800; next-server 10.1.1.21; filename "pxelinux.0"; } Slide: 12
PXE Boot Slide: 13
PXE Alternatieven Graphical PXE Slide: 14
Remote Installatie Kernel bootopties # install sles10 sp3 32 bits label sles10sp3-32 kernel linux append initrd=initrd install=http://install.ix.org/suse/sles10sp3-32/cd1 hostip=10.1.1.123/24 nameserver=10.1.1.20 gateway=10.1.1.2 usessh=1 sshpassword=wortel showopts Slide: 15
Remote Installatie Slide: 16
AutoYaST Wat is Autoyast Antwoord bestand Definieert» Systeeminstellingen» Pakketkeuzes Automatisch uitrollen Slide: 17
AutoYaST autoyast.xml <?xml version="1.0"?> <!DOCTYPE profile> <profile xmlns="http://www.suse.com/1.0/yast2ns" xmlns:config="http://www.suse.com/1.0/configns"> <add-on> <add_on_products config:type="list"> <listentry> <media_url>http://10.1.1.21/suse/oes2sp2-32/cd1</media_url> <product>open_enterprise_server_sp2</product> <product_dir>/</product_dir> </listentry> </add_on_products> </add-on> <bootloader> <device_map config:type="list"> <device_map_entry> <firmware>hd0</firmware> <linux>/dev/sda</linux> </device_map_entry> </device_map> <global> Slide: 18
AutoYaST partioning <partitioning config:type="list"> <drive> <device>/dev/sda</device> <partitions config:type="list"> <partition> <create config:type="boolean">true</create> <filesystem config:type="symbol">swap</filesystem> <format config:type="boolean">true</format> <mount>swap</mount> <mountby config:type="symbol">device</mountby> <partition_id config:type="integer">130</partition_id> <partition_nr config:type="integer">1</partition_nr> <partition_type>primary</partition_type> <size>1176182272</size> </partition> <partition> <create config:type="boolean">true</create> <filesystem config:type="symbol">ext3</filesystem> <format config:type="boolean">true</format> <mount>/var/log</mount> <mountby config:type="symbol">device</mountby> <partition_id config:type="integer">131</partition_id> <partition_nr config:type="integer">2</partition_nr> <partition_type>primary</partition_type> <size>3076254208</size> </partition> Slide: 19 <partition> <create config:type="boolean">true</create> <filesystem config:type="symbol">ext3</filesystem> <format config:type="boolean">true</format> <mount>/</mount> <mountby config:type="symbol">device</mountby> <partition_id config:type="integer">131</partition_id> <partition_nr config:type="integer">3</partition_nr> <partition_type>primary</partition_type> <size>2138572288</size> </partition> </partitions> <use>all</use> </drive> </partitioning>
AutoYaST creëeren Hoe kom je aan een antwoord bestand yast autoyast op de command-line Inlezen huidige systeem Einde installatie van een server Slide: 20
AutoYaST yast autoyast Slide: 21
AutoYaST scan system Slide: 22
AutoYaST ask ASK <ask-list config:type="list"> <ask> <path>networking,dns,hostname</path> <question>enter Hostname (server name)</question> <stage>initial</stage> <default>enter your hostname here</default> </ask> </ask-list> Slide: 23
AutoYaST ask <networking>... <dns>.. <hostname>.. </networking> <ask-list config:type="list"> <ask> <path>networking,dns,hostname</path> <question>enter Hostname (server name)</question> <stage>initial</stage> <default>enter your hostname here</default> </ask> </ask-list> Slide: 24
AutoYaST ask hostnaam IP-adres Wachtwoorden <ask> <path>networking,interfaces,0,ipaddr</path> <title>password <path>networking,dns,hostname</path> FOR THE root USER</title> <question>enter <path>user,0,user_password</path> the primary Hostname IP (server Address:</question> name)</question> <stage>initial</stage> <question>enter the root password</question> <default>10.1.1.31</default> <stage>initial</stage> <default>enter your hostname here</default> </ask> <password config:type="boolean">false</password>! NB encrypted <encrypted config:type= boolean >true</encrypted> <encrypted config:type= boolean >false</encrypted> Slide: 25
AutoYaST yast autoyast Nadelen van deze methode Heel veel configuratiewerk Foutgevoelig Voordelen van deze methode Overzichtelijk Slide: 26
AutoYaST oes-componenten Veel extra configuratie-werk Gebruik een gegenereerd XML bestand Clone this System for autoyast Bewerk dit bestand, wijzig namen/adressen/context Slide: 27
AutoYaST scripts Pre-Install Scripts Postpartitioning Scripts (Alleen OpenSuse 11.2) Chroot scripts Post-Install Scripts Init Scripts Slide: 28
AutoYaST scripts <scripts> <post-scripts config:type="list"> <script> <filename>register.sh</filename> <interpreter>shell</interpreter> <source> <![CDATA[ #!/bin/bash wget smt.ix.org/smt.sh -O /root/smt.sh yes sh /root/smt.sh --host smt.ix.org --regcert http://smt.ix.org/smt.crt /usr/bin/suse_register /usr/bin/rug up --patch -y if [ -n "`ip link grep 'link/ether 00:0c:29'`" ]; then echo vmware wget http://install.ix.org/suse/vmwaretools-7.8.6-185404.i386.rpm -O /root/vmwaretools.rpm rpm -Uvh /root/vmwaretools.rpm /usr/bin/vmware-config-tools.pl --compile --default else echo default fi exit ]]> </source> </script> </post-scripts> </scripts> Slide: 29
AutoYaST know it all http://www.suse.de/~ug/autoyast_doc/index.html Slide: 30
SMT Server Subscription Management Tool Voordelen NCC Mirror Client registratie >> Sessie NC023 Subscription Management Tool 14:30-15:30 Slide: 31
Vragen en antwoorden Slide: 32