Normal disclaimer: RDO Icehouse
I ran into an issue where a VM previously had a floating IP, but it was released back to the pool. It was important to get that IP back for that VM.
Icehouse-era Neutron does not allow you to specify which specific floating ip you want, but kilo might. So how could this be fixed? I guess I need to flex my sql muscles again.
First of all, this is not trivial. Floating IPs touch at least three tables in the neutron database: ipallocations, floatingips and ports. I was a bit wary of inserting into all of these and hoping for the best. So I didn't.
I did this instead. I don't recommend that this should be done, and if it's done, make sure that the target IPs are actually free.
Instead of creating everything in the database, a new floating ip was allocated, and not attached anywhere. After that these two commands were run on the neutron database.
update floatingips set floating_ip_address="<ip you want>" where floating_ip_address="<newly allocated ip>";
update ipallocations set ip_address="<ip you want>" where ip_address="<newly allocated ip>";
Not pretty, but it seems to have done the trick.
Geek. Product Owner @CSCfi