Ask Your Question
1

API for releasing a floating IP from a network!

asked 2015-01-22 03:22:26 -0500

anhdenday gravatar image

updated 2015-01-22 03:23:42 -0500

Dear All,

I read API for Openstack here: link text I just only see the API for:

1. Allocate floating IP
2. Show floating IP information
3. Deallocate floating IP
4. Adds a floating IP address to an instance
5. Removes a floating IP from an instance.

So that I can do it well by CLI, but now I want to release a floating IP from a network like dashboard already do it. Below is picture that dashboard already do. image description

How can I do? Which API I can do? Please help me. Thanks you so much

edit retag flag offensive close merge delete

1 answer

Sort by ยป oldest newest most voted
0

answered 2015-01-22 04:08:30 -0500

dbaxps gravatar image

updated 2015-01-22 04:09:32 -0500

Usually I do it via neutron database ( may be placed in shell script , just CLI not API )

[root@junoDocker01 ~(keystone_admin)]# mysql -u root -p
Enter password: 
Welcome to the MariaDB monitor.  Commands end with ; or \g.
Your MariaDB connection id is 533
Server version: 5.5.40-MariaDB-wsrep MariaDB Server, wsrep_25.11.r4026

Copyright (c) 2000, 2014, Oracle, Monty Program Ab and others.

Type 'help;' or '\h' for help. Type '\c' to clear the current input statement.

MariaDB [(none)]> use neutron :
Reading table information for completion of table and column names
You can turn off this feature to get a quicker startup with -A

Database changed
MariaDB [neutron]> use neutron ;
Database changed
MariaDB [neutron]> select * from  ipavailabilityranges ;
+--------------------------------------+---------------+---------------+
| allocation_pool_id                   | first_ip      | last_ip       |
+--------------------------------------+---------------+---------------+
| 08591b76-db33-41e2-9fab-0ef067d37280 | 50.0.0.44     | 50.0.0.254    |
| b00d4375-77d2-4f12-800e-96f0b85713c5 | 192.168.1.165 | 192.168.1.254 |
+--------------------------------------+---------------+---------------+
2 rows in set (0.00 sec)

MariaDB [neutron]> update ipavailabilityranges set first_ip='192.168.1.151' 
    -> where allocation_pool_id='b00d4375-77d2-4f12-800e-96f0b85713c5' ;
Query OK, 1 row affected (0.00 sec)
Rows matched: 1  Changed: 1  Warnings: 0

MariaDB [neutron]> select * from  ipavailabilityranges ;
+--------------------------------------+---------------+---------------+
| allocation_pool_id                   | first_ip      | last_ip       |
+--------------------------------------+---------------+---------------+
| 08591b76-db33-41e2-9fab-0ef067d37280 | 50.0.0.44     | 50.0.0.254    |
| b00d4375-77d2-4f12-800e-96f0b85713c5 | 192.168.1.151 | 192.168.1.254 |
+--------------------------------------+---------------+---------------+
2 rows in set (0.00 sec)

MariaDB [neutron]> commit ;
Query OK, 0 rows affected (0.00 sec)

In your case first_ip='123.30.61.134'

edit flag offensive delete link more

Comments

So you mean each time we allocate an IP to a pool, openstack will careated a IP and assign to that pool. And save it in neutron DB, we can only deallocate or remove this floating IP from the current instance but we cannot release this floating IP via API. Just only way remove this from neutron DB?

anhdenday gravatar imageanhdenday ( 2015-01-22 04:33:19 -0500 )edit

I only mean , that I could write shell script cleaning up Neutron DB. I don't know how to do it via API calls.

dbaxps gravatar imagedbaxps ( 2015-01-22 04:49:40 -0500 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2015-01-22 03:22:26 -0500

Seen: 1,249 times

Last updated: Jan 22 '15