Looked up the directions here, and the steps are pretty straight forward. If you're continuing from my previous post, it would look something like this:
- insert your dvd with the distro
- yum -y install dhcp
- mount /dev/dvd /media
- cobbler import --path=/media --name=CentOS6 (this takes a while, press [CTRL+Z], then run bg [ENTER] to send it to the background)
- vi /etc/cobbler/dhcp.template
- edit per your network, mine looked like this:
option routers 10.1.2.1;
option domain-name-servers 68.87.85.102 68.87.69.150;
option subnet-mask 255.255.255.0;
range dynamic-bootp 10.1.2.100 10.1.2.254;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server 10.1.2.26;
}
- service cobblerd restart
- cobbler sync
All is well, we're now ready to PXE boot clients, and Cobbler will..... what's this?
running: dhcpd -t -q
received on stdout:
received on stderr:
dhcpd -t failed
Exception occured: <class 'cobbler.cexceptions.CX'>
Exception value: 'cobbler trigger failed: cobbler.modules.sync_post_restart_services'
Exception Info:
File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 89, in run
rc = self._run(self)
File "/usr/lib/python2.6/site-packages/cobbler/remote.py", line 184, in runner
return self.remote.api.sync(self.options.get("verbose",False),logger=self.logger)
File "/usr/lib/python2.6/site-packages/cobbler/api.py", line 701, in sync
return sync.run()
File "/usr/lib/python2.6/site-packages/cobbler/action_sync.py", line 155, in run
utils.run_triggers(self.api, None, "/var/lib/cobbler/triggers/sync/post/*", logger=self.logger)
File "/usr/lib/python2.6/site-packages/cobbler/utils.py", line 918, in run_triggers
raise CX("cobbler trigger failed: %s" % m.__name__)
!!! TASK FAILED !!!
hmm.. well, we can see that there is an issue with dhcpd, lets try to start the service on it's own:
[root@OPS8-Cobbler ~]# service dhcpd start
Starting dhcpd: [FAILED]
[root@OPS8-Cobbler ~]#
Starting dhcpd: [FAILED]
[root@OPS8-Cobbler ~]#
Here's the log from /var/log/messages while trying to start the service above:
Jul 2 17:38:48 OPS8-Cobbler dhcpd: Internet Systems Consortium DHCP Server 4.1.1-P1
Jul 2 17:38:48 OPS8-Cobbler dhcpd: Copyright 2004-2010 Internet Systems Consortium.
Jul 2 17:38:48 OPS8-Cobbler dhcpd: All rights reserved.
Jul 2 17:38:48 OPS8-Cobbler dhcpd: For info, please visit https://www.isc.org/software/dhcp/
Jul 2 17:38:48 OPS8-Cobbler dhcpd: /etc/dhcp/dhcpd.conf line 19: semicolon expected.
Jul 2 17:38:48 OPS8-Cobbler dhcpd: option domain-name-servers 68.87.85.102 68.
Jul 2 17:38:48 OPS8-Cobbler dhcpd: ^
Jul 2 17:38:48 OPS8-Cobbler dhcpd: Configuration file errors encountered -- exiting
Jul 2 17:38:48 OPS8-Cobbler dhcpd:
Looking at /etc/dhcp/dhcpd.conf, I realized that I'd left a comma out of the template config. It should look like the following in /etc/cobbler/dhcp.template:
subnet 10.1.2.0 netmask 255.255.255.0 {
option routers 10.1.2.1;
option domain-name-servers 68.87.85.102, 68.87.69.150;
option subnet-mask 255.255.255.0;
range dynamic-bootp 10.1.2.100 10.1.2.254;
filename "/pxelinux.0";
default-lease-time 21600;
max-lease-time 43200;
next-server 10.1.2.26;
}
Now we restart the service and run a sync....
[root@OPS8-Cobbler ~]# service cobblerd restart
Stopping cobbler daemon: [ OK ]
Starting cobbler daemon: [ OK ]
[root@OPS8-Cobbler ~]# cobbler sync
task started: 2012-07-02_174015_sync
task started (id=Sync, time=Mon Jul 2 17:40:15 2012)
...
rendering DHCP files
generating /etc/dhcp/dhcpd.conf
...
running: dhcpd -t -q
received on stdout:
received on stderr:
running: service dhcpd restart
received on stdout: Starting dhcpd: [ OK ]
...
*** TASK COMPLETE ***
[root@OPS8-Cobbler ~]#
much better.
A simple PXE test confirms that the service is working and providing addresses successfully. However, I wasn't able to get the PXE menu to load on a network boot... turns out that I didn't have the proper Firewall settings. You can test by stopping your firewall (service iptables stop) and trying again; watch out for tcp/udp differences!! After using the information under Firewall on this page I was able to get the PXE boot menu to load and test the install.
What comma? my understanding is the dhcp.template uses only semi-colons or curly brackets.
ReplyDeleteif you look at the second config I posted, I have two IP's listed on the 'option domain-name-servers' line. In order for that to work, there needs to be a comma between them, which I didn't have in the first one.
ReplyDeleteThis was true for Cobbler 2.2 on CentOS 6.2. It's possible that the newer version may have changed the format for that template.
Updated links to relevant pages.
Thanks for the post, I made a very similar mistake.
ReplyDeleteThanks for this - I ran into the same problem a couple of minutes ago with my Cobbler 2.4 install. Dreaded having to backtrack all that Python, but your article above was really helpful.
ReplyDeleteWow, thank the lord you posted this. I had the same problem and would have taken me hours to figure it out.
ReplyDelete