← Back to team overview

openstack team mailing list archive

Re: Delete orphaned floating ip (Solved)

 

Hi All,

I couldn`t find this info on the web so I created a set-by-step guide to removing orphaned floating IP addresses. Enjoy :)

0. Check if you have a orphaned floating ip. If you see an IP with the Instance ID of "None", then that is the IP address you will use below.
# nova floating-ip-list

(output will look similar below)

+-----------------+-------------+----------+----------------+
| Ip              | Instance Id | Fixed Ip | Pool           |
+-----------------+-------------+----------+----------------+
| 192.168.100.133 | None        | None     | Public Network |
+-----------------+-------------+----------+----------------+

Now delete the orphaned floating IP.
1. Login to mysql.
# mysql -u username -p

2. List your databases if you want.
# show databases;

3. Switch to use the ovs_quantum database.
mysql> use ovs_quantum; 

4. Show the values in the table floatingips. Take note of the column name (floating_ip_address) for the orphaned IP
mysql> SELECT * FROM floatingips; (Show the table contents)
mysql> DELETE FROM floatingips WHERE floating_ip_address="192.168.100.133";  (insert your ip address withing the quotes)
mysql> SELECT * FROM floatingips; (confirm the row was deleted)

5. Show the values in the table ipallocations. Take note of the column name (ip_address) for the orphaned IP
mysql> SELECT * FROM ipallocations; (Show the table contents)
mysql> DELETE FROM ipallocations WHERE ip_address="192.168.100.133";  (insert your ip address withing the quotes)
mysql> SELECT * FROM ipallocations; (confirm the row was deleted)
 
6. Next login to the Openstack Dashboard and delete the port for the network containing the orphaned floating IP. 

In my case I deleted the whole subnet because the DHCP server does not release the IP pack in the pool unless you do this.
You can see this in the table ipavailabilityranges. once you delete the subnet the values clear out. 
This last part will only work if you have no more instances connected to this subnet.
Those who are good at sql commands could figure out how to modify the IP range in the ipavailabilityranges tables to release the IP back
to the dhcp server.


Hope that helps others with the same issue.

Best,
Jake






________________________________
 From: laserjetyang <laserjetyang@xxxxxxxxx>
To: Jake G. <dj_dark_junglist@xxxxxxxxx> 
Cc: "openstack@xxxxxxxxxxxxxxxxxxx" <openstack@xxxxxxxxxxxxxxxxxxx> 
Sent: Friday, July 19, 2013 2:42 PM
Subject: Re: [Openstack] Delete orphaned floating ip
 


I will do it by entering database




On Fri, Jul 19, 2013 at 1:21 PM, Jake G. <dj_dark_junglist@xxxxxxxxx> wrote:

Hi all,
>
>
>I have a orphaned floating IP I am unable to delete.
>
>
># nova floating-ip-list
>+-----------------+-------------+----------+----------------+
>| Ip              | Instance Id | Fixed Ip | Pool           |
>+-----------------+-------------+----------+----------------+
>| 192.168.100.133 | None        | None     | Public Network |
>
>
>Is there a way to delete this manually?
>
>
>Thanks,
>Jake
>
>
>_______________________________________________
>Mailing list: https://launchpad.net/~openstack
>Post to     : openstack@xxxxxxxxxxxxxxxxxxx
>Unsubscribe : https://launchpad.net/~openstack
>More help   : https://help.launchpad.net/ListHelp
>
>

References