CobblerTest

From WBITT's Cooker!

(Difference between revisions)
Jump to: navigation, search
(=)
(=)
Line 722: Line 722:
</pre>
</pre>
-
===========================================
+
= Day 3. Few other issues.=
-
Now the few other issues.  
+
My nodes installed properly and booted properly. However they were taking too much time in trying to obtain IP for eth0 interface through dhcp. Since there is no dhcp on eth0 and I don't need to enable the eth0 interface in OS, because it is enabled and properly configured in the BIOS already, I had to find a way to fix that. Here are four items which I wanted to know the solution:
-
1) Static IP for eth1, and see if it still installs from DHCP server.
+
1) Static IP for eth1. Means, after installation of a node is complete, it should have a static IP configured in it instead of asking that from DHCP server.
-
2) disable eth0 so it does not wait for dhcp when the node reboots in to local os /disk.  
+
2) Disable eth0, so it does not wait for dhcp when the node reboots from local OS/disk.  
-
3) How to check if the nodes are installed?
+
3) Console redirection during TFTP and installation. I want to see the console of the node on my headnode, instead of manually seeing it on the KVM. (It does not make sense to run to the data center everytime you need to look at screen of a node.)
-
4) Console redirection during TFTP and installation.
+
4) How to check if the nodes are installed? Pretty important!
-
-------------------
 
1) Static IP:-
1) Static IP:-
 +
Simply add a --static=1 to either the cobbler system add command, or modify an already defined system with this setting.
 +
<pre>
[root@headnode ~]# cobbler system edit --name compute1 --interface=eth1 --static=1
[root@headnode ~]# cobbler system edit --name compute1 --interface=eth1 --static=1
 +
</pre>
 +
This is the solution for setting static IP, post-reboot. The installation got done through PXE (good).
This is the solution for setting static IP, post-reboot. The installation got done through PXE (good).
-
Here is what cobbler did:-
+
Here is what cobbler did, after the node is installed and rebooted from local disk:-
 +
<pre>
[root@compute1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
[root@compute1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
DEVICE=eth1
Line 749: Line 753:
NETMASK=255.255.255.0
NETMASK=255.255.255.0
[root@compute1 ~]#
[root@compute1 ~]#
 +
</pre>
 +
This is exactly what I wanted. Good.
-
2) disable eth0
 
-
[root@headnode ~]# cobbler system edit --name=compute1 --delete-interface=eth0
 
-
(I don't know, if it will work)
 
-
This did not work. Lets set eth0 as static. so it won't waste time on waiting for DHCP and failing.
+
2) Disable eth0. For this, I used the same technique. I just mentioned that it is also static, and did not provide any IP for it. That is because the (out of band) IP is already configured in the node's BIOS.
 +
<pre>
[root@headnode ~]# cobbler system edit --name compute1 --interface=eth0 --static=1
[root@headnode ~]# cobbler system edit --name compute1 --interface=eth0 --static=1
Line 780: Line 784:
[root@headnode ~]#                           
[root@headnode ~]#                           
 +
</pre>
-
This time it worked. I have lovely results!
+
 
 +
Note that --delete-interface did NOT do the trick.
 +
 
 +
<pre>
 +
[root@headnode ~]# cobbler system edit --name=compute1 --delete-interface=eth0
 +
 
 +
This did not work.
 +
</pre>
 +
 
 +
 
 +
This time it worked. I have lovely results after the nodes are installed and rebooted!
[root@compute1 ~]# ifconfig
[root@compute1 ~]# ifconfig
Line 812: Line 827:
Notice that Cobbler set BOOTPROTO=none for eth0.  
Notice that Cobbler set BOOTPROTO=none for eth0.  
 +
</pre>
-
However the node was not able to ping any other node on IPMI interface. hmmmmmmm.
+
However the node WILL NOT ping any other node on IPMI interface. This is only controllable/ do-able in one direction, from headnode towards compute node. Remember that the headnode's management interface HAS an out of band IP configured in the OS.
 +
Thus, don't be alarmed if you see the following, while you are logged in to any of the compute nodes:
 +
<pre>
[root@compute1 ~]# ping 192.168.0.200
[root@compute1 ~]# ping 192.168.0.200
connect: Network is unreachable
connect: Network is unreachable
Line 821: Line 839:
connect: Network is unreachable
connect: Network is unreachable
[root@compute1 ~]#
[root@compute1 ~]#
 +
</pre>
-
-------------------------
+
End of day 3.
-
Trying this:-
+
= Day 4. (3) Console redirection. =
-
[root@headnode ~]# cobbler system edit --name=compute1 --delete-interface=eth0
+
-
This did not help prevent eth0 asking for dhcp / IP.
+
We set certain parameters in the distro and profile options.
-
 
+
-
 
+
-
----------------------
+
-
 
+
-
Day n+1 (3?)
+
-
--------------
+
-
 
+
-
How to pass console redirection options to TFTP file:-
+
 +
<pre>
[root@headnode ~]# cobbler distro list
[root@headnode ~]# cobbler distro list
Centos5.4-x86_64
Centos5.4-x86_64
Centos5.4-xen-x86_64
Centos5.4-xen-x86_64
[root@headnode ~]#
[root@headnode ~]#
-
 
+
</pre>
Centos5.4-x86_64 is the distro we are using for provisioning the nodes.
Centos5.4-x86_64 is the distro we are using for provisioning the nodes.
 +
<pre>
[root@headnode ~]# cobbler distro report --name=Centos5.4-x86_64
[root@headnode ~]# cobbler distro report --name=Centos5.4-x86_64
distro              : Centos5.4-x86_64
distro              : Centos5.4-x86_64
Line 864: Line 876:
redhat mgmt server  : <<inherit>>
redhat mgmt server  : <<inherit>>
template files      : {}
template files      : {}
-
 
[root@headnode ~]#
[root@headnode ~]#
 +
[root@headnode ~]# cobbler distro edit --name=Centos5.4-x86_64 --kopts="console=ttyS1,115200"
[root@headnode ~]# cobbler distro edit --name=Centos5.4-x86_64 --kopts="console=ttyS1,115200"
 +
[root@headnode ~]# cobbler distro report --name=Centos5.4-x86_64
[root@headnode ~]# cobbler distro report --name=Centos5.4-x86_64
Line 890: Line 903:
[root@headnode ~]#
[root@headnode ~]#
-
 
+
</pre>
Now check the profiles:-
Now check the profiles:-
 +
<pre>
[root@headnode ~]# cobbler profile list
[root@headnode ~]# cobbler profile list
Centos5.4-x86_64
Centos5.4-x86_64
Line 901: Line 915:
rescue-Centos5.4-x86_64
rescue-Centos5.4-x86_64
[root@headnode ~]#
[root@headnode ~]#
 +
</pre>
We are interested in profile named "ComputeNodes":-
We are interested in profile named "ComputeNodes":-
 +
<pre>
[root@headnode ~]# cobbler profile report --name=ComputeNodes
[root@headnode ~]# cobbler profile report --name=ComputeNodes
profile              : ComputeNodes
profile              : ComputeNodes
Line 934: Line 950:
[root@headnode ~]#     
[root@headnode ~]#     
-
 
[root@headnode ~]# cobbler profile edit --name=ComputeNodes --ksmeta="console=ttyS1,115200"
[root@headnode ~]# cobbler profile edit --name=ComputeNodes --ksmeta="console=ttyS1,115200"
Line 942: Line 957:
Starting dhcpd:                                            [  OK  ]
Starting dhcpd:                                            [  OK  ]
[root@headnode ~]#  
[root@headnode ~]#  
 +
</pre>
 +
 +
Try re-provisioning the node and see if it works.
 +
<pre>
[root@headnode ~]# cobbler system edit --name compute1 --netboot-enabled=1
[root@headnode ~]# cobbler system edit --name compute1 --netboot-enabled=1
Line 961: Line 980:
[root@headnode ~]#
[root@headnode ~]#
 +
</pre>
-
--------------------
+
Notice the console option in the newly generated TFTP file above.
-
ipmiconsole
+
 +
 +
= ipmiconsole =
 +
 +
Use the ipmiconsole command to open console of a remote node on the headnode.
 +
 +
<pre>
[root@headnode ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=ipmisecret
[root@headnode ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=ipmisecret
-
ipmiconsole_submit_block: internal system error
+
[SOL established]
 +
</pre>
-
[root@headnode ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=redhat
+
Note, if you get an error such as below, that means your headnode, does not have BMC interface correctly configured.  Assign it an IP from your BMC network and bring the interface up. It should work.
 +
 
 +
The error:
 +
<pre>
 +
[root@headnode ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=ipmisecret
ipmiconsole_submit_block: internal system error
ipmiconsole_submit_block: internal system error
 +
</pre>
 +
 +
The reason:
 +
<pre>
[root@headnode ~]# ifconfig
[root@headnode ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1D:09:69:F3:BB
eth0      Link encap:Ethernet  HWaddr 00:1D:09:69:F3:BB
Line 981: Line 1,015:
           inet addr:127.0.0.1  Mask:255.0.0.0
           inet addr:127.0.0.1  Mask:255.0.0.0
           inet6 addr: ::1/128 Scope:Host
           inet6 addr: ::1/128 Scope:Host
 +
</pre>
 +
 +
The fix:
 +
<pre>
[root@headnode ~]# ifconfig eth0 192.168.0.201 netmask 255.255.255.0 up
[root@headnode ~]# ifconfig eth0 192.168.0.201 netmask 255.255.255.0 up
Line 999: Line 1,037:
[SOL established]
[SOL established]
-
-----------------
+
</pre>
 +
 
 +
= power on/off =
 +
Use ipmipower command to perform power operations on the nodes.
 +
 
 +
<pre>
 +
[root@headnode ~]# ipmipower --hostname=192.168.0.1 --username=root --password=ipmisecret --on
 +
192.168.0.1: ok
 +
</pre>
Also if the node is off, cycle may not work:-
Also if the node is off, cycle may not work:-
 +
<pre>
[root@headnode ~]# ipmipower --hostname=192.168.0.1 --username=root --password=ipmisecret --cycle
[root@headnode ~]# ipmipower --hostname=192.168.0.1 --username=root --password=ipmisecret --cycle
192.168.0.1: operation invalid
192.168.0.1: operation invalid
Line 1,012: Line 1,059:
192.168.0.1: ok
192.168.0.1: ok
[root@headnode ~]#
[root@headnode ~]#
 +
</pre>
-
-----------------------------------
 
 +
= Problem with console entries =
-
When using console=ttyS1,57600n8r , we get a node install time slowed down 5 times. Without it, the node install time was 1 minute. With it the node install time reached 5+ minutes.
+
When using console=ttyS1,57600n8r , we get a node install time slowed down 5 times. Without it, the node install time was 1 minute. With it, the node install time reached 5+ minutes.
Using 115200 as console bnaud rate shows too much garbage on ipmiconsole as soon as the TFTP boot image is read. Before that, the BIOS display part is ok.
Using 115200 as console bnaud rate shows too much garbage on ipmiconsole as soon as the TFTP boot image is read. Before that, the BIOS display part is ok.
-
Why is that?
 
-
 
-
--------------
 
-
Why two console= options in Scali and CVOS?
 
-
 
-
Gilbert suggests to use console ttyS0 as well, along ttyS1. This is because ttyS1 is redirected to SOL. Whereas ttyS0 is not redirected, thus the messages should appear on the normal VGA console as well.
 
-
 
-
This did not work. I lost console on both the IPMI console and the node itself.
 
-
 
-
----------------
 
How to get rid of garbage on console when using 115200 baud rate?
How to get rid of garbage on console when using 115200 baud rate?

Revision as of 22:23, 10 February 2010

Contents

Cobbler Howto

Cobbler install on Dell 1950 Servers

This setup consists of four Dell PowerEdge 1950 servers, connected to each other in a cluster form. The intended purpose of this excercise is to find a way to provision compute nodes, without hassle. This should be ideal for data centers (both HPCC and non-HPCC).


Help from:-

http://www.openskill.info/blog.php?ID=16 http://magazine.redhat.com/2007/08/10/cobbler-how-to-set-up-a-network-boot-server-in-10-minutes/ http://www.enterprisenetworkingplanet.com/netsysm/article.php/3773596 http://www.kanarip.com/courses/Deploying_Linux_Using_Cobbler/


The system has Centos 5.4 x86_64 installed as base OS. You might want to update it before continuing.

yum -y  update


After this you should make sure that you have the following installed, from your distribution media / repository.

  • httpd
  • tftp-server
  • xinetd
  • reposync (yum-utils provides reposync)

yum -y install httpd yum-utils tftp-server xinetd dhcp

Make sure you are not running kernel-xen on your base OS. (Although it does not matter, but I just want to keep things simple). My scenario requires me not to run kernel-xen. (We are not using virtualization features. These are pure compute nodes.)

Using the link: https://fedorahosted.org/cobbler/wiki/DownloadInstructions

Setup Cobbler Repositories:- (Needs internet connection).


[root@headnode ~]# vi /etc/yum.repos.d/CentOS-Base.repo 
. . .
. . . 
[cobbler-stable]
name=Cobbler-Stable
baseurl=http://download.fedora.redhat.com/pub/epel/5/x86_64

[cobbler-testing]
name=Cobbler-Testing
baseurl=http://download.fedora.redhat.com/pub/epel/testing/5/x86_64
. . .
. . .  
[root@headnode ~]# 


Now, install cobbler:-

[root@headnode ~]# yum -y install cobbler koan cman


I have various CD images in my /data/cdimages location. I expanded the ISO image and copied it in CentOS-5.4-x86_64 .

[root@headnode cdimages]# ls
CentOS-5.3-i386.DVD.iso        
CentOS-5.4-x86_64              
CentOS-5.4-x86_64-bin-DVD.iso  
[root@headnode cdimages]#

Assuming you have entire CD media copied in your /data/cdimages/CentOS-5.4-x86_64 , you are now ready to import the repository.

cobbler import --mirror=/data/cdimages/CentOS-5.4-x86_64 --name=Centos5.4-x86_64

or

cobbler import --path=/data/cdimages/CentOS-5.4-x86_64 --name=Centos5.4-x86_64

During import you should get some screen out put as:

[root@headnode cdimages]# cobbler import --mirror=/data/cdimages/CentOS-5.4-x86_64 --name=Centos5.4-x86_64
. . .
 . . .

repodata/primary.sqlite.bz2                                                                                           
     2141520 100%    3.07MB/s    0:00:00 (xfer#3468, to-check=2/3478)                                                 
repodata/primary.xml.gz                                                                                               
     1189512 100%    1.67MB/s    0:00:00 (xfer#3469, to-check=1/3478)                                                 
repodata/repomd.xml                                                                                                   
        2142 100%    3.09kB/s    0:00:00 (xfer#3470, to-check=0/3478)                                                 

sent 4333936317 bytes  received 76408 bytes  39580024.89 bytes/sec
total size is 4333090152  speedup is 1.00
---------------- (adding distros)
- found content (breed=redhat) at /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/xen
- creating new distro: Centos5.4-xen-x86_64
- creating new profile: Centos5.4-xen-x86_64
- found content (breed=redhat) at /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/pxeboot
- creating new distro: Centos5.4-x86_64
- creating new profile: Centos5.4-x86_64
- creating new profile: rescue-Centos5.4-x86_64
---------------- (associating repos)
- traversing distro Centos5.4-xen-x86_64
- found content (breed=redhat) at /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/xen
- descent into /var/www/cobbler/ks_mirror/Centos5.4-x86_64
- processing repo at : /var/www/cobbler/ks_mirror/Centos5.4-x86_64
- need to process repo/comps: /var/www/cobbler/ks_mirror/Centos5.4-x86_64
- looking for /var/www/cobbler/ks_mirror/Centos5.4-x86_64/repodata/*comps*.xml
- createrepo -c cache --groupfile /var/www/cobbler/ks_mirror/Centos5.4-x86_64/repodata/comps.xml /var/www/cobbler/ks_mirror/Centos5.4-x86_64
3309/3309 - CentOS/sblim-cim-client-javadoc-1-35.el5.x86_64.rpm                 rpm64.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
- traversing distro Centos5.4-x86_64
- found content (breed=redhat) at /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/pxeboot
- descent into /var/www/cobbler/ks_mirror/Centos5.4-x86_64
- processing repo at : /var/www/cobbler/ks_mirror/Centos5.4-x86_64
- need to process repo/comps: /var/www/cobbler/ks_mirror/Centos5.4-x86_64
- looking for /var/www/cobbler/ks_mirror/Centos5.4-x86_64/repodata/*comps*.xml
- createrepo -c cache --groupfile /var/www/cobbler/ks_mirror/Centos5.4-x86_64/repodata/comps.xml /var/www/cobbler/ks_mirror/Centos5.4-x86_64
3309/3309 - CentOS/sblim-cim-client-javadoc-1-35.el5.x86_64.rpm                 rpm64.rpm
Saving Primary metadata
Saving file lists metadata
Saving other metadata
---------------- (associating kickstarts)
- found content (breed=redhat) at /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/pxeboot
- found content (breed=redhat) at /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/xen
- found content (breed=redhat) at /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/pxeboot
[root@headnode cdimages]#


Time for cobbler configurations:-

[root@headnode ~]# vi /etc/cobbler/settings 
server = 192.168.1.203
nextserver=192.168.1.203
pxe_just_once = 1
. . .

Now you should start the cobblerd service along httpd, dhcpd and tftp server.


chkconfig --level 35 cobblerd on
chkconfig --level 35 httpd on
chkconfig --level 35 xinetd on
chkconfig --level 35 dhcpd on


service cobblerd restart 
service httpd restart 
service dhcpd restart 
service xinetd restart 

Should enable the tftp service in /etc/xinetd.d/tftp , and change disabled=no .

Now run cobbler check and fix any obvious errors.

cobbler check # important


You may want to disable un-necessary services on this server before moving on:

chkconfig --level 35  NetworkManager  off                                                          
chkconfig --level 35  autofs  off                                                                  
chkconfig --level 35  avahi-daemon  off                                                            
chkconfig --level 35  avahi-dnsconfd  off                                                          
chkconfig --level 35  bluetooth  off                                                               
chkconfig --level 35  cups  off                                                                    
chkconfig --level 35  dc_client  off                                                               
chkconfig --level 35  dc_server  off                                                               
chkconfig --level 35  dhcrelay  off                                                                
chkconfig --level 35  dnsmasq  off                                                                 
chkconfig --level 35  dund  off                                                                    
chkconfig --level 35  firstboot  off                                                               
chkconfig --level 35  gpm  off                                                                     
chkconfig --level 35  hidd  off                                                                    
chkconfig --level 35  ip6tables  off                                                               
chkconfig --level 35  iptables  off                                                                
chkconfig --level 35  irda  off                                                                    
chkconfig --level 35  iscsi  off                                                                   
chkconfig --level 35  iscsid  off                                                                  
chkconfig --level 35  kdump  off                                                                   
chkconfig --level 35  libvirtd  off                                                                
chkconfig --level 35  lisa  off                                                                    
chkconfig --level 35  lvm2-monitor  off                                                            
chkconfig --level 35  mdmonitor  off                                                               
chkconfig --level 35  mdmpd  off                                                                   
chkconfig --level 35  multipathd  off                                                              
chkconfig --level 35  mysqld  off                                                                  
chkconfig --level 35  named  off                                                                   
chkconfig --level 35  netconsole  off                                                              
chkconfig --level 35  netfs  off                                                                   
chkconfig --level 35  netplugd  off                                                                
chkconfig --level 35  nfs  off                                                                     
chkconfig --level 35  nfslock  off                                                                 
chkconfig --level 35  nscd  off                                                                    
chkconfig --level 35  ntpd  off                                                                    
chkconfig --level 35  oddjobd  off                                                                 
chkconfig --level 35  pand  off                                                                    
chkconfig --level 35  pcscd  off
chkconfig --level 35  psacct  off
chkconfig --level 35  qemu  off
chkconfig --level 35  rawdevices  off
chkconfig --level 35  rdisc  off
chkconfig --level 35  readahead_later  off
chkconfig --level 35  restorecond  off
chkconfig --level 35  rpcgssd  off
chkconfig --level 35  rpcidmapd  off
chkconfig --level 35  rpcsvcgssd  off
chkconfig --level 35  saslauthd  off
chkconfig --level 35  sendmail  off
chkconfig --level 35  setroubleshoot  off
chkconfig --level 35  smartd  off
chkconfig --level 35  smb  off
chkconfig --level 35  squid  off
chkconfig --level 35  tcsd  off
chkconfig --level 35  tux  off
chkconfig --level 35  vncserver  off
chkconfig --level 35  wdaemon  off
chkconfig --level 35  winbind  off
chkconfig --level 35  wpa_supplicant  off
chkconfig --level 35  xend  off
chkconfig --level 35  xendomains  off
chkconfig --level 35  ypbind  off
chkconfig --level 35  yum-updatesd  off

End of day 1.

Day 2

[root@headnode ~]# cobbler check
The following potential problems were detected:
#0: service dhcpd is not running
#1: since iptables may be running, ensure 69, 80, and 25151 are unblocked
#2: yum-utils need to be at least version 1.1.17 for reposync -l, current version is 1.1.16
#3: The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed
[root@headnode ~]# 

As you can see, 1-3 are more important to check. 4 is less important.


Check various lists from cobbler. These are created by default when you import the repository for the first time.

[root@headnode ~]# cobbler distro list
Centos5.4-x86_64
Centos5.4-xen-x86_64
[root@headnode ~]#


[root@headnode ~]# cobbler profile list
Centos5.4-x86_64
Centos5.4-xen-x86_64
rescue-Centos5.4-x86_64
[root@headnode ~]# 


Currently. No systems are registered with cobbler at the moment. As you can see below:

[root@headnode ~]# cobbler system list
[root@headnode ~]#


First, create a (separate) profile for compute-nodes:-

[root@headnode ~]# cobbler profile copy --name=Centos5.4-x86_64 --newname=ComputeNodes


[root@headnode ~]# cobbler profile list
Centos5.4-x86_64
Centos5.4-xen-x86_64
ComputeNodes                # <------------ Newly added profile!
rescue-Centos5.4-x86_64
[root@headnode ~]#


[root@headnode ~]# cobbler profile report --name=ComputeNodes
profile              : ComputeNodes
distro               : Centos5.4-x86_64
comment              :
created              : Tue Feb  2 09:06:50 2010
dhcp tag             : default
enable menu          : True
kernel options       : {}
kickstart            : /var/lib/cobbler/kickstarts/default.ks  # < ------------ Notice this default Kickstart.
ks metadata          : {}
mgmt classes         : []
modified             : Tue Feb  2 09:06:50 2010
name servers         : []
name servers search  : []
owners               : ['admin']
post kernel options  : {}
redhat mgmt key      : <<inherit>>
redhat mgmt server   : <<inherit>>
repos                : []
server               : <<inherit>>
template_files       : {}
virt bridge          : xenbr0
virt cpus            : 1
virt file size       : 5
virt path            :
virt ram             : 512
virt type            : qemu

[root@headnode ~]# 

The name of default.ks needs to be changed, or fill default.ks with your kickstart, because it is empty by default.

[root@headnode ~]# cat /var/lib/cobbler/kickstarts/default.ks
# this file intentionally left blank
# admins:  edit it as you like, or leave it blank for non-interactive install

There is a sample.ks, which we will use for our compute nodes.

[root@headnode ~]# cat /var/lib/cobbler/kickstarts/sample.ks
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# Partition clearing information
clearpart --all --initlabel
# Use text mode install
text
# Firewall configuration
firewall --enabled
# Run the Setup Agent on first boot
firstboot --disable
# System keyboard
keyboard us
# System language
lang en_US
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config')
# Reboot after installation
reboot

#Root password
rootpw --iscrypted $default_password_crypted
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone  America/New_York
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
autopart

%pre
$SNIPPET('log_ks_pre')
$kickstart_start
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')

%packages
$SNIPPET('func_install_if_enabled')

%post
$SNIPPET('log_ks_post')
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET('post_install_kernel_options')
$SNIPPET('post_install_network_config')
$SNIPPET('func_register_if_enabled')
$SNIPPET('download_config_files')
$SNIPPET('koan_environment')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
# Enable post-install boot notification
$SNIPPET('post_anamon')
# Start final steps
$kickstart_done
# End final steps
[root@headnode ~]#

Copy the sample file as Compute.ks :

[root@headnode ~]# cd /var/lib/cobbler/kickstarts/

[root@headnode kickstarts]# cp sample.ks Compute.ks

Edit the kickstart file Compute.ks and make necessary changes:

[root@headnode kickstarts]# vi Compute.ks
#platform=x86, AMD64, or Intel EM64T
# System authorization information
auth  --useshadow  --enablemd5
# System bootloader configuration
bootloader --location=mbr
# 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
# Use network installation
url --url=$tree
# If any cobbler repo definitions were referenced in the kickstart profile, include them here.
$yum_repo_stanza
# Network information
$SNIPPET('network_config')
# Reboot after installation
reboot

#Root password
rootpw --iscrypted $default_password_crypted
# SELinux configuration
selinux --disabled
# Do not configure the X Window System
skipx
# System timezone
timezone  Asia/Riyadh
# Install OS instead of upgrade
install
# Clear the Master Boot Record
zerombr
# Allow anaconda to partition the system as needed
# autopart
part /boot --size 512
part swap --size 1024
part /    --size 4096


%pre
$SNIPPET('log_ks_pre')
$kickstart_start
$SNIPPET('pre_install_network_config')
# Enable installation monitoring
$SNIPPET('pre_anamon')

%packages
@core
$SNIPPET('func_install_if_enabled')

%post
$SNIPPET('log_ks_post')
# Start yum configuration
$yum_config_stanza
# End yum configuration
$SNIPPET('post_install_kernel_options')
$SNIPPET('post_install_network_config')
$SNIPPET('func_register_if_enabled')
$SNIPPET('download_config_files')
$SNIPPET('koan_environment')
$SNIPPET('redhat_register')
$SNIPPET('cobbler_register')
# Enable post-install boot notification
$SNIPPET('post_anamon')
# Start final steps
$kickstart_done
# End final steps
[root@headnode kickstarts]# 

Now, assign the new kickstart to the profile we just created/copied:


[root@headnode kickstarts]# cobbler profile edit --name=ComputeNodes --kickstart=/var/lib/cobbler/kickstarts/Compute.ks


Verify the change:-

[root@headnode kickstarts]# cobbler profile report --name=ComputeNodes | grep kickstart
kickstart            : /var/lib/cobbler/kickstarts/Compute.ks
[root@headnode kickstarts]#  

Define Systems

Now define/ add compute nodes. Remember, that my compute nodes have an IPMI capable interface, which have an out-of-band IP (separate network IP), than the access / production network. Right now I am only adding systems with the most basic information:

[root@headnode ~]# cobbler system add --name=compute1 --profile=ComputeNodes --mac=00:1D:09:6A:27:91 [root@headnode ~]# cobbler system add --name=compute2 --profile=ComputeNodes --mac=00:1D:09:6B:06:81


Note: In case you try to make a duplicate entry:-

[root@headnode ~]# cobbler system add --name=compute1 --profile=ComputeNodes --mac=00:1D:09:6B:06:7F
An object already exists with that name.  Try 'edit'?


Check cobbler system list:

[root@headnode ~]# cobbler system list
compute1
compute2
[root@headnode ~]# 

Looks good. You can check report of the nodes now. I am only interested in few parameters.

[root@headnode ~]# cobbler system report | egrep -i "system|profile|power type|interface|mac" system  : compute1 profile  : ComputeNodes power type  : ipmitool interface  : eth0

 mac address    : 00:1D:09:6A:27:8F

system  : compute2 profile  : ComputeNodes power type  : ipmitool interface  : eth0

 mac address    : 00:1D:09:6B:06:7F

[root@headnode ~]#

I need to change the interface from eth0 to eth1, because my nodes are connected to access network through eth1. Whereas eth1 is the management / IPMI / BMC network.

I can simply delete these two systems and recreate them without a hassle:

[root@headnode ~]# cobbler system add --name=compute1 --profile=ComputeNodes --mac=00:1D:09:6A:27:91 --hostname=compute1.example.com --interface=eth1  --static=1 --ip=192.168.1.1 --subnet=255.255.255.0 --kopts=noipv6  --power-address=192.168.0.1 --power-user=root --power-pass=ipmisecret

[root@headnode ~]# cobbler system add --name=compute2 --profile=ComputeNodes --mac=00:1D:09:6B:06:81 --hostname=compute2.example.com --interface=eth1  --static=1 --ip=192.168.1.2 --subnet=255.255.255.0 --kopts=noipv6 --power-address=192.168.0.2  --power-user=root --power-pass=ipmisecret
[root@headnode ~]# 

Note: The BMC interface has the user name "root" and password "ipmisecret", are defined in each node's BMC configuration in BIOS.

Now once you modify anything in the cobbler system, you will need to do a "cobbler sync", which will make necessary changes in kickstart and tftp files and restart dhcpd. (I wasted one full day browsing the net, to figure out this one!)

[root@headnode ~]# cobbler sync
Shutting down dhcpd:                                       [  OK  ]
Starting dhcpd:                                            [  OK  ]
[root@headnode ~]# 

And if you make any changes in cobbler's /etc/cobbler/settings file or any of it's subsystem, you will need to restart cobblerd service.

service cobblerd restart
cobbler sync


If you look at the TFTP file created by cobbler for compute1, it looks like this:

[root@headnode ~]# cat /tftpboot/pxelinux.cfg/01-00-1d-09-6a-27-8f
default linux
prompt 0
timeout 1
label linux
        kernel /images/Centos5.4-x86_64/vmlinuz
        ipappend 2
        append initrd=/images/Centos5.4-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://192.168.1.200/cblr/svc/op/ks/system/compute1

[root@headnode ~]#
<pre>

The resultant dhcpd.conf file looks like this:

<pre>
cat /etc/dhcpd.conf
# ******************************************************************
# Cobbler managed dhcpd.conf file
# generated from cobbler dhcp.conf template (Tue Feb  2 11:47:35 2010)
# Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
# in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
# overwritten.
# ******************************************************************

ddns-update-style interim;

allow booting;
allow bootp;

ignore client-updates;
set vendorclass = option vendor-class-identifier;

subnet 192.168.1.0 netmask 255.255.255.0 {
     option routers             192.168.1.200;
     option domain-name-servers 192.168.1.200;
     option subnet-mask         255.255.255.0;
     range dynamic-bootp        192.168.1.1 192.168.1.10;
     filename                   "/pxelinux.0";
     default-lease-time         21600;
     max-lease-time             43200;
     next-server                192.168.1.200;
}

# group for Cobbler DHCP tag: default
group {
    host generic1 {
        hardware ethernet 00:1D:09:6B:06:91;
        filename "/pxelinux.0";
        next-server 192.168.1.200;
    }
}

[root@headnode ~]#   


For two nodes, I had the following TFTP files:

[root@headnode ~]# ls  /tftpboot/pxelinux.cfg/ -l
total 12
-rw-r--r-- 1 root root  272 Feb  8 13:18 01-00-1d-09-6a-27-91
-rw-r--r-- 1 root root  272 Feb  8 13:18 01-00-1d-09-6b-06-81
-rw-r--r-- 1 root root 1091 Feb  8 13:18 default
[root@headnode ~]#


If your systems have IPMI capable interfaces, then you must make sure that you have ipmitools, ipmiconsole and ipmipower installed.

[root@headnode ~]# yum -y install OpenIPMI-tools freeipmi-*

[root@headnode ~]# rpm -ql OpenIPMI-tools
/etc/rc.d/init.d/ipmievd
/etc/sysconfig/ipmievd
/usr/bin/ipmitool


Time to reboot these nodes and see if they are able to install. However, make sure that their netboot switch is enabled.

[root@headnode power]# cobbler system edit --name=compute1 --netboot=1
[root@headnode power]# cobbler system edit --name=compute2 --netboot=1


[root@headnode power]# cobbler report --what=systems | egrep -i "hostname|netboot"
hostname              : compute1.example.com
netboot enabled?      : True
hostname              : compute2.example.com
netboot enabled?      : True
[root@headnode power]# 

There is no "install" command. Instead all the installation mechanism has been made ready. You need to reboot the nodes to get installed.

[root@headnode power]# cobbler system reboot --name=compute1
cobbler power configuration is:

      type   : ipmitool
      address: 192.168.0.1
      user   : root
      id     :

- /usr/bin/ipmitool -H 192.168.0.1 -U root -P ipmisecret power off
Chassis Power Control: Down/Off
cobbler power configuration is:

      type   : ipmitool
      address: 192.168.0.1
      user   : root
      id     :

- /usr/bin/ipmitool -H 192.168.0.1 -U root -P ipmisecret power on
Chassis Power Control: Up/On
[root@headnode power]#     


If, after reboot of node, the installation starts and finishes and starts again, it means your nodes are stuck in an install loop. This happens, because PXE is the first boot device in the nodes, which is the required boot sequence in HPCC scenarios. What you need to do is to make sure that a particular setting is enabled in the /etc/cobblet/settings file. Without setting that, the netboot flag will remain switched on in cobbler configuration and the nodes will keep rebooting and keep installing.

[root@headnode power]# cobbler report --what=systems | egrep -i "hostname|netboot"
hostname              : compute1.example.com
netboot enabled?      : True
hostname              : compute2.example.com
netboot enabled?      : True
[root@headnode power]#  

For such situations, there is a flag in /etc/cobbler/settings, which turns off the netboot flag, when the installation is done. It is "pxe_just_once" and is set to 0 by default. It needs to be turned to 1 in this situation.

pxe_just_once: 1

Day 3. Few other issues.

My nodes installed properly and booted properly. However they were taking too much time in trying to obtain IP for eth0 interface through dhcp. Since there is no dhcp on eth0 and I don't need to enable the eth0 interface in OS, because it is enabled and properly configured in the BIOS already, I had to find a way to fix that. Here are four items which I wanted to know the solution:

1) Static IP for eth1. Means, after installation of a node is complete, it should have a static IP configured in it instead of asking that from DHCP server. 2) Disable eth0, so it does not wait for dhcp when the node reboots from local OS/disk. 3) Console redirection during TFTP and installation. I want to see the console of the node on my headnode, instead of manually seeing it on the KVM. (It does not make sense to run to the data center everytime you need to look at screen of a node.) 4) How to check if the nodes are installed? Pretty important!


1) Static IP:-

Simply add a --static=1 to either the cobbler system add command, or modify an already defined system with this setting.

[root@headnode ~]# cobbler system edit --name compute1 --interface=eth1 --static=1


This is the solution for setting static IP, post-reboot. The installation got done through PXE (good).

Here is what cobbler did, after the node is installed and rebooted from local disk:-

[root@compute1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1
DEVICE=eth1
HWADDR=00:1D:09:6A:27:91
ONBOOT=yes
BOOTPROTO=static
IPADDR=192.168.1.1
NETMASK=255.255.255.0
[root@compute1 ~]#

This is exactly what I wanted. Good.


2) Disable eth0. For this, I used the same technique. I just mentioned that it is also static, and did not provide any IP for it. That is because the (out of band) IP is already configured in the node's BIOS.

[root@headnode ~]# cobbler system edit --name compute1 --interface=eth0 --static=1

[root@headnode ~]# cobbler report system --name=compute1
system                : compute1
profile               : ComputeNodes
comment               :
. . . 
interface        : eth0
  mac address    :
  is static?     : True
  ip address     :
  subnet         :
  static routes  : []
  dhcp tag       :
interface        : eth1
  mac address    : 00:1D:09:6A:27:91
  is static?     : True
  ip address     : 192.168.1.1
  subnet         : 255.255.255.0
  static routes  : []
  dhcp tag       :

[root@headnode ~]#                          


Note that --delete-interface did NOT do the trick.

[root@headnode ~]# cobbler system edit --name=compute1 --delete-interface=eth0

This did not work. 


This time it worked. I have lovely results after the nodes are installed and rebooted!

[root@compute1 ~]# ifconfig eth0 Link encap:Ethernet HWaddr 00:1D:09:6A:27:8F

         inet6 addr: fe80::21d:9ff:fe6a:278f/64 Scope:Link

eth1 Link encap:Ethernet HWaddr 00:1D:09:6A:27:91

         inet addr:192.168.1.1  Bcast:192.168.1.255  Mask:255.255.255.0
         inet6 addr: fe80::21d:9ff:fe6a:2791/64 Scope:Link

lo Link encap:Local Loopback

         inet addr:127.0.0.1  Mask:255.0.0.0
         inet6 addr: ::1/128 Scope:Host

[root@compute1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth0 DEVICE=eth0 HWADDR=00:1D:09:6A:27:8F ONBOOT=yes BOOTPROTO=none

[root@compute1 ~]# cat /etc/sysconfig/network-scripts/ifcfg-eth1 DEVICE=eth1 HWADDR=00:1D:09:6A:27:91 ONBOOT=yes BOOTPROTO=static IPADDR=192.168.1.1 NETMASK=255.255.255.0 [root@compute1 ~]#


Notice that Cobbler set BOOTPROTO=none for eth0. </pre>

However the node WILL NOT ping any other node on IPMI interface. This is only controllable/ do-able in one direction, from headnode towards compute node. Remember that the headnode's management interface HAS an out of band IP configured in the OS.

Thus, don't be alarmed if you see the following, while you are logged in to any of the compute nodes:

[root@compute1 ~]# ping 192.168.0.200
connect: Network is unreachable

[root@compute1 ~]# ping 192.168.0.201
connect: Network is unreachable
[root@compute1 ~]#

End of day 3.

Day 4. (3) Console redirection.

We set certain parameters in the distro and profile options.

[root@headnode ~]# cobbler distro list
Centos5.4-x86_64
Centos5.4-xen-x86_64
[root@headnode ~]#

Centos5.4-x86_64 is the distro we are using for provisioning the nodes.

[root@headnode ~]# cobbler distro report --name=Centos5.4-x86_64
distro               : Centos5.4-x86_64
architecture         : x86_64
breed                : redhat
created              : Mon Feb  1 15:06:46 2010
comment              : rhel5.4
initrd               : /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/pxeboot/initrd.img
kernel               : /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/pxeboot/vmlinuz
kernel options       : {}
ks metadata          : {'tree': 'http://@@http_server@@/cblr/links/Centos5.4-x86_64'}
tree build time      : Thu Oct  1 19:57:55 2009
modified             : Mon Feb  1 15:10:12 2010
mgmt classes         : []
os version           : rhel5
owners               : ['admin']
post kernel options  : {}
redhat mgmt key      : <<inherit>>
redhat mgmt server   : <<inherit>>
template files       : {}
[root@headnode ~]#


[root@headnode ~]# cobbler distro edit --name=Centos5.4-x86_64 --kopts="console=ttyS1,115200"


[root@headnode ~]# cobbler distro report --name=Centos5.4-x86_64
distro               : Centos5.4-x86_64
architecture         : x86_64
breed                : redhat
created              : Mon Feb  1 15:06:46 2010
comment              : rhel5.4
initrd               : /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/pxeboot/initrd.img
kernel               : /var/www/cobbler/ks_mirror/Centos5.4-x86_64/images/pxeboot/vmlinuz
kernel options       : {'console': 'ttyS1,115200'}
ks metadata          : {'tree': 'http://@@http_server@@/cblr/links/Centos5.4-x86_64'}
tree build time      : Thu Oct  1 19:57:55 2009
modified             : Tue Feb  9 08:24:51 2010
mgmt classes         : []
os version           : rhel5
owners               : ['admin']
post kernel options  : {}
redhat mgmt key      : <<inherit>>
redhat mgmt server   : <<inherit>>
template files       : {}

[root@headnode ~]#


Now check the profiles:-

[root@headnode ~]# cobbler profile list
Centos5.4-x86_64
Centos5.4-xen-x86_64
ComputeNodes
rescue-Centos5.4-x86_64
[root@headnode ~]#


We are interested in profile named "ComputeNodes":-

[root@headnode ~]# cobbler profile report --name=ComputeNodes
profile              : ComputeNodes
distro               : Centos5.4-x86_64
comment              :
created              : Tue Feb  2 09:06:50 2010
dhcp tag             : default
enable menu          : True
kernel options       : {}
kickstart            : /var/lib/cobbler/kickstarts/Compute.ks
ks metadata          : {}
mgmt classes         : []
modified             : Tue Feb  2 09:16:28 2010
name servers         : []
name servers search  : []
owners               : ['admin']
post kernel options  : {}
redhat mgmt key      : <<inherit>>
redhat mgmt server   : <<inherit>>
repos                : []
server               : <<inherit>>
template_files       : {}
virt bridge          : xenbr0
virt cpus            : 1
virt file size       : 5
virt path            :
virt ram             : 512
virt type            : qemu

[root@headnode ~]#     

[root@headnode ~]# cobbler profile edit --name=ComputeNodes --ksmeta="console=ttyS1,115200"


[root@headnode ~]# cobbler sync
Starting dhcpd:                                            [  OK  ]
[root@headnode ~]# 


Try re-provisioning the node and see if it works.

[root@headnode ~]# cobbler system edit --name compute1 --netboot-enabled=1

[root@headnode ~]# cobbler sync
Shutting down dhcpd:                                       [  OK  ]
Starting dhcpd:                                            [  OK  ]

[root@headnode ~]# cat /tftpboot/pxelinux.cfg/01-00-1d-09-6a-27-91
default linux
prompt 0
timeout 1
label linux
        kernel /images/Centos5.4-x86_64/vmlinuz
        ipappend 2
        append initrd=/images/Centos5.4-x86_64/initrd.img ksdevice=bootif lang=  console=ttyS1,115200 text noipv6 kssendmac  ks=http://192.168.1.200/cblr/svc/op/ks/system/compute1

[root@headnode ~]#

Notice the console option in the newly generated TFTP file above.


ipmiconsole

Use the ipmiconsole command to open console of a remote node on the headnode.

[root@headnode ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=ipmisecret
[SOL established]

Note, if you get an error such as below, that means your headnode, does not have BMC interface correctly configured. Assign it an IP from your BMC network and bring the interface up. It should work.

The error:

[root@headnode ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=ipmisecret
ipmiconsole_submit_block: internal system error


The reason:

[root@headnode ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1D:09:69:F3:BB
          inet6 addr: fe80::21d:9ff:fe69:f3bb/64 Scope:Link

eth1      Link encap:Ethernet  HWaddr 00:1D:09:69:F3:BD
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host

The fix:

[root@headnode ~]# ifconfig eth0 192.168.0.201 netmask 255.255.255.0 up

[root@headnode ~]# ifconfig
eth0      Link encap:Ethernet  HWaddr 00:1D:09:69:F3:BB
          inet addr:192.168.0.201  Bcast:192.168.0.255  Mask:255.255.255.0

eth1      Link encap:Ethernet  HWaddr 00:1D:09:69:F3:BD
          inet addr:192.168.1.200  Bcast:192.168.1.255  Mask:255.255.255.0
          inet6 addr: fe80::21d:9ff:fe69:f3bd/64 Scope:Link

lo        Link encap:Local Loopback
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host

[root@headnode ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=ipmisecret
[SOL established]

power on/off

Use ipmipower command to perform power operations on the nodes.

[root@headnode ~]# ipmipower --hostname=192.168.0.1 --username=root --password=ipmisecret --on
192.168.0.1: ok

Also if the node is off, cycle may not work:-

[root@headnode ~]# ipmipower --hostname=192.168.0.1 --username=root --password=ipmisecret --cycle
192.168.0.1: operation invalid

[root@headnode ~]# ipmipower --hostname=192.168.0.1 --username=root --password=ipmisecret --off
192.168.0.1: ok

[root@headnode ~]# ipmipower --hostname=192.168.0.1 --username=root --password=ipmisecret --on
192.168.0.1: ok
[root@headnode ~]#


Problem with console entries

When using console=ttyS1,57600n8r , we get a node install time slowed down 5 times. Without it, the node install time was 1 minute. With it, the node install time reached 5+ minutes.

Using 115200 as console bnaud rate shows too much garbage on ipmiconsole as soon as the TFTP boot image is read. Before that, the BIOS display part is ok.


How to get rid of garbage on console when using 115200 baud rate?

==============================================

Day 2:

Cobbler howto-2

=

[root@headnode ~]# cobbler check The following potential problems were detected:

  1. 0: service dhcpd is not running
  2. 1: since iptables may be running, ensure 69, 80, and 25151 are unblocked
  3. 2: yum-utils need to be at least version 1.1.17 for reposync -l, current version is 1.1.16
  4. 3: The default password used by the sample templates for newly installed machines (default_password_crypted in /etc/cobbler/settings) is still set to 'cobbler' and should be changed

[root@headnode ~]#


[root@headnode ~]# cobbler list distro Centos5.4-x86_64

  profile Centos5.4-x86_64
  profile rescue-Centos5.4-x86_64

distro Centos5.4-xen-x86_64

  profile Centos5.4-xen-x86_64

[root@headnode ~]#


[root@headnode ~]# cobbler distro list Centos5.4-x86_64 Centos5.4-xen-x86_64 [root@headnode ~]#


[root@headnode ~]# cobbler profile list Centos5.4-x86_64 Centos5.4-xen-x86_64 rescue-Centos5.4-x86_64 [root@headnode ~]#


No systems are registered with cobbler at the moment:-

[root@headnode ~]# cobbler system list [root@headnode ~]#


Lets create a profile for compute-nodes:-

[root@headnode ~]# cobbler profile copy --name=Centos5.4-x86_64 --newname=ComputeNodes


[root@headnode ~]# cobbler profile list Centos5.4-x86_64 Centos5.4-xen-x86_64 ComputeNodes # <------------ Newly added profile! rescue-Centos5.4-x86_64 [root@headnode ~]#


[root@headnode ~]# cobbler profile report --name=ComputeNodes profile  : ComputeNodes distro  : Centos5.4-x86_64 comment  : created  : Tue Feb 2 09:06:50 2010 dhcp tag  : default enable menu  : True kernel options  : {} kickstart  : /var/lib/cobbler/kickstarts/default.ks # < ------------ Notice this default Kickstart. ks metadata  : {} mgmt classes  : [] modified  : Tue Feb 2 09:06:50 2010 name servers  : [] name servers search  : [] owners  : ['admin'] post kernel options  : {} redhat mgmt key  : <<inherit>> redhat mgmt server  : <<inherit>> repos  : [] server  : <<inherit>> template_files  : {} virt bridge  : xenbr0 virt cpus  : 1 virt file size  : 5 virt path  : virt ram  : 512 virt type  : qemu

[root@headnode ~]#


[root@headnode ~]# cat /var/lib/cobbler/kickstarts/default.ks

  1. this file intentionally left blank
  2. admins: edit it as you like, or leave it blank for non-interactive install


[root@headnode ~]# cat /var/lib/cobbler/kickstarts/sample.ks

  1. platform=x86, AMD64, or Intel EM64T
  2. System authorization information

auth --useshadow --enablemd5

  1. System bootloader configuration

bootloader --location=mbr

  1. Partition clearing information

clearpart --all --initlabel

  1. Use text mode install

text

  1. Firewall configuration

firewall --enabled

  1. Run the Setup Agent on first boot

firstboot --disable

  1. System keyboard

keyboard us

  1. System language

lang en_US

  1. Use network installation

url --url=$tree

  1. If any cobbler repo definitions were referenced in the kickstart profile, include them here.

$yum_repo_stanza

  1. Network information

$SNIPPET('network_config')

  1. Reboot after installation

reboot

  1. Root password

rootpw --iscrypted $default_password_crypted

  1. SELinux configuration

selinux --disabled

  1. Do not configure the X Window System

skipx

  1. System timezone

timezone America/New_York

  1. Install OS instead of upgrade

install

  1. Clear the Master Boot Record

zerombr

  1. Allow anaconda to partition the system as needed

autopart


%pre $SNIPPET('log_ks_pre') $kickstart_start $SNIPPET('pre_install_network_config')

  1. Enable installation monitoring

$SNIPPET('pre_anamon')

%packages $SNIPPET('func_install_if_enabled')

%post $SNIPPET('log_ks_post')

  1. Start yum configuration

$yum_config_stanza

  1. End yum configuration

$SNIPPET('post_install_kernel_options') $SNIPPET('post_install_network_config') $SNIPPET('func_register_if_enabled') $SNIPPET('download_config_files') $SNIPPET('koan_environment') $SNIPPET('redhat_register') $SNIPPET('cobbler_register')

  1. Enable post-install boot notification

$SNIPPET('post_anamon')

  1. Start final steps

$kickstart_done

  1. End final steps

[root@headnode ~]#


[root@headnode ~]# cd /var/lib/cobbler/kickstarts/

[root@headnode kickstarts]# cp sample.ks Compute.ks

[root@headnode kickstarts]# vi Compute.ks

  1. platform=x86, AMD64, or Intel EM64T
  2. System authorization information

auth --useshadow --enablemd5

  1. System bootloader configuration

bootloader --location=mbr

  1. Partition clearing information

clearpart --all --initlabel

  1. Use text mode install

text

  1. Firewall configuration

firewall --disabled

  1. Run the Setup Agent on first boot

firstboot --disable

  1. System keyboard

keyboard us

  1. System language

lang en_US

  1. Use network installation

url --url=$tree

  1. If any cobbler repo definitions were referenced in the kickstart profile, include them here.

$yum_repo_stanza

  1. Network information

$SNIPPET('network_config')

  1. Reboot after installation

reboot

  1. Root password

rootpw --iscrypted $default_password_crypted

  1. SELinux configuration

selinux --disabled

  1. Do not configure the X Window System

skipx

  1. System timezone

timezone Asia/Riyadh

  1. Install OS instead of upgrade

install

  1. Clear the Master Boot Record

zerombr

  1. Allow anaconda to partition the system as needed

autopart


%pre $SNIPPET('log_ks_pre') $kickstart_start $SNIPPET('pre_install_network_config')

  1. Enable installation monitoring

$SNIPPET('pre_anamon')

%packages @base $SNIPPET('func_install_if_enabled')

%post $SNIPPET('log_ks_post')

  1. Start yum configuration

$yum_config_stanza

  1. End yum configuration

$SNIPPET('post_install_kernel_options') $SNIPPET('post_install_network_config') $SNIPPET('func_register_if_enabled') $SNIPPET('download_config_files') $SNIPPET('koan_environment') $SNIPPET('redhat_register') $SNIPPET('cobbler_register')

  1. Enable post-install boot notification

$SNIPPET('post_anamon')

  1. Start final steps

$kickstart_done

  1. End final steps

[root@headnode kickstarts]#


[root@headnode kickstarts]# cobbler profile edit --name=ComputeNodes --kickstart=/var/lib/cobbler/kickstarts/Compute.ks [root@headnode kickstarts]#


Verify the change:-

[root@headnode kickstarts]# cobbler profile report --name=ComputeNodes | grep kickstart kickstart  : /var/lib/cobbler/kickstarts/Compute.ks [root@headnode kickstarts]#


Now define/ add compute nodes:-

[root@headnode ~]# cobbler system add --name=compute1 --profile=ComputeNodes --mac=00:1D:09:6A:27:8F

[root@headnode ~]# cobbler system add --name=compute2 --profile=ComputeNodes --mac=00:1D:09:6B:06:7F [root@headnode ~]#



Note ----------

In case you try to make a duplicate entry:-

[root@headnode ~]# cobbler system add --name=compute1 --profile=ComputeNodes --mac=00:1D:09:6B:06:7F An object already exists with that name. Try 'edit'?


[root@headnode ~]# cobbler system list compute1 compute2 [root@headnode ~]#


You can check report of the nodes now. I am only interested in few parameters.

[root@headnode ~]# cobbler system report | egrep "system|profile|power type|interface|mac" system  : compute1 profile  : ComputeNodes power type  : ipmitool interface  : eth0

 mac address    : 00:1D:09:6A:27:8F

system  : compute2 profile  : ComputeNodes power type  : ipmitool interface  : eth0

 mac address    : 00:1D:09:6B:06:7F

[root@headnode ~]#

I need to change the interface from eth0 to eth1.

[root@headnode ~]# cobbler system edit --name=compute1 --interface=eth1 --power-type=ipmitool --power-user=root --power-pass=calvin

[root@headnode ~]# cobbler system edit --name=compute2 --interface=eth1 --power-type=ipmitool --power-user=root --power-pass=calvin [root@headnode ~]#


[root@headnode ~]# cobbler system report | egrep "system|profile|power type|interface|mac" system  : compute1 profile  : ComputeNodes power type  : ipmitool interface  : eth0

 mac address    : 00:1D:09:6A:27:8F

system  : compute2 profile  : ComputeNodes power type  : ipmitool interface  : eth0

 mac address    : 00:1D:09:6B:06:7F

[root@headnode ~]#


[root@headnode ~]# cat /tftpboot/pxelinux.cfg/01-00-1d-09-6a-27-8f default linux prompt 0 timeout 1 label linux

       kernel /images/Centos5.4-x86_64/vmlinuz
       ipappend 2
       append initrd=/images/Centos5.4-x86_64/initrd.img ksdevice=bootif lang=  kssendmac text  ks=http://192.168.1.200/cblr/svc/op/ks/system/compute1

[root@headnode ~]#


service cobblerd restart

[root@headnode ~]# service dhcpd restart Starting dhcpd: [FAILED] [root@headnode ~]#


Wasted all my day. This is the fix:-

[root@headnode ~]# cobbler sync Shutting down dhcpd: [ OK ] Starting dhcpd: [ OK ]


[root@headnode ~]# cat /etc/dhcpd.conf

  1. ******************************************************************
  2. Cobbler managed dhcpd.conf file
  3. generated from cobbler dhcp.conf template (Tue Feb 2 11:47:35 2010)
  4. Do NOT make changes to /etc/dhcpd.conf. Instead, make your changes
  5. in /etc/cobbler/dhcp.template, as /etc/dhcpd.conf will be
  6. overwritten.
  7. ******************************************************************

ddns-update-style interim;

allow booting; allow bootp;

ignore client-updates; set vendorclass = option vendor-class-identifier;

subnet 192.168.1.0 netmask 255.255.255.0 {

    option routers             192.168.1.200;
    option domain-name-servers 192.168.1.200;
    option subnet-mask         255.255.255.0;
    range dynamic-bootp        192.168.1.1 192.168.1.10;
    filename                   "/pxelinux.0";
    default-lease-time         21600;
    max-lease-time             43200;
    next-server                192.168.1.200;

}

  1. group for Cobbler DHCP tag: default

group {

   host generic1 {
       hardware ethernet 00:1D:09:6B:06:91;
       filename "/pxelinux.0";
       next-server 192.168.1.200;
   }

}

[root@headnode ~]#

Personal tools