Skip to content
This repository has been archived by the owner on Jul 18, 2023. It is now read-only.

Change way of gettig floating IPs for the given instance #62

Open
ogajduse opened this issue Jun 25, 2019 · 1 comment
Open

Change way of gettig floating IPs for the given instance #62

ogajduse opened this issue Jun 25, 2019 · 1 comment

Comments

@ogajduse
Copy link
Member

Currently we list info for the given instance and we parse the info about the floating IPs from there. 5minute should not be relying on the nova proxy API and should use the neutron API directly.

Currently we do: https://github.com/SatelliteQE/5minute/blob/master/vminute/vminute.py#L708

What we should do (explained using OSP CLI tooling):

openstack port list --server <server uuid>

^ This will return the ID of the port.

openstack floating ip list --port <port id>

For example:

$ openstack port list --server c5d5ca2e-16bd-4e10-817a-25123ad82422
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+
| ID                                   | Name | MAC Address       | Fixed IP Addresses                                                          | Status |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+
| c7b58401-32d0-4435-ac08-0c25cae16d9a |      | fa:16:3e:07:33:f3 | ip_address='172.16.20.39', subnet_id='bdc26b91-22c5-45e6-b125-d37ed857dcab' | ACTIVE |
+--------------------------------------+------+-------------------+-----------------------------------------------------------------------------+--------+
$ openstack floating ip list --port c7b58401-32d0-4435-ac08-0c25cae16d9a
+--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+
| ID                                   | Floating IP Address | Fixed IP Address | Port                                 | Floating Network                     | Project                          |
+--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+
| 703cda9a-390d-4302-859a-3cbb9cbbf1c8 | 10.0.149.240        | 172.16.20.39     | c7b58401-32d0-4435-ac08-0c25cae16d9a | 25ec4907-36fc-4035-b8d5-b797246330f2 | f02e46e85bee44fda348ac49cc4b6b6d |
+--------------------------------------+---------------------+------------------+--------------------------------------+--------------------------------------+----------------------------------+

This way we can get the 10.0.149.240 floating IP and disassociate it

@ogajduse
Copy link
Member Author

From IRC discussion with OSP devs:

you can get the fixed ips via "openstack port list --server " then loop over them with openstack floating ip list --fixed-ip $ip

actually rather then --fixed-ip you can also do "openstack floating ip list --port " for each port returned by "openstack port list --server" that is more efficient

@ogajduse ogajduse changed the title Change way how to get floating IPs for the given instance Change way of gettig floating IPs for the given instance Jun 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant