ok a bit more info, this problem only occurs if you restart the neutron-l3-agent in between adding and removing the floating ip. Looking at the code it looks like this is because the information needed to delete the fip is held in memory and comes from when the fip is added at which point it is added to floating_ips_dict which is never repopulated. So basically if you restart your l3-agent you lost all records of floating ips that need their ip rules deleted.
ok a bit more info, this problem only occurs if you restart the neutron-l3-agent in between adding and removing the floating ip. Looking at the code it looks like this is because the information needed to delete the fip is held in memory and comes from when the fip is added at which point it is added to floating_ips_dict which is never repopulated. So basically if you restart your l3-agent you lost all records of floating ips that need their ip rules deleted.
def _add_floating_ ip_rule( self, floating_ip, fixed_ip): ns.allocate_ rule_priority( floating_ ip)
self.floating_ ips_dict[ floating_ ip] = (fixed_ip, rule_pr)
rule_pr = self.fip_
def _remove_ floating_ ip_rule( self, floating_ip): ips_dict:
fixed_ ip, rule_pr = self.floating_ ips_dict[ floating_ ip]
ip_ lib.delete_ ip_rule( self.ns_ name, ip=fixed_ip,
table= dvr_fip_ ns.FIP_ RT_TBL,
priority= int(str( rule_pr) ))
self. fip_ns. deallocate_ rule_priority( floating_ ip)
if floating_ip in self.floating_
# TODO(rajeev): Handle else case - exception/log?