Feature #18457
openBetter handling of 404 response when DHCP subnet is deleted
Description
I ran into a case where we wanted to change the IP on a NIC of an already provisioned host. Went into the NIC, changed the subnet to the new range, it grabbed a new DHCP IP from that subnet, then we went to manually change the IP to set it (essentially making it "static", so to say) in DHCP. When we did this we got the following errors:
https://gist.github.com/tek0011/6d773bbe77c0d6e7d778250b9a248b40
What happened was, we already removed the subnet from DHCP, BEFORE we attempted this change in Foreman. Due to this, when it goes to overwrite and delete the current reservation it will fail:
https://gist.github.com/tek0011/6d773bbe77c0d6e7d778250b9a248b40#file-after-clicking-overwrite-L554
The solution was to re-add the subnet into DHCP, then start the process again. At this point it was successful (even though it didnt need to delete the DHCP entry, since the subnet was deleted).
Perhaps consider checking the subnets first, and if it doesnt exist, notify the user. Or some other (better) method that I am sure you guru's will think up!
Updated by Dominic Cleal over 7 years ago
- Subject changed from Better handling of DHCP deletion by Foreman Proxy to Better handling of 404 response when DHCP subnet is deleted