Re: [Kea-users] Kea Configuration Backend Example / Documentation

2020-08-24 Thread Klaus Steden
Hey Kenny,

I can't speak to the experience of using any of the native Kea methods, but
working with the MySQL API has proven effective for us; I would recommend
being extra cautious since whatever application method you use if you go
the MySQL route will have to deal with locking, consistency, etc. concerns
directly.

We were able to build what we needed by consulting the MySQL Kea schema
directly; it should get installed with the application (it's in kea-admin
if you're on Ubuntu/Debian). I found that to be enough for creating
programmatic tools for managing leases/reservations, options should be
reasonably straightforward as well.

cheers,
Klaus

On Mon, Aug 24, 2020 at 5:07 AM Kenny Unger  wrote:

> Klaus,
>
> Thank you very much for taking the time to respond to my inquiry. I would
> be very interested in the more technical aspects of your process flow. I
> have no problem setting up a separate source of truth in regards to the
> DHCP configuration data as long as I can actually get that data into Kea.
> This is where I'm struggling. Unless I'm mistaken, my only options for
> inputting DHCP subnet/scope/option data into Kea is via direct MySQL or via
> the cb_cmds premium hook library. Does anyone know of alternate methods? I
> have no problem utilizing direct MySQL. I'm currently stuck on how the
> option value data should be formatted in the dhcp4_options table. I
> somewhat feel like there's some documentation out there that I'm unable to
> find. There must be some guide for developers or automation engineers which
> describes which records and columns are required, how they're to be
> formatted, etc.
>
> I'd be happy for someone to tell me a simpler way of achieving this that
> I've overlooked! :)
>
> Thanks!
> Kenny
>
> On Sun, Aug 23, 2020 at 5:58 PM Klaus Steden  wrote:
>
>>
>> Hi there,
>>
>> We use MySQL as a backend for our Kea infrastructure, and at the time we
>> were doing application development, the hook libraries were all licensed
>> products and a lot of the other nice glue just didn't exist. Granted we
>> don't do anything terrible sophisitcated with our setup, but within our
>> environment, Kea itself is managed by the aforementioned application using
>> standard MySQL APIs; the configuration itself that Kea supports lives in
>> that application's database (VLAN info, subnet IDs, scopes, etc.) using
>> fairly basic but predictable rules, and the application has an HTTP
>> endpoint that will generate YAML of all our scopes that we then feed into
>> Salt states to manage the Kea config. It sounds maybe a bit more
>> complicated than it actually is, but the basic gist is:
>>
>> - scope information is managed by an in-house provisioning application
>> - said application generates configuration data that is loaded directly
>> into our configuration management pipeline
>> - said configuration management pipeline is used to keep our Kea servers
>> up to date
>> - said application supports API-driven management of lease/reservation
>> data directly in Kea via Python's MySQL API
>>
>> Granted, our use case is very specific -- we use Kea as more of a
>> programmatic resource for a general-purpose infrastructure provisioning
>> service -- but it's definitely done a lot of heavy lifting for us over the
>> last 2-3 years. I guess maybe what I'm saying is you may get where you want
>> to go using other approaches to managing DHCP as a service via Kea without
>> having to dive directly into its APIs, and while a separate information
>> source adds complexity, if you can script the interactions between it and
>> Kea, it's possible to end up with the results it sounds like you're looking
>> for.
>>
>> hth,
>> Klaus
>>
>> On Fri, Aug 21, 2020 at 11:08 AM KennyU05  wrote:
>>
>>> Hello,
>>>
>>> I'm attempting to build some in-house automation processes on top of
>>> Kea. It
>>> will utilize a MariaDB Galera database on the backend. As part of this
>>> tool,
>>> I will be required to insert configuration data directly into the Kea
>>> MySQL
>>> database. I've been frustratingly fumbling my way through creating the
>>> subnet, the pool, and all the associated links between the subnet and the
>>> server. Right now I'm trying to figure out how to create the options. We
>>> don't use anything non-standard. However, I'm having difficulty
>>> understanding what the requirements are for the dhcp4_options table. I've
>>> read through the ARM as well as the database creation script in source. I
>>> even dug into some of Kea's code to try to understand what it was looking
>>> for. Granted, I'm a SysAdmin by trade, so my coding abilities aren't as
>>> skilled as the Kea devs.
>>>
>>> What I'm hoping to find is more clear documentation or examples of a
>>> MySQL
>>> configuration backend that demonstrates the data required to have a fully
>>> functioning DHCP server. This could be as simple as a MySQL dump of a
>>> simple
>>> working database.
>>>
>>> I know that ISC probably wants to encourage people to use the 

Re: [Kea-users] Kea Configuration Backend Example / Documentation

2020-08-24 Thread Kenny Unger
Klaus,

Thank you very much for taking the time to respond to my inquiry. I would
be very interested in the more technical aspects of your process flow. I
have no problem setting up a separate source of truth in regards to the
DHCP configuration data as long as I can actually get that data into Kea.
This is where I'm struggling. Unless I'm mistaken, my only options for
inputting DHCP subnet/scope/option data into Kea is via direct MySQL or via
the cb_cmds premium hook library. Does anyone know of alternate methods? I
have no problem utilizing direct MySQL. I'm currently stuck on how the
option value data should be formatted in the dhcp4_options table. I
somewhat feel like there's some documentation out there that I'm unable to
find. There must be some guide for developers or automation engineers which
describes which records and columns are required, how they're to be
formatted, etc.

I'd be happy for someone to tell me a simpler way of achieving this that
I've overlooked! :)

Thanks!
Kenny

On Sun, Aug 23, 2020 at 5:58 PM Klaus Steden  wrote:

>
> Hi there,
>
> We use MySQL as a backend for our Kea infrastructure, and at the time we
> were doing application development, the hook libraries were all licensed
> products and a lot of the other nice glue just didn't exist. Granted we
> don't do anything terrible sophisitcated with our setup, but within our
> environment, Kea itself is managed by the aforementioned application using
> standard MySQL APIs; the configuration itself that Kea supports lives in
> that application's database (VLAN info, subnet IDs, scopes, etc.) using
> fairly basic but predictable rules, and the application has an HTTP
> endpoint that will generate YAML of all our scopes that we then feed into
> Salt states to manage the Kea config. It sounds maybe a bit more
> complicated than it actually is, but the basic gist is:
>
> - scope information is managed by an in-house provisioning application
> - said application generates configuration data that is loaded directly
> into our configuration management pipeline
> - said configuration management pipeline is used to keep our Kea servers
> up to date
> - said application supports API-driven management of lease/reservation
> data directly in Kea via Python's MySQL API
>
> Granted, our use case is very specific -- we use Kea as more of a
> programmatic resource for a general-purpose infrastructure provisioning
> service -- but it's definitely done a lot of heavy lifting for us over the
> last 2-3 years. I guess maybe what I'm saying is you may get where you want
> to go using other approaches to managing DHCP as a service via Kea without
> having to dive directly into its APIs, and while a separate information
> source adds complexity, if you can script the interactions between it and
> Kea, it's possible to end up with the results it sounds like you're looking
> for.
>
> hth,
> Klaus
>
> On Fri, Aug 21, 2020 at 11:08 AM KennyU05  wrote:
>
>> Hello,
>>
>> I'm attempting to build some in-house automation processes on top of Kea.
>> It
>> will utilize a MariaDB Galera database on the backend. As part of this
>> tool,
>> I will be required to insert configuration data directly into the Kea
>> MySQL
>> database. I've been frustratingly fumbling my way through creating the
>> subnet, the pool, and all the associated links between the subnet and the
>> server. Right now I'm trying to figure out how to create the options. We
>> don't use anything non-standard. However, I'm having difficulty
>> understanding what the requirements are for the dhcp4_options table. I've
>> read through the ARM as well as the database creation script in source. I
>> even dug into some of Kea's code to try to understand what it was looking
>> for. Granted, I'm a SysAdmin by trade, so my coding abilities aren't as
>> skilled as the Kea devs.
>>
>> What I'm hoping to find is more clear documentation or examples of a MySQL
>> configuration backend that demonstrates the data required to have a fully
>> functioning DHCP server. This could be as simple as a MySQL dump of a
>> simple
>> working database.
>>
>> I know that ISC probably wants to encourage people to use the cb_cmds
>> subscriber-only hook, and I don't blame them. At the same time, if they
>> want
>> people to really switch away from the old ISC-DHCP implementation they
>> should make Kea as easy to adopt as possible.
>>
>> If I can't get the Kea CB figured out, I'll just end up writing scripts to
>> generate the old JSON configuration files based of a database of my own
>> creation.
>>
>> Any help or insight from people who have gone through this struggle would
>> be
>> greatly appreciated!
>>
>> Thanks!
>> Kenny
>>
>>
>>
>> --
>> Sent from: http://kea-users.7364.n8.nabble.com/
>> ___
>> ISC funds the development of this software with paid support
>> subscriptions. Contact us at https://www.isc.org/contact/ for more
>> information.
>>
>> To unsubscribe visit 

Re: [Kea-users] Kea Configuration Backend Example / Documentation

2020-08-23 Thread Klaus Steden
Hi there,

We use MySQL as a backend for our Kea infrastructure, and at the time we
were doing application development, the hook libraries were all licensed
products and a lot of the other nice glue just didn't exist. Granted we
don't do anything terrible sophisitcated with our setup, but within our
environment, Kea itself is managed by the aforementioned application using
standard MySQL APIs; the configuration itself that Kea supports lives in
that application's database (VLAN info, subnet IDs, scopes, etc.) using
fairly basic but predictable rules, and the application has an HTTP
endpoint that will generate YAML of all our scopes that we then feed into
Salt states to manage the Kea config. It sounds maybe a bit more
complicated than it actually is, but the basic gist is:

- scope information is managed by an in-house provisioning application
- said application generates configuration data that is loaded directly
into our configuration management pipeline
- said configuration management pipeline is used to keep our Kea servers up
to date
- said application supports API-driven management of lease/reservation data
directly in Kea via Python's MySQL API

Granted, our use case is very specific -- we use Kea as more of a
programmatic resource for a general-purpose infrastructure provisioning
service -- but it's definitely done a lot of heavy lifting for us over the
last 2-3 years. I guess maybe what I'm saying is you may get where you want
to go using other approaches to managing DHCP as a service via Kea without
having to dive directly into its APIs, and while a separate information
source adds complexity, if you can script the interactions between it and
Kea, it's possible to end up with the results it sounds like you're looking
for.

hth,
Klaus

On Fri, Aug 21, 2020 at 11:08 AM KennyU05  wrote:

> Hello,
>
> I'm attempting to build some in-house automation processes on top of Kea.
> It
> will utilize a MariaDB Galera database on the backend. As part of this
> tool,
> I will be required to insert configuration data directly into the Kea MySQL
> database. I've been frustratingly fumbling my way through creating the
> subnet, the pool, and all the associated links between the subnet and the
> server. Right now I'm trying to figure out how to create the options. We
> don't use anything non-standard. However, I'm having difficulty
> understanding what the requirements are for the dhcp4_options table. I've
> read through the ARM as well as the database creation script in source. I
> even dug into some of Kea's code to try to understand what it was looking
> for. Granted, I'm a SysAdmin by trade, so my coding abilities aren't as
> skilled as the Kea devs.
>
> What I'm hoping to find is more clear documentation or examples of a MySQL
> configuration backend that demonstrates the data required to have a fully
> functioning DHCP server. This could be as simple as a MySQL dump of a
> simple
> working database.
>
> I know that ISC probably wants to encourage people to use the cb_cmds
> subscriber-only hook, and I don't blame them. At the same time, if they
> want
> people to really switch away from the old ISC-DHCP implementation they
> should make Kea as easy to adopt as possible.
>
> If I can't get the Kea CB figured out, I'll just end up writing scripts to
> generate the old JSON configuration files based of a database of my own
> creation.
>
> Any help or insight from people who have gone through this struggle would
> be
> greatly appreciated!
>
> Thanks!
> Kenny
>
>
>
> --
> Sent from: http://kea-users.7364.n8.nabble.com/
> ___
> ISC funds the development of this software with paid support
> subscriptions. Contact us at https://www.isc.org/contact/ for more
> information.
>
> To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.
>
> Kea-users mailing list
> Kea-users@lists.isc.org
> https://lists.isc.org/mailman/listinfo/kea-users
>
___
ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.

Kea-users mailing list
Kea-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users


[Kea-users] Kea Configuration Backend Example / Documentation

2020-08-21 Thread KennyU05
Hello,

I'm attempting to build some in-house automation processes on top of Kea. It
will utilize a MariaDB Galera database on the backend. As part of this tool,
I will be required to insert configuration data directly into the Kea MySQL
database. I've been frustratingly fumbling my way through creating the
subnet, the pool, and all the associated links between the subnet and the
server. Right now I'm trying to figure out how to create the options. We
don't use anything non-standard. However, I'm having difficulty
understanding what the requirements are for the dhcp4_options table. I've
read through the ARM as well as the database creation script in source. I
even dug into some of Kea's code to try to understand what it was looking
for. Granted, I'm a SysAdmin by trade, so my coding abilities aren't as
skilled as the Kea devs.

What I'm hoping to find is more clear documentation or examples of a MySQL
configuration backend that demonstrates the data required to have a fully
functioning DHCP server. This could be as simple as a MySQL dump of a simple
working database.

I know that ISC probably wants to encourage people to use the cb_cmds
subscriber-only hook, and I don't blame them. At the same time, if they want
people to really switch away from the old ISC-DHCP implementation they
should make Kea as easy to adopt as possible.

If I can't get the Kea CB figured out, I'll just end up writing scripts to
generate the old JSON configuration files based of a database of my own
creation.

Any help or insight from people who have gone through this struggle would be
greatly appreciated!

Thanks!
Kenny



--
Sent from: http://kea-users.7364.n8.nabble.com/
___
ISC funds the development of this software with paid support subscriptions. 
Contact us at https://www.isc.org/contact/ for more information.

To unsubscribe visit https://lists.isc.org/mailman/listinfo/kea-users.

Kea-users mailing list
Kea-users@lists.isc.org
https://lists.isc.org/mailman/listinfo/kea-users