fwd: host config file based on vendor specific options and service level

roger murray romu42 at gmail.com
Fri Apr 7 13:04:11 UTC 2006


Sorry,
accidentally answered only glenn. forwarding to dhcp-users in case others
are interested.

/rog

---------- Forwarded message ----------
From: roger murray <romu42 at gmail.com>
Date: Apr 7, 2006 1:59 PM
Subject: Re: host config file based on vendor specific options and service
level
To: Glenn Satchell <Glenn.Satchell at uniq.com.au>

The problem is that I have to build the config on two pieces of information.
1. vendor-specific-option using model and manufacturer and software version,
currently 9 different combinations.
2. A service level that I receive from a business system. So each host could
have hypothetically one of 4 different service levels, slow, fast, faster,
and ludicrous speed.

I started out trying to get it to work with classes, but couldn't quite get
it to work logically in my head. The example I sent was a little shorter
than reality, a better example of how the host declarations will be
formatted is as below. + 2 more for faster and ludicrous speed.


 ex. host declarations before change:

 host A-1-001 {
         filename "service_A";
         hardware ethernet aa:bb:cc:dd:ee:ef;
         fixed-address 10.xx.yy.yz;
 }

 host B-1-001 {
         filename "service_B";

         hardware ethernet aa:bb:cc:dd:ee:ff;
         fixed-address 10.xx.yy.zz;
 }


 host A-1-001 {

         if (substring (option Vendor.model, 0, 6) = "Model_1") {
                 filename "config_file_Model_1_service_A";

         } elsif (substring (option Vendor.model, 0, 6) = "Model_2") {
                 filename "config_file_Model_2_service_A";
         } elsif (substring (option Vendor.model, 0, 6) = "Model_3") {
                 filename "config_file_Model_3_service_A";
         } elsif (substring (option Vendor.model, 0, 6) = "Model_4") {
                 filename "config_file_Model_4_service_A";
         } else {
                 filename "config_file_catch_all";
         }
         hardware ethernet aa:bb:cc:dd:ee:ef;
         fixed-address 10.xx.yy.yz;
 }

 host B-117-001 {

         if (substring (option Vendor.model, 0, 6) = "Model_1") {
                 filename "config_file_Model_1_service_B";

         } elsif (substring (option Vendor.model, 0, 6) = "Model_2") {
                 filename "config_file_Model_2_service_B";
         } elsif (substring (option Vendor.model, 0, 6) = "Model_3") {
                 filename "config_file_Model_3_service_B";
         } elsif (substring (option Vendor.model, 0, 6) = "Model_4") {
                 filename "config_file_Model_4_service_B";
         } else {
                 filename "config_file_catch_all";

         }
         hardware ethernet aa:bb:cc:dd:ee:ff;
         fixed-address 10.xx.yy.zz;
 }

Like I said we are really open to suggestions, and appreciate any and all
help. I am already sketching on the design on how we can do it with to
servers running at the same time. I like the simplicity of it, and instead
of increasing our service downtime from 15 seconds to 30 seconds we decrease
to almost 0. I will definitely get back to the list with our final solution
and how it works for us. If you have any idea how I can get it to work with
classes I would be interested in hearing it, like I said I haven't been able
to get my head around it. It would be really interesting to build both
solutions and then get some comparison numbers.

Thanks again for all the interest.

Best regards,

/rog




On 4/7/06, Glenn Satchell < Glenn.Satchell at uniq.com.au> wrote:
>
> Wow, this is weird, chopped off at the same spot twice... Will this one
> get
> through ok?
>
> ------------- Begin Forwarded Message -------------
>
> >Date: Thu, 6 Apr 2006 20:56:02 +0200
> >From: "roger murray" <romu42 at gmail.com>
> >To: dhcp-users at isc.org
> >Subject: host config file based on vendor specific options and service
> level
> >
> >Dear dhcp-users,
> > We have a problem that we have solved, but we are not completely
> > satisfied with the results. It works, but we were wondering if any of
> > you had a suggestion to a better solution. The main problem with the
> > solution is that it doubles our start up time. 30 seconds from 15. We
> > restart the dhcpd every 5th minute.  We have discussed OMAPI, but are
> > not mature to the idea yet.
> >
> >Problem:
> >Based on vendor-specific-options and a service level defined by a
> >provisioning system offer the proper configuration file to the host.
> >
> >Constraints:
> >All hosts will be assigned a fixed ip address due to monitoring tools and
> >current routines. (190,000+ hosts, 350+ shared networks, 1800+ subnets)
> >
> >Current solution is that we specify the hosts and service levels in a
> >database and build the dhcpd.conf file with a script restarting the dhcpd
> >every 5 minutes. Start up takes 12-15 seconds.
> >
> >The proposed solution is to using vendor-specific-options match the
> proper
> >configuration file in the host declaration.
> >
> >ex. host declarations before change:
> >
> >host A1 {
> >       filename "service_A";
> >       hardware ethernet aa:bb:cc:dd:ee:ff;
> >       fixed-address 10.xx.yy.zz;
> >}
> >
> >ex. host declarations after change:
> >
> >host A1 {
> >       if (substring (option Vendor.model, 0, 6) = "Model_1") {
> >               filename "config_file_1";
> >       } else (substring (option Vendor.model, 0, 6) = "Model_2") {
> >               filename "config_file_2";
> >       }
> >       hardware ethernet aa:bb:cc:dd:ee:ff;
> >       fixed-address 10.xx.yy.zz;
> >}
>
> What about putting the "if" part in the global scope, assuming the same
> set of config_file_* and vendor.model apply to all hosts, eg:
>
> if (substring (option Vendor.model, 0, 6) = "Model_1") {
>         filename "config_file_1";
> } elsif (substring (option Vendor.model, 0, 6) = "Model_2") {
>         filename "config_file_2";
> }
>
> host A1 {
>        hardware ethernet aa:bb:cc:dd:ee:ff;
>        fixed-address 10.xx.yy.zz;
> }
>
> or, perhaps using classes, eg:
>
> class "Model_1" {
>        match if option Vendor.model, 0, 6) = "Model_1";
>        filename "config_file_1";
> }
> class "Model_2" {
>        match if option Vendor.model, 0, 6) = "Model_2";
>        filename "config_file_2";
> }
> host A1 {
>        hardware ethernet aa:bb:cc:dd:ee:ff;
>        fixed-address 10.xx.yy.zz;
> }
>
> I guess the method using classes might be a little quicker to parse,
> but it should be easy enough to test by creating a file and using dhcpd
> -t -cf dhcpd.conf.test and timing that. Of course if you have many
> different config files, and they could be different for similar hosts
> then this scheme won't work.
>
> I saw Simon's reply and the idea of using more than one dhcp server
> should definitely reduce the impact of a 30 second (or longer) startup
> every 5 minutes. as you are generating the conf file you could even
> divide all the hosts between two or more servers. If the above ideas
> work then using omapi would be very easy as a simple host record is all
> that would be added.
>
> I'm sure there are many on the list who would be interested in hearing
> how you go, given the large network you're running.
>
> regards,
> -glenn
>
> ------------- End Forwarded Message -------------
>
>
>



More information about the dhcp-users mailing list