New OS templates (Dsmanager 4.4.16 and later)

From ISPWiki

Jump to: navigation, search

New templates are based on variables that enable users to use the maximum number of functions. All the Red Hat's templates - Base (kickstart)/Debian - Base(preseed)/FreeBSD will be installed using pre-integrated installation means of those systems.

Variables

($PASS_CRYPT)md5 hash of the root password
($PASS) root password
($DNS) dns server IP-address
($DS_IP)server IP-address
($FINISH) this variable contains a command to inform DSmanager that the OS installation was completed;

wget --no-check-certificate -O /dev/null -q 'https://" + SERVER_IP + "/manager/dsmgr?auth=" + session identifier + "&func=ds.reinstall&sok=ok&complete=on&out=xml'"

($SERVER_IP)DSmanager server IP-address
($DISK_MAP_KICKSTART)disk partition for the kickstart templates
($NFS) path to the nfs directory
($TFTP)path to the tftp directory
($MASK)sub-network mask
($GATEWAY)gateway
($MAC) server mac-address
($BROADCAST)server broadcast
($LINUX_MAC)mac-address in the form 01-##-##-##-##-##-##. Should be used for PXE booting
($HOSTNAME)server hostname

The above variables are specified in the response files and template file names. When necessary they will be changed into corresponding values.


The kickstart template "CentOS-6.2-kickstart":

Template directory structure:

/DS/DStemplate/CentOS-6.2-kickstart
|
|-($NFS)/ - contents of the directory (the directory should be named ($NFS))
|         |-CentOS_BuildTag
|         |-EULA
|         |-GPL
|         |-images
|         |-install.cfg - response files for kickstart
|         |-isolinux
|         |-Packages
|         |-RELEASE-NOTES-en-US.html
|         |-repodata
|         |-RPM-GPG-KEY-CentOS-6
|         |-RPM-GPG-KEY-CentOS-Debug-6
|         |-RPM-GPG-KEY-CentOS-Security-6
|         |-RPM-GPG-KEY-CentOS-Testing-6
|         |-TRANS.TBL
|
|-($TFTP)/ - the contents of this directory will be shared through tftp (the directory should be named ($TFTP))
|         |-initrd.img
|         |-kernel
|         |-pxelinux.0
|         |-pxelinux.cfg/
|                  |
|                  |-($LINUX_MAC) - the pxelinux configuration file
|
|-info - configuration file of the OS template


The install.cfg file:

#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth --useshadow --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --disabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Installation logging level
logging --level=info
# Use NFS installation media
nfs --server=($SERVER_IP) --dir=($NFS)
# Network information
network --bootproto=static --ip=($DS_IP) --netmask=($MASK) --gateway=($GATEWAY) --nameserver=($DNS)
#Root password
rootpw ($PASS_CRYPT)
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone Europe/Moscow
# Install OS instead of upgrade
install
# Disk partitioning information
($DISK_MAP_KICKSTART)
%post --nochroot --interp /bin/bash
($FINISH)
%end
reboot

The ($LINUX_MAC) file:

label linux
kernel kernel
append ks=nfs:($SERVER_IP):($NFS)/install.cfg initrd=initrd.img ksdevice=link

The info file:

<doc>
      <dsmgr_os_template/>
      <loader>pxelinux.0</loader>
      <replace_files>
             <file>($NFS)/install.cfg</file>
             <file>($TFTP)/pxelinux.cfg/($LINUX_MAC)</file>
      </replace_files>
      <os_type>Linux</os_type> </doc>

where:

($PASS_CRYPT)md5 hash of the root password
<dsmgr_os_template/> The mandatory parameter that informs you are required to use a new means for OS installation
<loader>pxelinux.0</loader> The loader file transferred by the DHCPD-server to the server being installed
<replace_files> A set of files where changes will be made. If the list is empty, changes will be made in all the template files that are large than 1 MB.
<os_type>Linux</os_type> Operating system (Linux/FreeBSD)


To add a template into DSmanager, locate the directory with the template into /DS/DStemplate/ and restart DSmanager. Once the control panel is started, the following lines will be added into the dsmgr.conf configuration file:


NetOs "Linux" { 
        Status ok
        ...
        OS CentOS-6.2-kickstart ok
        ...
}

A disk partition mechanism is now available for new templates:

mount_point size_in_mb file_system dev primary или 
mount_point     *  file_system dev primary

for swap:

swap size_in_mb

where:

size_in_mb size in megabytes
file_system file system
* all the free space on dev will be used
primary this partition will be the primary one.


Example:

/home 512  ext3 sda
/ * ext3 sda primary
/tmp 512 ext3
swap 1024


Partition for RAID:

var.01 size_in_mb dev 
var.02 size_in_mb dev
raid-opt mount_point raid_level new_dev_name file_system var.01 var.02

where:

mount_point mount point
raid_level RAID level
new_dev_name name of a new device


Example: RAID1 partition:

raid.03 * /dev/sda2 primary
raid.04 * /dev/sda3 primary
raid-opt / 1 md0 ext3 raid.03 raid.04

Note: currently the disk partition is only available for the Kickstart templates.

Was this helpful? Yes | No
Views
Personal tools