How to: Delete a DHCP Failover relationship when the partner server is unreachable
One of the latest issues I’ve come across is removing a DHCP Failover relationship. In a previous article I referenced a new Windows Server feature (Error while adding a second DHCP Server) which is DHCP Failover. This is a pretty cool feature as it allows you one of two things:
- DHCP Load Balancing: You can have your DHCP requests handled by 2 servers instead of 1
- DHCP hot spare: If your DHCP server goes down, a second DHCP server comes online and handles the requests
Obviously this is a pretty cool feature. The main issue with DHCP servers is that because they don’t share a common database, a lease assigned by one server can have a conflicting IP address (because the other DHCP server already assigned it), etc.
So when does this feature become an issue? When both servers lose communication. This is something that should rarely happen and probably it is just a temporary problem, but there are a few scenarios when reaching the partner DHCP server might be practically a permanent position. In that case if you wanted to break the relationship you won’t be able to unless the partner is reachable to delete the failover scope on that server. This could happen if you take the server to another physical location which is not connected via the network/dhcp or makes it unreachable. In my case, I changed the domain name of our Active Directory which caused a Server name change (just the dns suffix). So, even though I maintained a reference to it in DNS with the old suffix and you could reach it via ping, I was not able to remove this relationship. Obviously, the big issue more than removing the relationship is that because both servers are not communicating you may lose the ability to prevent IP lease conflicts.
Unfortunately the workaround is to perform step by step what the wizard would had done and force said actions:
- Pick the server you want to keep. Look at your DHCP leases and determine which might be the most complete.
- Stop the partner DHCP server so only one server is responding to DHCP requests
- Try to assign clients from the partner DHCP server back to the server you want to keep. Renew leases so to prevent potential conflicts.
- You are going to force the removal of the DHCP failover relationship. Because there is no communication the partner server won’t transmit the latest changes and the scope won’t be removed from it. Execute the following command in order to remove the relationship:
Remove-DhcpServerv4Failover -ComputerName dhcpserver.bauzas.com -Name SFO-SIN-Failover -Force
- You will get a warning that says: “Failed to delete the failover relationship <Name of the relationship, i.e. SFO-SIN-Failover> on the partner server <Name of partner server, i.e. dhcpserver2.bauzas.com>”. As I mentioned this is the expected behavior as you cannot communicate with the partner server.
- Manually delete the scope from the partner server to ensure no conflicts arise if it accidentally becomes active.
And that should do the trick. If you wanted you could form again the relationship in case the issue was a problem with the server names or you could form a new relationship with a new server. Either way just make sure you don’t have 2 DHCP servers assigned to the same IP scope that are not in a failover relationship.