[et-mgmt-tools] How to use Cobbler to manage DHCP automatically when you have multiple subnets

Michael DeHaan mdehaan at redhat.com
Fri Sep 7 20:49:07 UTC 2007

Discussion on IRC today yielded the need for a new feature, which you 
can try out in the latest git.   The feature is this.   Make Cobbler's 
integrated DHCP management
work better with configurations that require multiple subnets.  
Originally I wrote dhcp management as a helper for "simple" deployment 
cases.   This allows it to be used in much more complex deployments.    
So I think this is pretty neat:

New option for "system add" commands:  --dhcp-tag

If you are setting up a PXE environment with multiple subnets/gateways, 
and are using cobbler to manage a DHCP configuration, you will want this 

By default, the dhcp tag for all systems is "default" and means that in 
the DHCP template files the systems will expand out where 
$insert_cobbler_systems_definitions is found in the DHCP template.  
However, you may want certain systems to expand out in other places in 
the file.  Setting --dhcp-tag=subnet2 for instance, will cause that 
system to expand out where $insert_cobbler_system_definitions_subnet2 is 
found, allowing you to insert directives to specify different subnets 
(or other parameters) before the DHCP configuration entries for those 
particular systems.

Example:  cobbler system add --name=foo --mac=AA:BB:CC:DD:EE:CC 
Example:  cobbler system add --name=foo --mac=AA:BB:CC:DD:EE:DD 
Example:  cobbler system add --name=foo --mac=AA:BB:CC:DD:EE:EE
Example:  cobbler system add --name=foo --mac=AA:BB:CC:DD:EE:FF

In the above examples, when you look at /etc/cobbler/dhcp.template, the 
last two systems would expand out where you see 
The other two, respectively, would expand out with 
"$insert_cobbler_system_definitions_megalab" and 

This allows you to assign different DHCP parameters to "superlab" and 
"megalab" ... and prevents you from having to run multiple DHCP servers 
or turn off cobbler's
built in DHCP management features.

(As an aside:  You can also specify --dhcp-tag on the "profile" object, 
for convience ...  so you might have a profile called "fc6webservers" 
and another profile that inherits
from that called "fc6webservers-in-megalab" ... and systems added to 
that profile would work automatically.)


More information about the et-mgmt-tools mailing list