[Kea-users] Host reservations in MySQL database

mrobti at insiberia.net mrobti at insiberia.net
Fri Nov 11 03:31:58 UTC 2016

On 2016-11-09 23:02, Christian Garling wrote:
> Am 09.11.2016 um 20:05 schrieb mrobti at insiberia.net:
>> On 2016-11-09 10:19, Christian Garling wrote:
>>> Hello,
>>> I am setting up KEA as part of a provisioning system. Therefore I 
>>> want
>>> to use host reservations with MySQL to realize PXE boot of my
>>> machines. My dataset consists of:
>>> dhcp_identifier=x'ab12cd34ef56' (MAC address of the system in lower
>>> case letters withouts colons)
>> I'm still trying to make it work myself, but I think you have a 
>> problem here.  That should be a binary string:
>> dhcp_identifier = UNHEX(REPLACE('aa:bb:cc:dd:ee:ff', ':', ''))
> Hm, is that way different to x'value'?

No it's the same, I missed the "x" in your OP.

>>> I did not find any format specification how to store the data above
>>> correctly in the database. Specially the dhcp_identifier could be
>>> wrong I think.
>> I found this:
>> https://kea.isc.org/wiki/HostReservationsHowTo
> I found this too, but it does not specify the field types and it does
> not give an example how data should be stored.

Agree, the docs are sparse and you have to dig around the database 
source and other places to make sense of it.

>>> I already enabled the MySQL general log and there I can see a lot of
>>> queries from the KEA server, so the database connections seems to be
>>> fine.
>> By the way, do you happen to know how to make MySQL log show the 
>> contents of the executed query? My log only shows the prepared format, 
>> even when executing:
>> Execute        SELECT host_id, dhcp_identifier, dhcp_identifier_type, 
>> dhcp4_subnet_id, dhcp6_subnet_id, ipv4_address, hostname, 
>> dhcp4_client_classes, dhcp6_client_classes FROM hosts WHERE 
>> dhcp4_subnet_id = ? AND dhcp_identifier_type = ?    AND 
>> dhcp_identifier = ?
> I have this in my.cnf:
> general_log_file        = /var/log/mysql/mysql.log
> general_log              = 1

That's odd, must be a difference in packaging, I'll have to ask in a 
MySQL forum. Thanks.

More information about the Kea-users mailing list