Can you give it a try while specifying subnet IDs and see if the problem disappears? When you say "restart" do you stop the process and start it back up again or is a kill -HUP being issued (or equivalent via systemd or other)? it might be holding some things in memory (such as a counter from the last subnet add command) if it is the latter.
On Mon, Mar 13, 2023 at 10:07 AM s k <sa...@hotmail.com> wrote: > > Thanks for the quick reply . > > Sequence of steps: > 1. subnet6_ add with out subnet id > 2.config_write > > It ends up in sequential order .but when i restart the kea-dhcp6 service it > throws error below until all the subnetid's exhausted in the config file . > Where does the last used subnetid stored ? and when does it gets reset ? > > > 2023-03-10 16:30:17.679 ERROR > [kea-dhcp6.subnet-cmds-hooks/1603115.139787764285440] > SUBNET_CMDS_SUBNET6_ADD_FAILED failed to add new IPv6 subnet: ID of the new > IPv6 subnet '3' is already in use > > > > > { > "calculate-tee-times": false, > "id": 1, > "max-preferred-lifetime": 4294967295, > "max-valid-lifetime": 4294967295, > "min-preferred-lifetime": 0, > "min-valid-lifetime": 0, > "option-data": [ ], > "pd-pools": [ ], > "pools": [ > { > "option-data": [ ], > "pool": "fda4:220:0:1::8051:1-fda4:220:0:1::8051:ffff" > } > ], > "preferred-lifetime": 4294967295, > "rapid-commit": true, > "rebind-timer": 4294967295, > "relay": { > "ip-addresses": [ ] > }, > "renew-timer": 4294967295, > "reservations": [ ], > "store-extended-info": false, > "subnet": "fda4:220:0:1::8051:0/64", > "t1-percent": 0.5, > "t2-percent": 0.8, > "valid-lifetime": 4294967295 > }, > { > "calculate-tee-times": false, > "id": 2, > "max-preferred-lifetime": 4294967295, > "max-valid-lifetime": 4294967295, > "min-preferred-lifetime": 4294967295, > "min-valid-lifetime": 4294967295, > "option-data": [ ], > "pd-pools": [ ], > "pools": [ > { > "option-data": [ ], > "pool": "fda0::34:0:0:8053:0/112" > } > ], > "preferred-lifetime": 4294967295, > "rapid-commit": true, > "rebind-timer": 4294967295, > "relay": { > "ip-addresses": [ ] > }, > "renew-timer": 4294967295, > "reservations": [ ], > "store-extended-info": false, > "subnet": "fda0::34:0:0:8053:0/64", > "t1-percent": 0.5, > "t2-percent": 0.8, > "valid-lifetime": 4294967295 > }, > > > ________________________________ > From: Kea-users <kea-users-boun...@lists.isc.org> on behalf of Darren Ankney > <darren.ank...@gmail.com> > Sent: Monday, March 13, 2023 5:49 AM > To: kea-users <kea-users@lists.isc.org> > Subject: Re: [Kea-users] Subnet_cmds Subnet ID gets reset on service restart > > Hello, > > How are you having the subnets persist across restarts? Are you > executing a config-write? What order are the subnets ending up in on > the drive after that? Do they have IDs listed? If not, I'm sure it > will generate them in the order they are found in the configuration > file. > > Also, you are running an older development version. I would suggest > you start using the latest current stable version of 2.2.0. > > On Mon, Mar 13, 2023 at 1:22 AM s k <sa...@hotmail.com> wrote: > > > > Hi > > > > I am using subnet6-add command from subnet6 hook library for adding > > subnets . And i am not assigning subnet id and let the system maintain > > auto generated value based on the notes below . it works well until we > > restart the service , on restart subnet-id gets reset and starts from 1 > > again which fails due to duplicate ID . i am using version 2.1.6. can you > > shed some light ? > > > > > > > > { > > "command": "subnet6-add", > > "arguments": { > > "subnet6": [ { > > "subnet": "2001:db8:1::/64", > > ... > > } ] > > } > > } > > > > Notes > > > > It is recommended, but not mandatory, to specify the subnet ID. If not > > specified, Kea will try to assign the next subnet-id value. > > > > This automatic ID value generator is simple; it returns a previously > > automatically assigned value, increased by 1. This works well, unless a > > subnet is manually created with a value bigger than one previously used. > > For example, if subnet4-add is called five times, each without an ID, Kea > > will assign IDs 1, 2, 3, 4, and 5 and it will work just fine. However, if > > subnet4-add is called five times, with the first subnet having the > > subnet-id of value 3 and the remaining ones having no subnet-id, the > > operation will fail. The first command (with the explicit value) will use > > subnet-id 3; the second command will create a subnet with id of 1; the > > third will use a value of 2; and finally the fourth will have the subnet-id > > value auto-generated as 3. However, since there is already a subnet with > > that ID, the process will fail. > > > > The general recommendation is either never use explicit values, so the > > auto-generated values will always work; or always use explicit values, so > > the auto-generation is never used. The two approaches can be mixed only if > > the administrator understands how internal automatic subnet-id generation > > works in Kea. > > > > > > -- > > 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 -- 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