Is there a limit on HostId generation for Discovered_hosts or can we reset the Host ID to start discover from 1

Hi Guys,

I am using foreman Version 2.3.1 along with FDI.
I have just clear the lease from the dhcpd.leases file and deleted all the discovered host from the foreman.

Now when i discovered new host it got the first IP of the DHCP range but not the Host ID hence just wanted to know is there any limit on the host ID generation or Can we reset the host ID as well if yes then how can we do that ?

Thanks

Hey, what do you mean by host ID? Like PostgreSQL database ID? Do do not want to reset them, why? There is enough IDs for your hosts, there is no reason to reset the sequence.

Hi Izap,

I am taking about the Host ID which new host get after the discovery from FDI.
Because we have huge environment and once we discover the host install the OS for customer and after the few month year we we need to rediscover the same host where it get another Host ID, However this cycle is keep going on hence ask do we have any limitation on the generation of Host ID…

and If hostID hit the limit then can we reset the sequence? hence this question raised.
since in our case after the OS installation we dont manage the host by foreman.

Thanks

I still do not understand what do you mean by “host id”. But you should not use host SQL database ID for anything, this is a value that is not guaranteed, it can actually change in the future to something different.

We have actually implemented new feature in the recent version which is a user-facing sequence macro which is designed exactly for your purpose. You will need Foreman 2.4 to have that feature:

Documentation for this is WIP:

https://github.com/theforeman/foreman-documentation/pull/477

Hi Izap,
Sorry for the confusion, I think in TUI you guys called it ID… which is in circle. I am talking about this ID.

Yeah, do not use that ID, use the sequence macro.

If you really need to reset the ID, you can. Search the web on how to reset PotgreSQL sequence column, you want to chante host table fileld named ID.