CobblerTest

From WBITT's Cooker!

Revision as of 10:14, 10 February 2010 by Kamran (Talk | contribs)
Jump to: navigation, search

Cobbler Howto:-

Contents

======

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/


Centos 5.4 x86_64

yum -y update


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

Setup Cobbler Repositories:-


[root@test-plccg ~]# 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@test-plccg ~]#


Install cobbler:-

[root@test-plccg ~]# yum -y install cobbler koan

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


service httpd restart

http://10.1.112.121/cobbler




Import 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


[root@test-plccg 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@test-plccg cdimages]#


Install the following using yum :-

yum -y install reposync yum-utils cman


Time for some configurations:-

vi /etc/cobbler/settings


(some settings)


service cobblerd restart

chkconfig --level 35 cobblerd on

cobbler check # important


End of day 1.

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

Day 2: Cobbler howto-2

=

[root@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# 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@test-plccg ~]#


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


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


No systems are registered with cobbler at the moment:-

[root@test-plccg ~]# cobbler system list [root@test-plccg ~]#


Lets create a profile for compute-nodes:-

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


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


[root@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# 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@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# cd /var/lib/cobbler/kickstarts/

[root@test-plccg kickstarts]# cp sample.ks Compute.ks

[root@test-plccg 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
  2. autopart

part /boot --size 512 part swap --size 1024 part / --size 4096


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

  1. Enable installation monitoring

$SNIPPET('pre_anamon')

%packages @core $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@test-plccg kickstarts]#


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


Verify the change:-

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


Now define/ add compute nodes:-

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

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



Note ----------

In case you try to make a duplicate entry:-

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


[root@test-plccg ~]# cobbler system list compute1 compute2 [root@test-plccg ~]#


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

[root@test-plccg ~]# 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@test-plccg ~]#

I need to change the interface from eth0 to eth1.


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

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


[root@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# 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@test-plccg ~]#


service cobblerd restart

[root@test-plccg ~]# service dhcpd restart Starting dhcpd: [FAILED] [root@test-plccg ~]#


Wasted all my day. This is the fix:-

[root@test-plccg ~]# cobbler sync Shutting down dhcpd: [ OK ] Starting dhcpd: [ OK ]


[root@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# 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@test-plccg ~]#


A bit of power issue.

ipmitool, which is supported by CentOS, could not be found on the system. Instead, ipmipower was there, from freeipmi-rpm.

/etc/cobbler/settings mention something about the power scripts/templates. These are in /etc/cobbler/power directory.


[root@test-plccg ~]# cd /etc/cobbler/power/ [root@test-plccg power]# ls power_apc_snmp.template power_ether_wake.template power_ipmitool.template power_wti.template power_bladecenter.template power_ilo.template power_lpar.template power_bullpap.template power_integrity.template power_rsa.template power_drac.template power_ipmilan.template power_virsh.template


[root@test-plccg power]# cat power_ipmitool.template /usr/bin/ipmitool -H $power_address -U $power_user -P $power_pass power $power_mode [root@test-plccg power]#

The syntax of ipmitool and ipmipower are a bit different so this is not do-able. (Probably).


[root@test-plccg ~]# yum -y install OpenIPMI-tools


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

Ahaa!!!

Time to reboot these nodes and see if they are installed:

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


[root@test-plccg 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 power 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 power power on Chassis Power Control: Up/On [root@test-plccg power]#

After reboot of node1, the installation started. However it got stuck in an install loop. This happened, because PXE is the first boot device in the nodes.

[root@test-plccg power]# cobbler report --what=systems | egrep -i "hostname|netboot" hostname  : compute1.example.com netboot enabled?  : True hostname  : compute2.example.com netboot enabled?  : True [root@test-plccg 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

This worked!

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

Now the few other issues.

1) Static IP for eth1, and see if it still installs from DHCP server. 2) disable eth0 so it does not wait for dhcp when the node reboots in to local os /disk. 3) How to check if the nodes are installed? 4) Console redirection during TFTP and installation.


1) Static IP:-

[root@test-plccg ~]# 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:-

[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 ~]#


2) disable eth0 [root@test-plccg ~]# 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.

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

[root@test-plccg ~]# 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@test-plccg ~]#

This time it worked. I have lovely results!

[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.

However the node was not able to ping any other node on IPMI interface. hmmmmmmm.

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

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


Trying this:- [root@test-plccg ~]# cobbler system edit --name=compute1 --delete-interface=eth0

This did not help prevent eth0 asking for dhcp / IP.



Day n+1 (3?)


How to pass console redirection options to TFTP file:-

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


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

[root@test-plccg ~]# 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@test-plccg ~]#

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

[root@test-plccg ~]# 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@test-plccg ~]#


Now check the profiles:-

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


We are interested in profile named "ComputeNodes":-

[root@test-plccg ~]# 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@test-plccg ~]#


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


[root@test-plccg ~]# cobbler sync Starting dhcpd: [ OK ] [root@test-plccg ~]#


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

[root@test-plccg ~]# cobbler sync Shutting down dhcpd: [ OK ] Starting dhcpd: [ OK ]

[root@test-plccg ~]# 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@test-plccg ~]#



ipmiconsole

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

[root@test-plccg ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=redhat ipmiconsole_submit_block: internal system error

[root@test-plccg ~]# 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

[root@test-plccg ~]# ifconfig eth0 192.168.0.201 netmask 255.255.255.0 up

[root@test-plccg ~]# 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@test-plccg ~]# ipmiconsole --hostname=192.168.0.1 --username=root --password=ipmisecret [SOL established]


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

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

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

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



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.

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?

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

Day 2:

Cobbler howto-2

=

[root@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# 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@test-plccg ~]#


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


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


No systems are registered with cobbler at the moment:-

[root@test-plccg ~]# cobbler system list [root@test-plccg ~]#


Lets create a profile for compute-nodes:-

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


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


[root@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# 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@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# cd /var/lib/cobbler/kickstarts/

[root@test-plccg kickstarts]# cp sample.ks Compute.ks

[root@test-plccg 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@test-plccg kickstarts]#


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


Verify the change:-

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


Now define/ add compute nodes:-

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

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



Note ----------

In case you try to make a duplicate entry:-

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


[root@test-plccg ~]# cobbler system list compute1 compute2 [root@test-plccg ~]#


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

[root@test-plccg ~]# 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@test-plccg ~]#

I need to change the interface from eth0 to eth1.

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

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


[root@test-plccg ~]# 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@test-plccg ~]#


[root@test-plccg ~]# 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@test-plccg ~]#


service cobblerd restart

[root@test-plccg ~]# service dhcpd restart Starting dhcpd: [FAILED] [root@test-plccg ~]#


Wasted all my day. This is the fix:-

[root@test-plccg ~]# cobbler sync Shutting down dhcpd: [ OK ] Starting dhcpd: [ OK ]


[root@test-plccg ~]# 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@test-plccg ~]#

Personal tools