Comment 2 for bug 997763

Piotr Siwczak (psiwczak) wrote :

I already have a "dirty" fix for this in compute/

It probably deserves to be put into separate function in compute/ (the one that dissasociates all the floating ips from instance and takes just instance_id as a parameter.

in _delete function:

    def _delete(self, context, instance):
        host = instance['host']

        nw_info = self.network_api.get_instance_nw_info(context.elevated(),
        for i in nw_info:
            for j in i['network']['subnets']:
                for k in j['ips']:
                    for l in k['floating_ips']:
                        LOG.debug(_("Dissasociating floating ip %s from instance") % fip)
                        self.network_api.disassociate_floating_ip(context.elevated(), fip)