Automated installation

From Wikitech
(Difference between revisions)
Jump to: navigation, search
 
(Redirected page to Build a new server)
 
(48 intermediate revisions by 8 users not shown)
Line 1: Line 1:
*To import GPG key for yum in FC3:
+
#REDIRECT [[Build a new server]]
::<tt>apt-get install /usr/share/rhn/RPM-GPG-KEY-fedora</tt>
+
*GPG key for Fedora Extras:
+
::<tt>apt-get install http://download.fedora.redhat.com/pub/fedora/linux/extras/RPM-GPG-KEY-Fedora-Extras</tt>
+
*upgrades page: http://www.brandonhutchinson.com/Upgrading_Red_Hat_Linux_with_yum.html
+
*note that dag's repos are incompatible with fedora extras
+
 
+
 
+
==kickstart installation==
+
Kickstart installation for Debian core is for [semi-]automated installation of the operating system.  A DHCP server and a TFTP server are required, as well as some media or server(s) for the target machine to fetch a kickstart configuration file, software packages, etc from.  Within Wikimedia, DHCP, TFTPD, and web servers are used - in Florida, dhcpd, tftp-server and lighttpd are installed for this on rabanus.
+
 
+
When a machine tries to netboot, it broadcasts a request which the DHCP server answers, assigning an IP address, netmask, etc and telling the IP address of a TFTP server and the filename of a [http://syslinux.zytor.com/pxe.php PXELINUX] bootstrap loader to be fetched from it - e.g. in {{filename|/etc/dhcpd.conf}} for ariel, the TFTP server has IP 10.0.0.15 and the file to fetch is {{filename|/tftpboot/linux-install-64bit/pxelinux.0}} - this is commented out usually, so that the default (nonexistent) file is requested, and the server fails over to booting from disk.
+
{{box file|/etc/dhcpd.conf|
+
<pre>
+
subnet 10.0.0.0 netmask 255.255.0.0 {
+
      [...]
+
        option root-path "/tftpboot/";
+
        next-server 10.0.0.15; # rabanus (tftp server)
+
        # for safety, leave this referring to a non-existent file
+
        filename "nonexistent-file";
+
 
+
        host ariel.pmtpa.wmnet {
+
                #hardware ethernet 00:50:45:5B:D0:8C; # eth0
+
                hardware ethernet 00:50:45:5B:D0:8D; # eth1
+
                fixed-address 10.0.0.2;
+
                #filename "linux-install-64bit/pxelinux.0";
+
        }
+
        host alrazi.pmtpa.wmnet {
+
                #hardware ethernet 00:30:48:72:E7:30; # eth0
+
                hardware ethernet 00:30:48:72:E7:31; # eth1
+
                fixed-address 10.0.0.10;
+
                #filename "linux-install-32bit/pxelinux.0";
+
        }
+
[...]
+
</pre>
+
}}
+
 
+
Once the bootloader is fetched, the client attempts to fetch a PXELINUX configuration file from {{filename|pxelinux.cfg/}}.  It attempts a series of filenames until one succeeds, sometimes beginning with a filename of the form {{filename|01-aa-bb-cc-dd-ee-ff}} where the final 6 pairs are the client NIC's MAC address.  Then it tries its IP address in hexadecimal, then the same with the last character removed, then with the last two removed, down to a single character and finally trying {{filename|default}}.
+
<pre>
+
in.tftpd[5151]: RRQ from 10.0.0.212 filename linux-install-32bit/pxelinux.0
+
in.tftpd[5152]: RRQ from 10.0.0.212 filename linux-install-32bit/pxelinux.cfg/01-00-30-48-73-55-53
+
in.tftpd[5152]: sending NAK (1, File not found) to 10.0.0.212
+
in.tftpd[5153]: RRQ from 10.0.0.212 filename linux-install-32bit/pxelinux.cfg/0A0000D4
+
in.tftpd[5154]: RRQ from 10.0.0.212 filename linux-install-32bit/fc3-i386-vmlinuz
+
in.tftpd[5155]: RRQ from 10.0.0.212 filename linux-install-32bit/fc3-i386-initrd.img
+
</pre>
+
 
+
''to be continued...''
+
 
+
==notes==
+
* tftp server started on demand by xinetd - enable it by setting <tt>disable = no</tt> in {{filename|/etc/xinetd.d/tftp}}
+
* docs at http://www.redhat.com/docs/manuals/linux/RHL-9-Manual/custom-guide/ch-kickstart2.html
+
:: some additional capabilities added since Redhat 9, e.g. installation using VNC
+
* if the installer stops, asking you which NIC to install through, add <tt>ksdevice=eth0</tt> to the boot args in {{filename|pxelinux.cfg/foo}}
+
 
+
== see also ==
+
* https://www.redhat.com/archives/kickstart-list/2005-September/msg00058.html - useful links
+
* http://www.slac.stanford.edu/~alfw/PXE-Kickstart/PXE-Kickstart.html
+
* http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/
+
** kickstart options for RHEL4: [http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/sysadmin-guide/s1-kickstart2-options.html]
+
* http://www.redhat.com/docs/manuals/enterprise/RHEL-4-Manual/x8664-multi-install-guide/
+
* http://www.linuxdevcenter.com/lpt/a/5077
+
* http://www.linuxdevcenter.com/lpt/a/5296
+
 
+
==anaconda options==
+
taken from [http://forums.fedoraforum.org/showthread.php?s=b8dc068ec92a44d68ec6b5bde179452f&t=25826]:
+
<pre>
+
Boot time command args:
+
-----------------------
+
+
expert          Turns on special features:
+
                    - allows partitioning of removable media
+
                    - prompts for driver disk
+
+
noshell        Do not put a shell on tty2 during install.
+
+
lowres          Force GUI installer to run at 640x480.
+
+
resolution=<mode> Run installer in mode specified, '1024x768' for example.
+
+
nousb          Do not load USB support (helps if install hangs
+
                early sometimes).
+
+
nofb            Do not load the VGA16 framebuffer required for doing
+
                text-mode installation in some languages
+
+
nofirewire      Do not load support for firewire devices
+
+
askmethod      Do not automatically use the CD-ROM as the install
+
                source if we detect a Red Hat Linux CD in your CD-ROM drive.
+
+
nousbstorage    Do not load usbstorage module in loader.  May help with
+
                device ordering on SCSI systems.
+
+
noparport      Do not attempt to load support for parallel ports
+
+
noprobe        Do not attempt to detect hw, prompts user instead.
+
+
nopcmcia        Ignore PCMCIA controller in system.
+
+
skipddc        Skips DDC probe of monitor, may help if its handing system.
+
+
graphical      Force graphical install. Required to have ftp/http use GUI.
+
+
text            Force text mode install.
+
+
vnc            Enable vnc-based installation. You will need to connect
+
                to the machine using a vnc client application.
+
+
vncpassword=<password>  Enable a password for the vnc connection. This will
+
                prevent someone from inadvertantly connecting to the
+
                vnc-based installation.
+
+
                Requires 'vnc' option to be specified as well.
+
+
vncconnect=<host>[:<port>]  Once installation is up and running, connect to
+
                the vnc client named <host>, and optionally use port <port>.
+
+
                Requires 'vnc' option to be specified as well.
+
+
updates        Prompt for floppy containing updates (bug fixes).
+
+
isa            Prompt user for ISA devices configuration.
+
+
dd              Use a driver disk.
+
+
driverdisk      Same as 'dd'.
+
+
mediacheck      Activates loader code to give user option of testing integrity
+
                of install source (if an ISO-based method).
+
+
rescue          Run rescue environment.
+
+
nomount        Don't automatically mount any installed Linux partitions
+
                in rescue mode.
+
+
nopass          Don't pass keyboard/mouse info to stage 2 installer, good for
+
                testing keyboard and mouse config screens in stage2 installer
+
                during network installs.
+
+
+
serial          Turns on serial console support.
+
+
ksdevice        Takes an argument like 'eth0', tells install what network
+
                device to use for kickstart from network.
+
+
ks              Kickstart over NFS.
+
+
ks=cdrom:      Kickstart from CDROM
+
+
ks=nfs:<path>  Kickstart from NFS.
+
+
ks=<url>        Kickstart via HTTP.
+
+
ks=hd:<dev>    Kickstart via harddrive (dev = 'hda1', for example)
+
+
ks=file:<path>  Kickstart from a file (path = 'fd0/ks.cfg')
+
+
ks=ftp://<path> Kickstart from FTP.
+
+
ks=http://<path> Kickstart from HTTP.
+
+
kssendmac      Adds HTTP headers to ks=http:// request that can be helpful
+
                for provisioning systems.  Includes MAC address of all nics in
+
                a CGI environment variable of the form
+
                HTTP_X_RHN_PROVISIONING_0, HTTP_X_RHN_PROVISIONING_1, etc, for
+
                all nics.
+
+
dhcpclass=<class> Sends a custom DHCP vendor class identifier. ISC's dhcpcd can
+
                inspect this value using "option vendor-class-identifier".
+
+
upgradeany      Don't require an /etc/redhat-release that matches the
+
                expected syntax to upgrade.
+
+
lang=<lang>    Language to use for the installation.  This should be a
+
                language which is valid to be used with the 'lang' kickstart
+
                command.
+
+
keymap=<keymap> Keyboard layout to use.  Valid values are those which can be
+
                used for the 'keyboard' kickstart command.
+
+
ip=<ip>        IP to use for a network installation, use 'dhcp' for DHCP.
+
+
netmask=<nm>    Netmask to use for a network installation.
+
+
gateway=<gw>    Gateway to use for a network installation.
+
+
dns=<dns>      Comma separated list of nameservers to use for a network
+
                installation.
+
+
method=nfs:<path> Use <path> for an NFS installation.
+
+
method=http://<path> Use <path> for an HTTP installation
+
+
method=ftp://<path> Use <path> for an FTP installation
+
+
method=hd://<dev>/<path> Use <path> on <dev> for a hard drive installation
+
+
method=cdrom    Do a CDROM based installation.
+
+
vnc            Do graphical installation via VNC.  Instead of
+
                starting a normal X server, vncserver will be started
+
                and you can then connect remotely to do the
+
                installation.
+
+
vncpassword=<password>  Set a password for the vnc session.
+
+
vncconnect=<host>[:<port>]  Once installation is up and running, connect to
+
                the vnc client named <host>, and optionally, on port <port>.
+
                Requires 'vnc' option to be specified as well.
+
</pre>
+
and undocumented ones:
+
<pre>
+
test
+
debug          Start up pdb immediately
+
nofallback      If GUI fails exit
+
rootpath=      Where to install packages (default /mnt/sysimage)
+
pcic=          Specify pcmcia controller
+
overhead=      Override LVM overhead calculation
+
testpath=
+
mountfs
+
traceonly      Don't run, just list modules we use
+
kickstart=      Set serial install and kickstart file
+
kbdtype=        Set the type of keyboard
+
module=        Load additional kernel modules
+
class=          Choose install class to use
+
autostep        Make kickstart non-interactive
+
noselinux      Disable Security Enhanced Linux
+
selinux        Enable Security Enhanced Linux
+
vnc=
+
cmdline        Use command line installer
+
headless        Automate install for machines with no display
+
virtpconsole=
+
xfs            Allows the creation of a xfs filesystem
+
reiserfs        Allows the creation of a reiserfs filesystem
+
jfs            Allows the creation of a jfs filesystem
+
syslogd
+
</pre>
+
 
+
==kickstart setup for ''srv31-50'' as of 2005-09-19==
+
By uncommenting an entry in rabanus:/etc/dhcpd.conf, restarting its dhcpd and rebooting a machine, you can make it reinstall FC3 and automatically set up the following:
+
* make mount points and put NFS mounts in {{filename|/etc/fstab}}
+
* root's {{filename|~/.ssh/authorized_keys}}
+
* {{filename|/etc/hosts}} according to Tim's recommendation
+
* yum repositories in {{filename|/etc/yum.repos.d/}}
+
* put <tt>ttyS0</tt> in {{filename|/etc/securetty}}
+
* alter {{filename|/etc/inittab}} to run an <tt>agetty</tt> on <tt>ttyS0</tt> if necessary
+
* LDAP
+
* remote syslogging to larousse and zwinger
+
* {{filename|/etc/resolv.conf}}
+
* noatime,notail on reiserfs partitions
+
* remove unused services
+
After rebooting after OS installation, it will:
+
* copy host keys back in to {{filename|/etc/ssh}}, or back them up to {{filename|/h/w/conf/etc-ssh/}} if not already backed-up
+
* do a yum update
+
* copy some files into {{filename|/etc}} - see {{filename|/h/w/sbin/post-boot-config-sync.sh}}
+
 
+
==links==
+
*http://www.tldp.org/HOWTO/BootPrompt-HOWTO.html - boot-time kernel params
+
*http://fedora.redhat.com/docs/
+
*http://fedoralegacy.org/
+
*http://www.fedora.us/wiki/FedoraMirrorList
+
*http://fedora.redhat.com/download/
+
*http://fedora.redhat.com/download/mirrors.html
+
 
+
[[Category:Operating system]]
+

Latest revision as of 23:34, 12 February 2013

  1. REDIRECT Build a new server
Personal tools
Namespaces

Variants
Actions
Navigation
Ops documentation
Wiki
Toolbox