#Configuring AMANDA 3.3 FOR RHEL 6 SERVER AND CLIENT ,fedora
#first configure dhcp and dns before this
#packages needed are amanda and xinetd
#steps are
#1.setting up the server
#2.setting up the client
#3.verifying the connection
#4.taking the backup
#5.recovering the backup
#package installations
#xinetd packages are available in the package set of the os cd/DVD
#you can get the amanda server and client rpm from Following link
http://www.zmanda.com/downloads/community/Amanda/3.3.2/Redhat_Enterprise_6.0/
#there will be two files one for server and another for client
#amanda-backup_server-3.3.2-1.rhel6.x86_64.rpm
#amanda-backup_client-3.3.2-1.rhel6.x86_64.rpm
#1.setting up the server
#->install the rpm
-------->yum -y install amanda-backup-server-3.3.2-1.rhel6.x86_64.rpm
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Examining /root/Downloads/amanda-backup_server-3.3.2-1.rhel6.x86_64.rpm: amanda-backup_server-3.3.2-1.rhel6.x86_64
Marking /root/Downloads/amanda-backup_server-3.3.2-1.rhel6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package amanda-backup_server.x86_64 0:3.3.2-1.rhel6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==========================================================
Package Arch Version Repository Size
=========================================================
Installing:
amanda-backup_server
x86_64 3.3.2-1.rhel6 /amanda-backup_server-3.3.2-1.rhel6.x86_64 8.8 M
Transaction Summary
===========================================================
Install 1 Package(s)
Total size: 8.8 M
Installed size: 8.8 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : amanda-backup_server-3.3.2-1.rhel6.x86_64 1/1
Amanda installation log can be found in '/var/log/amanda/install.log'.
duration: 196(ms)
Installed products updated.
Installed:
amanda-backup_server.x86_64 0:3.3.2-1.rhel6
Complete!
#-------->set password for the amandabackup user
passwd amandabackup
****
****
#Create a directory for our vtapes, and set its ownership and permissions:
mkdir -p /data/amanda/vtape/DailySet1
chown amandabackup:disk /data/amanda/vtape/DailySet1
chmod -R 750 /data/amanda/vtape/DailySet1
# Change to the amandabackup user:
su – amandabackup
# As amandabackup user, run amserverconfig to create a vtape configuration:
#the backup will be at /data/amanda/vtape/DailySet1
-bash-4.1$ amserverconfig DailySet1 –template harddisk –tapedev /data/amanda/vtape/DailySet1 –mailto root@localhost –dumpcycle 1week –runspercycle 5 –tapecycle 12 –runtapes 1
Logging to /var/log/amanda/amserverconfig.20120925120547.debug
mkdir /etc/amanda/DailySet1
mkdir /etc/amanda/template.d
/etc/amanda/template.d directory created
/var/lib/amanda/gnutar-lists directory exists
/etc/amanda/DailySet1/advanced.conf created and updated
mkdir /etc/amanda/DailySet1/curinfo
mkdir /etc/amanda/DailySet1/index
curinfo and index directory created
tapelist file created
disklist file created
Creating custom configuration using templates
custom amanda.conf created
creating vtape directory
amlabel vtapes
mkdir slot1
mkdir slot11
mkdir slot12
changer is reset
/var/lib/amanda/example/xinetd.amandaserver contains the latest Amanda server daemon configuration.
Please merge it to /etc/xinetd.d/amandaserver.
/var/lib/amanda/.ssh/client_authorized_keys created. Please append to /var/lib/amanda/.ssh/authorized_keys file on Amanda clients
DONE.
--------->cp /var/lib/amanda/example/xinetd.amandaserver /etc/xinetd.d/amandaserver
###
#####Go to client machine and install client rpm
####
---->>yum -y install amanda-backup_client-3.3.2-1.rhel6.x86_64.rpm
Loaded plugins: product-id, refresh-packagekit, subscription-manager
Updating Red Hat repositories.
Setting up Install Process
Examining /root/Downloads/amanda-backup_client-3.3.2-1.rhel6.x86_64.rpm: amanda-backup_client-3.3.2-1.rhel6.x86_64
Marking /root/Downloads/amanda-backup_client-3.3.2-1.rhel6.x86_64.rpm to be installed
Resolving Dependencies
--> Running transaction check
---> Package amanda-backup_client.x86_64 0:3.3.2-1.rhel6 will be installed
--> Finished Dependency Resolution
Dependencies Resolved
==================================================
Package Arch Version Repository Size
========================================================
Installing:
amanda-backup_client
x86_64 3.3.2-1.rhel6 /amanda-backup_client-3.3.2-1.rhel6.x86_64 8.2 M
Transaction Summary
===================================================
Install 1 Package(s)
Total size: 8.2 M
Installed size: 8.2 M
Downloading Packages:
Running rpm_check_debug
Running Transaction Test
Transaction Test Succeeded
Running Transaction
Installing : amanda-backup_client-3.3.2-1.rhel6.x86_64 1/1
Non-fatal POSTIN scriptlet failure in rpm package amanda-backup_client-3.3.2-1.rhel6.x86_64
Amanda installation log can be found in '/var/log/amanda/install.log'.
warning: %post(amanda-backup_client-3.3.2-1.rhel6.x86_64) scriptlet failed, exit status 4
uration: 1112(ms)
Installed products updated.
Installed:
amanda-backup_client.x86_64 0:3.3.2-1.rhel6
Complete!
#------------>set password for amandabackup
passwd amandabackup
* * *
* * *
##To recover on a Linux client, you must first specify the tape device on the server to use. In each Linux clients we change the file /etc/amanda/amanda-client.conf. Change this line:
tapedev “tape:/dev/YOUR-TAPE-DEVICE-HERE” # your tape device
to this:
tapedev “file://data/amanda/vtape/DailySet1″ # your tape device
#---------->add the amanda server to clients /etc/hosts
192.168.122.1 server.example.com
###NOW got to server and add the client
##at server.example.com
#we are going to add the client 192.168.122.99 to backup the /root for #client to DailySet1 tapes
----->-bash-4.1$ amaddclient --config DailySet1 --client 192.168.122.99 --diskdev /root --dumptype comp-user-tar
Logging to /var/log/amanda/amaddclient.20120925122047.debug
/etc/amanda/DailySet1/disklist updated
updating /var/lib/amanda/.amandahosts on server.example.com
Attempting to update /var/lib/amanda/.amandahosts on 192.168.122.99
#The authenticity of host '192.168.122.99 (192.168.122.99)' cant be established.
RSA key fingerprint is a3:be:8d:07:a8:f8:0b:af:25:bb:a5:b2:57:55:c5:14.
Are you sure you want to continue connecting (yes/no)? yes
#Warning: Permanently added '192.168.122.99' (RSA) to the list of known hosts.
#amandabackup@192.168.122.99's password:
amandahosts 100% 72 0.1KB/s 00:00
#amandabackup@192.168.122.99's password:
amandahosts.tmp 100% 112 0.1KB/s #00:00
192.168.122.99:/var/lib/amanda/.amandahosts updated successfully
#Creating amanda-client.conf for 192.168.122.99
Creating /etc/amanda/DailySet1 on 192.168.122.99
#amandabackup@192.168.122.99's password:
#amandabackup@192.168.122.99's password:
amanda-client.conf-192.168.122.99 100% 388 0.4KB/s 00:00
Copy /var/lib/amanda/amanda-client.conf-192.168.122.99 to 192.168.122.99 successfully
File /var/lib/amanda/example/xinetd.amandaclient contains the latest Amanda client daemon configuration.
Please merge it to /etc/xinetd.d/amandaclient.
------>cp /var/lib/amanda/example/xinetd.amandaclient /etc/xinetd.d/amandaclient
##adding client to servers amandahost
---->echo "client99.example.com root amindexd amidxtaped" >> /var/lib/amanda/.amandahosts
##adding cliennt to servers /etc/hosts
--->echo "192.168.122.99 client99.example.com" >> /etc/hosts
##
##
##Verifying the connection
##
---->-bash-4.1$ amcheck DailySet1
Amanda Tape Server Host Check
-----------------------------
found in slot 1: volume 'DailySet1-1'
slot 1: volume 'DailySet1-1'
Will write to volume 'DailySet1-1' in slot 1.
NOTE: skipping tape-writable test
NOTE: host info dir /etc/amanda/DailySet1/curinfo/192.168.122.99 does not exist
NOTE: it will be created on the next run.
NOTE: index dir /etc/amanda/DailySet1/index/192.168.122.99 does not exist
NOTE: it will be created on the next run.
Server check took 0.189 seconds
Amanda Backup Client Hosts Check
---------------------------------
Client check: 1 host checked in 2.101 seconds. 0 problems found.
(brought to you by Amanda 3.3.2)
##if its 0 problem found then its correct
####taking the backup
-bash-4.1$ amdump DailySet1
##it will be at /data/amanda/vtape/DailySet1/
###
###to recove a file
###
#adding client to servers amandahosts
--->echo "client99.example.com root amindexd amidxtaped" >> /var/lib/amanda/.amandahosts
###got to client
# backup will be at /data/amanda/vtape/DailySet1/
as user root
--->>
---->> amrecover DailySet1
AMRECOVER Version 3.1.0. Contacting server on server.example.com …
#to list the back up
amrecover> listdisk
#use set disk to load the folder
amrecover> setdisk /srv/www/htdocs/
# list the file
amrecover> ls
#add the needed file
amrecover> add *
#extract the added files
amrecover> extract
#exiting
amrecover> exit
200 Good bye.
Tuesday, September 25, 2012
Tuesday, September 18, 2012
Virtual installation in Rhel ,Fedora
#!/bin/bash
#configuring install-vserver
#kickstart configuration and adding entry into the pxelinux.0/default for virtual
echo"
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url=\"http://192.168.122.1/RHEL\"
repo --name=\"Red Hat Enterprise Linux\" --baseurl=http://192.168.122.1/RHEL --cost=100
# Root password
rootpw --iscrypted $1$kUpEHfw2$tJfHCPSVuVvMn7NwcwzJG/
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Kolkata
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --append=\"crashkernel=auto rhgb quiet\" --location=mbr --driveorder=\"vda\"
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype=\"ext4\" --size=200
part pv.01 --grow --size=1
volgroup myclient --pesize=4096 pv.01
logvol / --fstype=\"ext4\" --vgname=myclient --size=10240 --name=redhat
%post --interpreter=/bin/bash
sed -ie 's/id:3:initdefault:/id:5:initdefault:/g' /etc/inittab
%end
repo --name=\"Red Hat Enterprise Linux\" --baseurl=http://192.168.122.1/RHEL --cost=100
%packages
@base
@basic-desktop
@client-mgmt-tools
@core
@debugging
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@internet-browser
@java-platform
@kde-desktop
@legacy-x
@network-file-system-client
@perl-runtime
@print-client
@remote-desktop-clients
@server-platform
@server-policy
@x11
abrt-gui
alacarte
audit-viewer
bitmap-fixed-fonts
bitmap-lucida-typewriter-fonts
bltk
certmonger
cjkuni-fonts-ghostscript
dvgrab
firstaidkit-gui
gconf-editor
gedit-plugins
genisoimage
gnome-games
gnome-pilot
gnome-pilot-conduits
kdebase-workspace-akonadi
kdebase-workspace-python-applet
krb5-auth-dialog
krb5-workstation
libXmu
libXp
mtools
oddjob
openmotif
openmotif22
oprofile-gui
pam_krb5
pax
perl-DBD-SQLite
policycoreutils-gui
python-dmidecode
qt-mysql
qt-odbc
qt-postgresql
qt3-MySQL
qt3-ODBC
qt3-PostgreSQL
rdesktop
rhythmbox-upnp
sabayon
sabayon-apply
seahorse-plugins
setroubleshoot
sgpio
spice-client
spice-xpi
squashfs-tools
system-config-kickstart
system-config-lvm
systemtap-grapher
tigervnc
tigervnc-server
totem-upnp
tsclient
vim-X11
vinagre
wacomcpl
wodim
xguest
xorg-x11-fonts-75dpi
xorg-x11-fonts-ISO8859-1-75dpi
xorg-x11-fonts-ISO8859-14-100dpi
xorg-x11-fonts-ISO8859-14-75dpi
xorg-x11-fonts-ISO8859-15-75dpi
xorg-x11-fonts-ISO8859-2-100dpi
xorg-x11-fonts-ISO8859-2-75dpi
xorg-x11-fonts-ISO8859-9-100dpi
xorg-x11-fonts-ISO8859-9-75dpi
xorg-x11-fonts-cyrillic
xorg-x11-fonts-ethiopic
xorg-x11-twm
xorg-x11-xdm
xrestop
xterm
%end"> /var/www/html/ks.cfg
#restarting the dhcp server
service dhcpd restart
#virtual sh command to install virtual machine ---all packages of virtual must be installed
yum install -y *virt*
virt-install -n client -r 1500 --disk path=/var/lib/libvirt/images/client,size=12 --graphics spice --pxe --os-type=linux
virt-install -n client1 -r 1000 --disk path=/var/lib/libvirt/images/client1,size=12 -l http://192.168.122.2/RHEL --os-type=linux -x "ks=http://192.168.122.2/client.cfg"
#configuring install-vserver
#kickstart configuration and adding entry into the pxelinux.0/default for virtual
echo"
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url=\"http://192.168.122.1/RHEL\"
repo --name=\"Red Hat Enterprise Linux\" --baseurl=http://192.168.122.1/RHEL --cost=100
# Root password
rootpw --iscrypted $1$kUpEHfw2$tJfHCPSVuVvMn7NwcwzJG/
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Kolkata
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --append=\"crashkernel=auto rhgb quiet\" --location=mbr --driveorder=\"vda\"
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype=\"ext4\" --size=200
part pv.01 --grow --size=1
volgroup myclient --pesize=4096 pv.01
logvol / --fstype=\"ext4\" --vgname=myclient --size=10240 --name=redhat
%post --interpreter=/bin/bash
sed -ie 's/id:3:initdefault:/id:5:initdefault:/g' /etc/inittab
%end
repo --name=\"Red Hat Enterprise Linux\" --baseurl=http://192.168.122.1/RHEL --cost=100
%packages
@base
@basic-desktop
@client-mgmt-tools
@core
@debugging
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@input-methods
@internet-browser
@java-platform
@kde-desktop
@legacy-x
@network-file-system-client
@perl-runtime
@print-client
@remote-desktop-clients
@server-platform
@server-policy
@x11
abrt-gui
alacarte
audit-viewer
bitmap-fixed-fonts
bitmap-lucida-typewriter-fonts
bltk
certmonger
cjkuni-fonts-ghostscript
dvgrab
firstaidkit-gui
gconf-editor
gedit-plugins
genisoimage
gnome-games
gnome-pilot
gnome-pilot-conduits
kdebase-workspace-akonadi
kdebase-workspace-python-applet
krb5-auth-dialog
krb5-workstation
libXmu
libXp
mtools
oddjob
openmotif
openmotif22
oprofile-gui
pam_krb5
pax
perl-DBD-SQLite
policycoreutils-gui
python-dmidecode
qt-mysql
qt-odbc
qt-postgresql
qt3-MySQL
qt3-ODBC
qt3-PostgreSQL
rdesktop
rhythmbox-upnp
sabayon
sabayon-apply
seahorse-plugins
setroubleshoot
sgpio
spice-client
spice-xpi
squashfs-tools
system-config-kickstart
system-config-lvm
systemtap-grapher
tigervnc
tigervnc-server
totem-upnp
tsclient
vim-X11
vinagre
wacomcpl
wodim
xguest
xorg-x11-fonts-75dpi
xorg-x11-fonts-ISO8859-1-75dpi
xorg-x11-fonts-ISO8859-14-100dpi
xorg-x11-fonts-ISO8859-14-75dpi
xorg-x11-fonts-ISO8859-15-75dpi
xorg-x11-fonts-ISO8859-2-100dpi
xorg-x11-fonts-ISO8859-2-75dpi
xorg-x11-fonts-ISO8859-9-100dpi
xorg-x11-fonts-ISO8859-9-75dpi
xorg-x11-fonts-cyrillic
xorg-x11-fonts-ethiopic
xorg-x11-twm
xorg-x11-xdm
xrestop
xterm
%end"> /var/www/html/ks.cfg
#restarting the dhcp server
service dhcpd restart
#virtual sh command to install virtual machine ---all packages of virtual must be installed
yum install -y *virt*
virt-install -n client -r 1500 --disk path=/var/lib/libvirt/images/client,size=12 --graphics spice --pxe --os-type=linux
virt-install -n client1 -r 1000 --disk path=/var/lib/libvirt/images/client1,size=12 -l http://192.168.122.2/RHEL --os-type=linux -x "ks=http://192.168.122.2/client.cfg"
Setting up a PXE BOOT server @RHEL,FEDORA
#This is a configuration script for making a pxe boot server for rhel
#Packages needed are
#1.sylinux
#2.any server to share rhel cd/dvd source and kickstarts ---here ve use httpd
#3.kickstart
#4.tftp-server
#5.xinet
#6.dhcp
#---------------------------------------------------------------
#configuring syslinux
yum install -y syslinux
#--------------------------------------------------------------
#configuring the httpd
yum install -y httpd
service httpd restart
chkconfig httpd on
#mount the rhel iso to /var/www/html/RHEL
#---------------------------------------------------------------
#creating the correct kickstart file in the httpd server
echo "
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url=\"http://192.168.122.1/RHEL\"
repo --name=\"Red Hat Enterprise Linux\" --baseurl=http://192.168.122.1/RHEL --cost=100
# Root password
rootpw --iscrypted $1$kUpEHfw2$tJfHCPSVuVvMn7NwcwzJG/
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Kolkata
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --append=\"crashkernel=auto rhgb quiet\" --location=mbr --driveorder=\"sda\"
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype=\"ext4\" --size=200
part pv.01 --grow --size=1
volgroup myclient --pesize=4096 pv.01
logvol / --fstype=\"ext4\" --vgname=myclient --size=50240 --name=redhat
%post --interpreter=/bin/bash
sed -ie 's/id:3:initdefault:/id:5:initdefault:/g' /etc/inittab
touch /usr/bin/install-client < "
virt-install -n client -r 1500 --disk path=/var/lib/libvirt/images/client,size=12 --pxe --os-type=linux"
install-client
%end
repo --name=\"Red Hat Enterprise Linux\" --baseurl=http://192.168.122.1/RHEL --cost=100
%packages
@base
@client-mgmt-tools
@console-internet
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@hardware-monitoring
@input-methods
@java-platform
@kde-desktop
@large-systems
@legacy-x
@network-file-system-client
@performance
@perl-runtime
@remote-desktop-clients
@server-platform
@server-policy
@virtualization
@virtualization-client
@virtualization-platform
@virtualization-tools
@x11
mtools
pax
python-dmidecode
oddjob
squashfs-tools
sgpio
genisoimage
wodim
sabayon-apply
xguest
tigervnc-server
oprofile-gui
abrt-gui
xrestop
systemtap-grapher
bltk
qt-mysql
qt3-ODBC
qt-odbc
qt-postgresql
qt3-PostgreSQL
qt3-MySQL
certmonger
pam_krb5
krb5-workstation
cjkuni-fonts-ghostscript
bitmap-fixed-fonts
bitmap-lucida-typewriter-fonts
krb5-auth-dialog
gnome-pilot-conduits
gconf-editor
dvgrab
alacarte
seahorse-plugins
rhythmbox-upnp
gnome-games
gedit-plugins
gnome-pilot
totem-upnp
vim-X11
sabayon
system-config-lvm
audit-viewer
setroubleshoot
firstaidkit-gui
system-config-kickstart
policycoreutils-gui
kdebase-workspace-akonadi
kdebase-workspace-python-applet
xorg-x11-twm
openmotif
xorg-x11-fonts-ISO8859-1-75dpi
xterm
xorg-x11-fonts-cyrillic
xorg-x11-xdm
xorg-x11-fonts-ISO8859-9-100dpi
xorg-x11-fonts-ISO8859-14-100dpi
xorg-x11-fonts-75dpi
xorg-x11-fonts-ISO8859-9-75dpi
libXmu
xorg-x11-fonts-ISO8859-15-75dpi
libXp
openmotif22
xorg-x11-fonts-ISO8859-14-75dpi
xorg-x11-fonts-ISO8859-2-75dpi
xorg-x11-fonts-ethiopic
xorg-x11-fonts-ISO8859-2-100dpi
perl-DBD-SQLite
spice-xpi
tsclient
rdesktop
vinagre
tigervnc
spice-client
qemu-kvm-tools
fence-virtd-serial
fence-virtd-multicast
libvirt-java
libvirt-cim
fence-virtd-libvirt
perl-Sys-Virt
libvirt-qpid
libguestfs-java
virt-v2v
libguestfs-tools
libguestfs-mount
wacomcpl
%end"> /var/www/html/pxe.cfg
#------------------------------------------------------------------------------
#configure the tftp server
yum install -y tftp-server
#copying the needed file file pxelinux.0 from syslinux to /var/lib/tftpboot
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
#making a directory pxelinux.cfg to store the default menu
mkdir -p /var/lib/tftpboot/pxelinux.cfg
#making the default file with kernal to load and correct shared kickstart file
touch /var/lib/tftpboot/pxelinux.cfg/default
echo "
default menu.c32
menu title BOOT MENU
label redhat
kernel rhel/vmlinuz
append initrd=rhel/initrd.img ks=http://192.168.122.1/pxe.cfg
" > /var/lib/tftpboot/pxelinux.cfg/default
vim /var/lib/tftpboot/pxelinux.cfg/default
#copying menu.c32 into /var/lib/tftpboot/
cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
#copiying splash image for boot menu
cp /boot/grub/splash.xpm.gz /var/lib/tftpboot/
#---------------------------------------------------------------------------
#configure xinet files
yum install -y xinetd
#change the disabled paremeter form yes to no in /etc/xinet.d/tftp
echo "diable = no ">> /etc/xinetd.d/tftp
vim /etc/xinetd.d/tftp
service xinetd restart
chkconfig xinetd on
#----------------------------------------------------------------------------
# Before starting this script you must configure the dhcp server properly
#do the needed dhcp setting for the pxe
yum install -y dhcp
echo "
option domain-name \"server.example.com\";
option routers 192.168.122.1;
Allow booting;
Allow bootp;
next-server 192.168.122.1; <<---------pxe server ip
filename \"pxelinux.0\";
" >> /etc/dhcp/dhcpd.conf
#Openeing the dhcp file for editing
vim /etc/dhcp/dhcpd.conf
#dhcpd service is restarted and chkconfig is done
service dhcpd restart
chkconfig dhcpd on
#Packages needed are
#1.sylinux
#2.any server to share rhel cd/dvd source and kickstarts ---here ve use httpd
#3.kickstart
#4.tftp-server
#5.xinet
#6.dhcp
#---------------------------------------------------------------
#configuring syslinux
yum install -y syslinux
#--------------------------------------------------------------
#configuring the httpd
yum install -y httpd
service httpd restart
chkconfig httpd on
#mount the rhel iso to /var/www/html/RHEL
#---------------------------------------------------------------
#creating the correct kickstart file in the httpd server
echo "
#platform=x86, AMD64, or Intel EM64T
#version=DEVEL
# Firewall configuration
firewall --disabled
# Install OS instead of upgrade
install
# Use network installation
url --url=\"http://192.168.122.1/RHEL\"
repo --name=\"Red Hat Enterprise Linux\" --baseurl=http://192.168.122.1/RHEL --cost=100
# Root password
rootpw --iscrypted $1$kUpEHfw2$tJfHCPSVuVvMn7NwcwzJG/
# System authorization information
auth --useshadow --passalgo=sha512
# Use text mode install
text
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# SELinux configuration
selinux --disabled
# Installation logging level
logging --level=info
# Reboot after installation
reboot
# System timezone
timezone Asia/Kolkata
# Network information
network --bootproto=dhcp --device=eth0 --onboot=on
# System bootloader configuration
bootloader --append=\"crashkernel=auto rhgb quiet\" --location=mbr --driveorder=\"sda\"
# Clear the Master Boot Record
zerombr
# Partition clearing information
clearpart --all --initlabel
# Disk partitioning information
part /boot --fstype=\"ext4\" --size=200
part pv.01 --grow --size=1
volgroup myclient --pesize=4096 pv.01
logvol / --fstype=\"ext4\" --vgname=myclient --size=50240 --name=redhat
%post --interpreter=/bin/bash
sed -ie 's/id:3:initdefault:/id:5:initdefault:/g' /etc/inittab
touch /usr/bin/install-client < "
virt-install -n client -r 1500 --disk path=/var/lib/libvirt/images/client,size=12 --pxe --os-type=linux"
install-client
%end
repo --name=\"Red Hat Enterprise Linux\" --baseurl=http://192.168.122.1/RHEL --cost=100
%packages
@base
@client-mgmt-tools
@console-internet
@core
@debugging
@basic-desktop
@desktop-debugging
@desktop-platform
@directory-client
@fonts
@general-desktop
@graphical-admin-tools
@hardware-monitoring
@input-methods
@java-platform
@kde-desktop
@large-systems
@legacy-x
@network-file-system-client
@performance
@perl-runtime
@remote-desktop-clients
@server-platform
@server-policy
@virtualization
@virtualization-client
@virtualization-platform
@virtualization-tools
@x11
mtools
pax
python-dmidecode
oddjob
squashfs-tools
sgpio
genisoimage
wodim
sabayon-apply
xguest
tigervnc-server
oprofile-gui
abrt-gui
xrestop
systemtap-grapher
bltk
qt-mysql
qt3-ODBC
qt-odbc
qt-postgresql
qt3-PostgreSQL
qt3-MySQL
certmonger
pam_krb5
krb5-workstation
cjkuni-fonts-ghostscript
bitmap-fixed-fonts
bitmap-lucida-typewriter-fonts
krb5-auth-dialog
gnome-pilot-conduits
gconf-editor
dvgrab
alacarte
seahorse-plugins
rhythmbox-upnp
gnome-games
gedit-plugins
gnome-pilot
totem-upnp
vim-X11
sabayon
system-config-lvm
audit-viewer
setroubleshoot
firstaidkit-gui
system-config-kickstart
policycoreutils-gui
kdebase-workspace-akonadi
kdebase-workspace-python-applet
xorg-x11-twm
openmotif
xorg-x11-fonts-ISO8859-1-75dpi
xterm
xorg-x11-fonts-cyrillic
xorg-x11-xdm
xorg-x11-fonts-ISO8859-9-100dpi
xorg-x11-fonts-ISO8859-14-100dpi
xorg-x11-fonts-75dpi
xorg-x11-fonts-ISO8859-9-75dpi
libXmu
xorg-x11-fonts-ISO8859-15-75dpi
libXp
openmotif22
xorg-x11-fonts-ISO8859-14-75dpi
xorg-x11-fonts-ISO8859-2-75dpi
xorg-x11-fonts-ethiopic
xorg-x11-fonts-ISO8859-2-100dpi
perl-DBD-SQLite
spice-xpi
tsclient
rdesktop
vinagre
tigervnc
spice-client
qemu-kvm-tools
fence-virtd-serial
fence-virtd-multicast
libvirt-java
libvirt-cim
fence-virtd-libvirt
perl-Sys-Virt
libvirt-qpid
libguestfs-java
virt-v2v
libguestfs-tools
libguestfs-mount
wacomcpl
%end"> /var/www/html/pxe.cfg
#------------------------------------------------------------------------------
#configure the tftp server
yum install -y tftp-server
#copying the needed file file pxelinux.0 from syslinux to /var/lib/tftpboot
cp /usr/share/syslinux/pxelinux.0 /var/lib/tftpboot/
#making a directory pxelinux.cfg to store the default menu
mkdir -p /var/lib/tftpboot/pxelinux.cfg
#making the default file with kernal to load and correct shared kickstart file
touch /var/lib/tftpboot/pxelinux.cfg/default
echo "
default menu.c32
menu title BOOT MENU
label redhat
kernel rhel/vmlinuz
append initrd=rhel/initrd.img ks=http://192.168.122.1/pxe.cfg
" > /var/lib/tftpboot/pxelinux.cfg/default
vim /var/lib/tftpboot/pxelinux.cfg/default
#copying menu.c32 into /var/lib/tftpboot/
cp /usr/share/syslinux/menu.c32 /var/lib/tftpboot/
#copiying splash image for boot menu
cp /boot/grub/splash.xpm.gz /var/lib/tftpboot/
#---------------------------------------------------------------------------
#configure xinet files
yum install -y xinetd
#change the disabled paremeter form yes to no in /etc/xinet.d/tftp
echo "diable = no ">> /etc/xinetd.d/tftp
vim /etc/xinetd.d/tftp
service xinetd restart
chkconfig xinetd on
#----------------------------------------------------------------------------
# Before starting this script you must configure the dhcp server properly
#do the needed dhcp setting for the pxe
yum install -y dhcp
echo "
option domain-name \"server.example.com\";
option routers 192.168.122.1;
Allow booting;
Allow bootp;
next-server 192.168.122.1; <<---------pxe server ip
filename \"pxelinux.0\";
" >> /etc/dhcp/dhcpd.conf
#Openeing the dhcp file for editing
vim /etc/dhcp/dhcpd.conf
#dhcpd service is restarted and chkconfig is done
service dhcpd restart
chkconfig dhcpd on
Subscribe to:
Posts (Atom)