Kea issueshttps://gitlab.isc.org/isc-projects/kea/-/issues2024-03-22T09:52:31Zhttps://gitlab.isc.org/isc-projects/kea/-/issues/3294Deletion of v6 reservation over API by address causes all v6 reservations to ...2024-03-22T09:52:31ZAndrew MulheirnDeletion of v6 reservation over API by address causes all v6 reservations to disappear---
name: Deletion of v6 reservation over API by address causes all v6 reservations to disappear
about: Kea 2.4.1
---
**Describe the bug**
I am using the API to add and remove reservations for v4 and v6.
I find that removing a v4 re...---
name: Deletion of v6 reservation over API by address causes all v6 reservations to disappear
about: Kea 2.4.1
---
**Describe the bug**
I am using the API to add and remove reservations for v4 and v6.
I find that removing a v4 reservation by IP address works as expected, but removing a v6 reservation results in all reservations being deleted.
**To Reproduce**
Steps to reproduce the behavior:
1. Create two v6 reservations in the database
2. send a 'reservation-del' to the dhcp6 process via the API to remove one address
3. run a 'reservation-get-all' and receive the message ```"text": "0 IPv6 host(s) found."```
4. Perform the same sequence with v4 and it succeeds
5. Check the postgres database contents and see that the v6 reservations table is empty
Note that if I do a deletion specifying the flex-id or DUID of a reservation, only that single reservation is removed.
**Expected behavior**
I am expecting that a single IPv6 reservation is deleted.
**Environment:**
- Kea version: 2.4.1
- OS: Ubuntu 22.04.4 LTS
- Installed from kea packages on cloudsmith
- Flex-id, HA, host commands and lease commands are in use.
**Additional Information**
reservation-get-all result over api:
```
[
{
"arguments": {
"hosts": [
{
"client-classes": [],
"flex-id": "67622D6C6F6E39382D7273773030313A78652D302F302F33",
"hostname": "123123.vorboss.lab",
"ip-addresses": [
"2a00:e340:1102::3"
],
"option-data": [],
"prefixes": [
"2a00:e340:1103:300::/56"
],
"subnet-id": 1
},
{
"client-classes": [],
"flex-id": "67622D6C6F6E39382D7273773030313A78652D302F302F34",
"hostname": "123124.vorboss.lab",
"ip-addresses": [
"2a00:e340:1102::4"
],
"option-data": [],
"prefixes": [
"2a00:e340:1103:400::/56"
],
"subnet-id": 1
}
]
},
"result": 0,
"text": "2 IPv6 host(s) found."
}
]
```
Deletion sent:
```
{
"command": "reservation-del",
"service": ["dhcp6"],
"arguments": {
"subnet-id": 1,
"ip-address": "2a00:e340:1102::4"
}
}
```
Debug from kea-ctrl-agent:
```
INFO COMMAND_RECEIVED Received command 'reservation-del'
DEBUG HOOKS_CALLOUTS_BEGIN begin all callouts for hook $reservation_del
INFO HOST_CMDS_RESERV_DEL reservation-del command called (parameters: { "ip-address": "2a00:e340:1102::4", "subnet-id": 1 })
INFO HOST_CMDS_RESERV_DEL_SUCCESS reservation-del command success (parameters: { "ip-address": "2a00:e340:1102::4", "subnet-id": 1 })
DEBUG HOOKS_CALLOUT_CALLED hooks library with index 2 has called a callout on hook $reservation_del that has address 0x7ff2f67cecb0 (callout duration: 3.743 ms)
DEBUG HOOKS_CALLOUTS_COMPLETE completed callouts for hook $reservation_del (total callouts duration: 3.743 ms)
```
Subsequent reservation-get-all:
```
[
{
"arguments": {
"hosts": []
},
"result": 3,
"text": "0 IPv6 host(s) found."
}
]
```
**Contacting you**
My work email is andrew.mulheirn@vorboss.comkea2.5.8https://gitlab.isc.org/isc-projects/kea/-/issues/2878Host Commands require subnet-id to add or manage host reservation2023-11-07T13:04:00ZMarcin GodzinaHost Commands require subnet-id to add or manage host reservationRecently empty host reservations were made valid (containing only hardware address), but Host Command still require providing a `subnet-id` to add or manage leases.
Empty host reservations were added here https://gitlab.isc.org/isc-proj...Recently empty host reservations were made valid (containing only hardware address), but Host Command still require providing a `subnet-id` to add or manage leases.
Empty host reservations were added here https://gitlab.isc.org/isc-projects/kea/-/issues/2723next-stable-2.6https://gitlab.isc.org/isc-projects/kea/-/issues/2828Document or fix database conflicts between v4 hosts and v6 hosts2023-04-20T13:38:11ZAndrei Pavelandrei@isc.orgDocument or fix database conflicts between v4 hosts and v6 hostsSay there are a kea-dhcp4 server and a kea-dhcp6 server with both their `hosts-databases` set to the same database.
If an administrator wants to reserve v4 resources and v6 resources for the same client identified by a common identifier...Say there are a kea-dhcp4 server and a kea-dhcp6 server with both their `hosts-databases` set to the same database.
If an administrator wants to reserve v4 resources and v6 resources for the same client identified by a common identifier type, say hardware address, the host schema goes out if its way to allow this, having separate `dhcp4_subnet_id` and `dhcp6_subnet_id` columns, separate `dhcp4_options` and `dhcp6_options` tables, and so on.
However, the response to the second of the two `reservation-add` commands that are issued for each server, is `Database duplicate entry error`.
What's worse is that the administrator might assume that there is already a reservation with that identifier in the database, but if you follow up with a `reservation-get-all` to check it out, it doesn't show up, because it only shows hosts from the server version that is queried and the duplicate is for the other server version.
I'm suggesting that this needs to be either documented in the ARM, or fixed which is not difficult and is doable, and backwards-compatible, by including `dhcp4_subnet_id` and `dhcp6_subnet_id` as part of the primary key in the `hosts` table.outstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/2705host-cmds without databases2023-01-26T16:58:14ZTomek Mrugalskihost-cmds without databases`host-cmds` is one of the most popular hooks. It has one major limitation: it is not able to edit running configuration and it needs a database.
Modification of a config-file based configuration is rather easy technically. The reluctanc...`host-cmds` is one of the most popular hooks. It has one major limitation: it is not able to edit running configuration and it needs a database.
Modification of a config-file based configuration is rather easy technically. The reluctance to implement this was based on the grounds that the modified config has to be written (`config-write`) or the changes would be lost after restart/reconfiguration.
This was discussed in Porto and we decided this kind of functionality would be useful for Stork. We can mitigate the concern raised above by properly documenting it and perhaps returning something in the API response that config-write is highly recommended (but not mandatory - there are valid use cases where tweaking HR data is desired to be temporary).
This is a follow-up for `Stork roadmap and backlog` discussion in Porto.outstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/2561Wrong format of a complex DHCP option with suboptions stored in the host data...2023-07-05T10:39:18ZMarcin SiodelskiWrong format of a complex DHCP option with suboptions stored in the host databaseI am sending the reservation-add command to Kea (from Stork) with the following arguments:
```json
{ "reservation": { "hw-address": "23212345", "option-data": [ { "code": 93, "csv-format": true, "data": "1,12/12", "space": "s46-rule-opt...I am sending the reservation-add command to Kea (from Stork) with the following arguments:
```json
{ "reservation": { "hw-address": "23212345", "option-data": [ { "code": 93, "csv-format": true, "data": "1,12/12", "space": "s46-rule-options" }, { "code": 89, "csv-format": true, "data": "1,2,3,192.0.2.1,3000::/64", "space": "s46-cont-mape-options" }, { "code": 94, "csv-format": true, "space": "dhcp6" } ], "subnet-id": 1 } }
```
Next, when I get this reservation from the database.
```
"option-data": [ { "always-send": false, "code": 94, "csv-format": false, "data": "00590018010203C0000201403000000000000000005D0004010C00C0", "name": "s46-cont-mape", "space": "dhcp6" }, { "always-send": false, "code": 89, "csv-format": true, "data": "1,2,3,192.0.2.1,3000::/64", "name": "s46-rule", "space": "s46-cont-mape-options" }, { "always-send": false, "code": 93, "csv-format": true, "data": "1,12/12", "name": "s46-portparams", "space": "s46-rule-options" } ]
```
Option 94 is an empty option, but in this scenario it has a payload of `00590018010203C0000201403000000000000000005D0004010C00C0`. I presume this is the hexadecimal representation of the suboptions.
From the first look, it comes from the following function:
```
void OptionDataListParser::parse(const CfgOptionPtr& cfg,
isc::data::ConstElementPtr option_data_list) {
auto option_parser = createOptionDataParser();
BOOST_FOREACH(ConstElementPtr data, option_data_list->listValue()) {
std::pair<OptionDescriptor, std::string> option =
option_parser->parse(data);
// Use the option description to keep the formatted value
cfg->add(option.first, option.second);
cfg->encapsulate();
}
}
```
It calls `cfg->encapsulate()` which appends suboptions to the option. Next, it serializes the option with its suboptions and stores it in the database.next-stable-2.6https://gitlab.isc.org/isc-projects/kea/-/issues/2217How to delete unused host reservations2023-04-05T13:27:33ZjujuHow to delete unused host reservationsI made some changes to my host reservations and now have a bunch of them that are not going to be used anymore. I can't figure out how to delete them. I see them in stork but don't have an idea how to permanently remove them. I have an ...I made some changes to my host reservations and now have a bunch of them that are not going to be used anymore. I can't figure out how to delete them. I see them in stork but don't have an idea how to permanently remove them. I have an HA setup with 2 kea servers and store the data in a postgresdb. I searched around but cant find any info on how to clean up the host reservations.outstandinghttps://gitlab.isc.org/isc-projects/kea/-/issues/1597reservations-* fields does not reflect changes made to reservation-mode2022-11-02T15:10:18ZMichal Nowikowskireservations-* fields does not reflect changes made to reservation-modeIf `reservation-mode` is changed using `remote-global-parameter{46}-set` then `config-get` shows unchanged values of `reserveraions-global`, `reservations-in-subnet` and `reservations-out-of-pool`.
Forge tests:
```
tests/dhcpv4/kea_only...If `reservation-mode` is changed using `remote-global-parameter{46}-set` then `config-get` shows unchanged values of `reserveraions-global`, `reservations-in-subnet` and `reservations-out-of-pool`.
Forge tests:
```
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v4-None]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v4-all]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v4-out-of-pool]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v4-global]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v4-disabled]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v6-None]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v6-all]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v6-out-of-pool]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v6-global]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_override_init[v6-disabled]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_in_globals[v4]
tests/dhcpv4/kea_only/config_backend/test_reservations.py::test_reservation_mode_in_globals[v6]
```backlog