Fog server + Debian

Üsna kasulik asi kui vaja operatsioonisüsteemi imageid paigaldada üle PXE. Inspratsiooni andis Ott Valgu (Tallinna Polütehnikum) lõputöö. Poleks ilmselt selle peale ise üldse tulnud aga nüüd kus kõik läbi tehtud saan kinnitada, et tegemist on väärt lahendusega, mis hoiab metsikult aega kokku. Sarnane lahendus on ka Windows Server platvormil (image capture) aga FOG serveri näol on tegemist tasuta lahendusega.

Keerasin FOGI serveriks jägmise masina: Intel C2D E6300/4GB DDR2/2x500GB RAID1/GBE NIC

Raid 1 miinus on aeglane kirjutamiskiirus. Kasutusel on Debiani tarkvaraline nn “fake raid”. Kirjtuab kiirusega 800-900MB/m, loeb seevastu 4-5GB/m. Kuna imageid hakkab serveris palju olema on RAID 1 siinkohal igati õigustatud, pealegi eelduste kohaselt paigaldab server rohkem kui üles laeb.

Alustuseks siis Debiani netinstall ja peale vaid SSH server ja standard system utils. Ning edasi:

apt-get install mc # minu isiklik eelistus
mkdir /fog # teeme fog kataloogi
cd /fog # liigume tehtud katloogi
wget http://downloads.sourceforge.net/project/freeghost/FOG/fog_1.2.0/fog_1.2.0.tar.gz # tõmba-me alla fog tarkvara paketi
tar -xf fog_1.2.0.tar.gz # pakime selle lahti

Järmgisena käivitan mc ja lähen kausta /fog/fog_1.2.0/bin ja kävitan installfog.sh installikas läheb käima

VALIKUD:

  1. Debian Based Linux (Debian, Ubuntu, Kubuntu, Edubuntu)
  2. * Normal Server: (Choice N)
  3. What is the IP address to be used by this FOG Server? [xxx.xxx.xxx.xxx] # Jätan default
  4. Would you like to setup a router address for the DHCP server? [Y/n] # Jah
  5. What is the IP address to be used for the router on the DHCP server? [xxx.xxx.xxx.xxx# Jätan default
  6. Would you like to setup a DNS address for the DHCP server and client boot image? [Y/n] # Jah
  7. What is the IP address to be used for DNS on the DHCP server and client boot image? [xxx.xxx.xxx.xxx] # Jätan default
  8. Would you like to setup a DNS address for the DHCP server and client boot image? [Y/n] # Jätan default
  9. What is the IP address to be used for DNS on the DHCP server and client boot image? [xxx.xxx.xxx.xxx# Jätan default
  10. Would you like to change the default network interface from eth0? If you are not sure, select No. [y/N] # Ei
  11. Would you like to use the FOG server for DHCP service? [Y/n] # Ei
  12. This version of FOG has internationalization support, would you like to install the additional language packs? [y/N] # Ei
  13. Would you like to donate computer resources to the FOG Project? [y/N] # Ei
  14. Are you sure you wish to continue (Y/N) # Jah
  15. Root SQL password
  16. Did you leave the mysql password blank during install? (Y/n) # Ei ja sisesta muudetud pass
  17. http://xxx.xxx.xxx.xxx/fog/management # kinnitad sellel lehel andmebaasi ära ja ongi valmis

Nüüd tuleb natuke trikitada, et “võõra” DHCPga lahendus tööle hakkab, selleks:

apt-get install dnsmasq
nano /etc/dnsmasq.d/ltsp.conf

Siia läheb järgnev conf:

# Sample configuration for dnsmasq to function as a proxyDHCP server,
# enabling LTSP clients to boot when an external, unmodifiable DHCP
# server is present.
# The main dnsmasq configuration is in /etc/dnsmasq.conf;
# the contents of this script are added to the main configuration.
# You may modify the file to suit your needs.

# Don't function as a DNS server:
port=0

# Log lots of extra information about DHCP transactions.
log-dhcp

# Dnsmasq can also function as a TFTP server. You may uninstall
# tftpd-hpa if you like, and uncomment the next line:
enable-tftp

# Set the root directory for files available via FTP.
tftp-root=/tftpboot

# The boot filename.
dhcp-boot=pxelinux.0

# rootpath option, for NFS
dhcp-option=17,/images

# kill multicast
dhcp-option=vendor:PXEClient,6,2b

# Disable re-use of the DHCP servername and filename fields as extra
# option space. That's to avoid confusing some old or broken DHCP clients.
dhcp-no-override

# PXE menu.  The first part is the text displayed to the user.  The second is the timeout, in seconds.
pxe-prompt="Press F8 for boot menu", 0

# The known types are x86PC, PC98, IA64_EFI, Alpha, Arc_x86,
# Intel_Lean_Client, IA32_EFI, BC_EFI, Xscale_EFI and X86-64_EFI
# This option is first and will be the default if there is no input from the user.
pxe-service=X86PC, "Boot from network", pxelinux

# A boot service type of 0 is special, and will abort the
# net boot procedure and continue booting from local media.
pxe-service=X86PC, "Boot from local hard disk", 0

# If an integer boot service type, rather than a basename is given, then the
# PXE client will search for a suitable boot service for that type on the
# network. This search may be done by multicast or broadcast, or direct to a
# server if its IP address is provided.
# pxe-service=x86PC, "Install windows from RIS server", 1

# This range(s) is for the public interface, where dnsmasq functions
# as a proxy DHCP server providing boot information but no IP leases.
# Any ip in the subnet will do, so you may just put your server NIC ip here.
# Since dnsmasq is not providing true DHCP services, you do not want it
# handing out IP addresses.  Just put your servers IP address for the interface
# that is connected to the network on which the FOG clients exist.
# If this setting is incorrect, the dnsmasq may not start, rendering
# your proxyDHCP ineffective.
dhcp-range=xxx.xxx.xxx.xxx,proxy

# This range(s) is for the private network on 2-NIC servers,
# where dnsmasq functions as a normal DHCP server, providing IP leases.
# dhcp-range=192.168.0.20,192.168.0.250,8h

# For static client IPs, and only for the private subnets,
# you may put entries like this:
# dhcp-host=00:20:e0:3b:13:af,10.160.31.111,client111,infinite

Peale väikest ponnistust avastasin, et vaja on ka:

cd /tftpboot
ln -s undionly.kpxe undionly.0
service dnsmasq restart

Nüüd peaks kõik toimima.

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out /  Change )

Google photo

You are commenting using your Google account. Log Out /  Change )

Twitter picture

You are commenting using your Twitter account. Log Out /  Change )

Facebook photo

You are commenting using your Facebook account. Log Out /  Change )

Connecting to %s