Creating a simple, reliable kickstart network install point
Posted: 2012/02/21 04:12:20
Created a network install point.
[root@solaria RPM]# pwd
/var/www/html/network-install/RPM
[root@solaria RPM]# ls -lart
total 1088
drwxr-xr-x. 2 root root 4096 Dec 10 17:36 isolinux
drwxr-xr-x. 3 root root 4096 Dec 10 17:38 images
drwxr-xr-x. 3 root root 4096 Dec 10 17:38 EFI
-rw-r--r--. 1 root root 1734 Jan 14 23:55 RPM-GPG-KEY-CentOS-Testing-6
-rw-r--r--. 1 root root 1730 Jan 14 23:55 RPM-GPG-KEY-CentOS-Security-6
-rw-r--r--. 1 root root 1730 Jan 14 23:55 RPM-GPG-KEY-CentOS-Debug-6
-rw-r--r--. 1 root root 1706 Jan 14 23:55 RPM-GPG-KEY-CentOS-6
-rw-r--r--. 1 root root 2251 Feb 19 22:25 mars-ks.cfg
-rw-r--r--. 1 root root 31 Feb 19 22:41 .discinfo
-rw-r--r--. 1 root root 338 Feb 19 22:41 .treeinfo
-rw-r--r--. 1 apache apache 338 Feb 19 22:43 treeinfo
-rw-r--r--. 1 root root 171 Feb 20 19:31 installerror.txt
drwxr-xr-x. 4 root root 4096 Feb 20 19:49 ..
drwxr-xr-x. 4 root root 598016 Feb 20 20:57 Packages
drwxr-xr-x. 6 root root 462848 Feb 20 20:57 .
cp -av from the iso files mounted mount - o loop /mountpoint
[root@solaria RPM]# cat .discinfo
1323560292.885204
6.2
x86_64
1
[root@solaria RPM]# cat .treeinfo
[general]
family = CentOS
timestamp = 1323560005.81
variant =
totaldiscs = 1
version = 6.2
discnum = 1
packagedir =
arch = x86_64
[images-x86_64]
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img
[images-xen]
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img
[stage2]
mainimage = images/install.img
Copied in .treeinfo .discinfo from the original media.
Wanting to create consistent vm machines with kickstart
Here is the script that kicks off the install
[root@solaria ~]# cat makekvm.ksh
#!/bin/ksh
name=$1
filename="/var/lib/libvirt/images/${name}.rh6.img"
virt-install --network network:default --name=${name} --ram=1024 --vnc --file=${filename} --file-size=30 --location=http://192.168.122.1/network-install/RPM -x "ks=http://192.168.122.1/network-install/RPM/mars-ks.cfg ksdevice=eth0 ip=192.168.122.30 netmask=255.255.255.0 dns=192.168.0.1 gateway=192.168.0.1"
Here is the kickstart file
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
url --url http://192.168.122.1/network-install/RPM
lang en_US.UTF-8
keyboard us
# network --onboot no --device eth0 --noipv4 --noipv6
network --bootproto=static --device=eth0 --ip=192.168.122.30 --netmask=255.255.2
55.0 --gateway=192.168.122.1 --onboot=on --hostname=mars --noipv6
rootpw --iscrypted $6$zhvbOyiIpHC3Pglj$3yLqHyZ.8aPWKhemyO9aqQEpAvFgKpYvdrDx8gw1
7NMDi85zlYIogATIRIKNloQiKF1c8hJenVgj/MnJbd1LD1
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc America/Chicago
bootloader --location=mbr --driveorder=sda --append=" rhgb crashkernel=auto quie
t"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --none
part /boot --fstype=ext4 --size=512
part pv.008002 --grow --size=200
volgroup vg_mars --pesize=4096 pv.008002
logvol / --fstype=ext4 --name=LogVol00 --vgname=vg_mars --size=2048
logvol swap --name=LogVol01 --vgname=vg_mars --size=1024
logvol /usr --fstype=ext4 --name=LogVol02 --vgname=vg_mars --size=4096
logvol /var --fstype=ext4 --name=LogVol03 --vgname=vg_mars --size=23036
#repo --name="CentOS" --baseurl=file///var/www/html/repo --cost=100
#repo --name="CentOS" --baseurl=nfs///iso --cost=100
repo --name="CentOS" --baseurl=http://192.168.122.1/network-install/RPM
%packages
@base
@client-mgmt-tools
@console-internet
@core
@debugging
@directory-client
@hardware-monitoring
@ha
@ha-management
@java-platform
@large-systems
@load-balancer
@system-management-messaging-client
@mysql-client
@mysql
@storage-server
@network-file-system-client
@php
@performance
@perl-runtime
@resilient-storage
@system-management-snmp
@scalable-file-systems
@server-platform
@server-policy
@system-admin-tools
@turbogears
@virtualization
@virtualization-client
@virtualization-platform
@virtualization-tools
@web-server
@web-servlet
pax
oddjob
sgpio
genisoimage
certmonger
pam_krb5
krb5-workstation
perl-DBD-MySQL
sg3_utils
perl-DBD-SQLite
pexpect
crypto-utils
scrub
certmonger
perl-CGI
%end
%post
chkconfig isdn off
chkconfig pcmcia off
chkconfig apmd off
I'm pretty sure I'm missing the right createrepo command and location to run it from
createrepo -g $PWD
Install is crashing unable to find the group file
My install script is also running into a minor annoyance, the disk carving the disk up. I'm attaching a screen shot of the error.
I'd like to tweak the kickstart file so the install is completely unattended.
See attached screen shot. I will upload the repodata/ files as well.
[root@solaria RPM]# pwd
/var/www/html/network-install/RPM
[root@solaria RPM]# ls -lart
total 1088
drwxr-xr-x. 2 root root 4096 Dec 10 17:36 isolinux
drwxr-xr-x. 3 root root 4096 Dec 10 17:38 images
drwxr-xr-x. 3 root root 4096 Dec 10 17:38 EFI
-rw-r--r--. 1 root root 1734 Jan 14 23:55 RPM-GPG-KEY-CentOS-Testing-6
-rw-r--r--. 1 root root 1730 Jan 14 23:55 RPM-GPG-KEY-CentOS-Security-6
-rw-r--r--. 1 root root 1730 Jan 14 23:55 RPM-GPG-KEY-CentOS-Debug-6
-rw-r--r--. 1 root root 1706 Jan 14 23:55 RPM-GPG-KEY-CentOS-6
-rw-r--r--. 1 root root 2251 Feb 19 22:25 mars-ks.cfg
-rw-r--r--. 1 root root 31 Feb 19 22:41 .discinfo
-rw-r--r--. 1 root root 338 Feb 19 22:41 .treeinfo
-rw-r--r--. 1 apache apache 338 Feb 19 22:43 treeinfo
-rw-r--r--. 1 root root 171 Feb 20 19:31 installerror.txt
drwxr-xr-x. 4 root root 4096 Feb 20 19:49 ..
drwxr-xr-x. 4 root root 598016 Feb 20 20:57 Packages
drwxr-xr-x. 6 root root 462848 Feb 20 20:57 .
cp -av from the iso files mounted mount - o loop /mountpoint
[root@solaria RPM]# cat .discinfo
1323560292.885204
6.2
x86_64
1
[root@solaria RPM]# cat .treeinfo
[general]
family = CentOS
timestamp = 1323560005.81
variant =
totaldiscs = 1
version = 6.2
discnum = 1
packagedir =
arch = x86_64
[images-x86_64]
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img
[images-xen]
kernel = images/pxeboot/vmlinuz
initrd = images/pxeboot/initrd.img
[stage2]
mainimage = images/install.img
Copied in .treeinfo .discinfo from the original media.
Wanting to create consistent vm machines with kickstart
Here is the script that kicks off the install
[root@solaria ~]# cat makekvm.ksh
#!/bin/ksh
name=$1
filename="/var/lib/libvirt/images/${name}.rh6.img"
virt-install --network network:default --name=${name} --ram=1024 --vnc --file=${filename} --file-size=30 --location=http://192.168.122.1/network-install/RPM -x "ks=http://192.168.122.1/network-install/RPM/mars-ks.cfg ksdevice=eth0 ip=192.168.122.30 netmask=255.255.255.0 dns=192.168.0.1 gateway=192.168.0.1"
Here is the kickstart file
# Kickstart file automatically generated by anaconda.
#version=DEVEL
install
url --url http://192.168.122.1/network-install/RPM
lang en_US.UTF-8
keyboard us
# network --onboot no --device eth0 --noipv4 --noipv6
network --bootproto=static --device=eth0 --ip=192.168.122.30 --netmask=255.255.2
55.0 --gateway=192.168.122.1 --onboot=on --hostname=mars --noipv6
rootpw --iscrypted $6$zhvbOyiIpHC3Pglj$3yLqHyZ.8aPWKhemyO9aqQEpAvFgKpYvdrDx8gw1
7NMDi85zlYIogATIRIKNloQiKF1c8hJenVgj/MnJbd1LD1
firewall --service=ssh
authconfig --enableshadow --passalgo=sha512
selinux --enforcing
timezone --utc America/Chicago
bootloader --location=mbr --driveorder=sda --append=" rhgb crashkernel=auto quie
t"
# The following is the partition information you requested
# Note that any partitions you deleted are not expressed
# here so unless you clear all partitions first, this is
# not guaranteed to work
clearpart --none
part /boot --fstype=ext4 --size=512
part pv.008002 --grow --size=200
volgroup vg_mars --pesize=4096 pv.008002
logvol / --fstype=ext4 --name=LogVol00 --vgname=vg_mars --size=2048
logvol swap --name=LogVol01 --vgname=vg_mars --size=1024
logvol /usr --fstype=ext4 --name=LogVol02 --vgname=vg_mars --size=4096
logvol /var --fstype=ext4 --name=LogVol03 --vgname=vg_mars --size=23036
#repo --name="CentOS" --baseurl=file///var/www/html/repo --cost=100
#repo --name="CentOS" --baseurl=nfs///iso --cost=100
repo --name="CentOS" --baseurl=http://192.168.122.1/network-install/RPM
%packages
@base
@client-mgmt-tools
@console-internet
@core
@debugging
@directory-client
@hardware-monitoring
@ha
@ha-management
@java-platform
@large-systems
@load-balancer
@system-management-messaging-client
@mysql-client
@mysql
@storage-server
@network-file-system-client
@php
@performance
@perl-runtime
@resilient-storage
@system-management-snmp
@scalable-file-systems
@server-platform
@server-policy
@system-admin-tools
@turbogears
@virtualization
@virtualization-client
@virtualization-platform
@virtualization-tools
@web-server
@web-servlet
pax
oddjob
sgpio
genisoimage
certmonger
pam_krb5
krb5-workstation
perl-DBD-MySQL
sg3_utils
perl-DBD-SQLite
pexpect
crypto-utils
scrub
certmonger
perl-CGI
%end
%post
chkconfig isdn off
chkconfig pcmcia off
chkconfig apmd off
I'm pretty sure I'm missing the right createrepo command and location to run it from
createrepo -g $PWD
Install is crashing unable to find the group file
My install script is also running into a minor annoyance, the disk carving the disk up. I'm attaching a screen shot of the error.
I'd like to tweak the kickstart file so the install is completely unattended.
See attached screen shot. I will upload the repodata/ files as well.