OMAPI Reservations and peer/failover
gregs at sloop.net
Fri May 28 19:38:18 UTC 2021
Thanks you both for responding.
I'm setting a *reservation* flag on a lease in the leases file.
The list posting I reference is to a new lease def to the leases file.
Setting up a test, while a fair bit of work, might be interesting, if nothing more definitive comes along.
I guess I could simply take one of the peers down, delete/rename the lease file, and bring it back up and see how it's populated. (That would be easy, if somewhat more risky. LOL)
Would there be any complications on copying the leases file from the still-standing DHCP pair that you can think of?
(I _think_ they should be identical, provided there's not been lost communication between the peers and they are out of sync for that reason, and there's lost information in the down/dead pair. But that information is going to be lost in any case (provided the dead peer truly can't be raised from the dead), so any ripples from that loss won't be avoidable in any case.)
These servers, at least in the case here are in VM's which are pretty easily and quickly restored from backups and such, so I'm considering third and fourth order disasters - but sometimes things happen. I'd like to be ready when/if they do. :)
Again, thanks for your thoughts!
On Fri, May 28, 2021 at 3:00 PM Simon Hobson <dhcp1 at thehobsons.co.uk> wrote:
Gregory Sloop <gregs at sloop.net> wrote:
> Given what I've been able to dig up on the subject of omapi and peers, I'm pretty sure you have to run against both, explicitly.
> But, additional complication arise!
> As noted, a fair bit of reading and searching seems to indicate you have to run the omshell commands against each server.
> However, this is particularly interesting (or perhaps troubling.)
> See: https://lists.isc.org/mailman/htdig/dhcp-users/2006-July/001102.html
> To save you the click, I'll quote...
> "You will have to rerun the statement on both peers.
> Take careful note of servers that lose their dhcpd.leases files, you'll have to be able to 0-to-60 them by replaying everything. "
> There was no expansion on this - and my understanding of it is somewhat ambiguous.
> Does this mean that if I have a peer that gets rebuild and the leases file is deleted, it won't get a copy of the "original" leases file from it's peer and that all the "reservation" flags will be lost and I will have to re-run all the omapi commands against the peer which lost the leases file?
> Assuming that's the correct interpretation...
> I suppose that it's best then, to copy the leases file from the "still-up' peer to the rebuilt peer. (I can't see a reason not to do this, but perhaps I'm missing something.)
That is indeed an odd statement.
I can completely understand it for a standalone peer - if it loses it's leases file then all your OMAPI made changes will be gone.
But since the a major point of failover is for a server to be able to rebuild itself after a disaster, I would have expected failover to take care of that. I suggest you do a trial with a test server - my expectation is that if you bring up the peer with no leases file, then it'll get everything from it's partner.
However, the warning still holds. Should your shared leases get corrupted or lost, then you'd lose all your changes and need to re-play them. I'm not sure under what circumstances both servers could lose/corrupt their leases, but I'm sure there will be some.
I know that on a single server, if you remove some addresses from the defined ranges, then any leases defined for them will be removed on server startup. So, especially if you build a config and run it out to both servers at once, it's possible to lose a bunch of leases that way.
If I understand what Gregory is asking, he is configuring 'host' entries using OMAPI. The failover protocol will copy the 'lease' information, but the 'host' entries would need to be set using OMAPI on each server, and set again if the server loses them. Does that make sense?
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the dhcp-users