openstack client not assagning floating ip to instance

Bug #1747721 reported by Holosian
22
This bug affects 5 people
Affects Status Importance Assigned to Milestone
OpenStack Shared File Systems Service (Manila)
Fix Released
Low
Goutham Pacha Ravi
python-openstackclient
Confirmed
Undecided
Unassigned

Bug Description

Command from official documentation

https://docs.openstack.org/install-guide/launch-instance-selfservice.html

https://docs.openstack.org/python-openstackclient/pike/cli/command-objects/server.html

not working:

root@ctrl00:~# openstack server add floating ip b25132a4-ccfe-4611-90f4-1a55e5c3b83a 192.168.11.21
add_floating_ip
root@ctrl00:~# openstack server list
+--------------------------------------+-------+--------+--------------------+--------+---------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+-------+--------+--------------------+--------+---------+
| b25132a4-ccfe-4611-90f4-1a55e5c3b83a | demo1 | ACTIVE | demo-net=10.0.0.13 | cirros | m1.tiny |
+--------------------------------------+-------+--------+--------------------+--------+---------+

but when i do that other way:

root@ctrl00:~# openstack port list
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| ID | Name | MAC Address | Fixed IP Addresses | Status |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
| 1e9638d9-0f4d-4407-88e1-2d1732880a8b | | fa:16:3e:eb:e8:a0 | ip_address='192.168.11.11', subnet_id='0f00f9a7-515f-417f-a513-364bd23db358' | N/A |
| 377e5328-b9d2-4be0-93bc-0582d7db2c3c | | fa:16:3e:3d:35:c1 | ip_address='192.168.11.21', subnet_id='0f00f9a7-515f-417f-a513-364bd23db358' | N/A |
| 4db697ee-01f9-413e-96cc-20f31d010631 | | fa:16:3e:5c:64:29 | ip_address='192.168.11.19', subnet_id='0f00f9a7-515f-417f-a513-364bd23db358' | ACTIVE |
| 526cc85c-5711-4b42-8110-02858305c7a9 | | fa:16:3e:b9:c2:d8 | ip_address='192.168.11.18', subnet_id='0f00f9a7-515f-417f-a513-364bd23db358' | ACTIVE |
| 67473834-58ac-493f-a65d-766ef96c8a98 | | fa:16:3e:b2:53:85 | ip_address='10.0.0.12', subnet_id='4027d517-da45-483d-b2a2-4276acfb0d5d' | ACTIVE |
| 844cfd77-82b2-4d80-a247-c2a7cb5dcac7 | | fa:16:3e:f8:72:1c | ip_address='10.0.0.2', subnet_id='4027d517-da45-483d-b2a2-4276acfb0d5d' | ACTIVE |
| 896d8e09-12e5-4d7b-a091-b258fad4bcfb | | fa:16:3e:30:cd:cf | ip_address='10.0.0.1', subnet_id='4027d517-da45-483d-b2a2-4276acfb0d5d' | ACTIVE |
| a00b6bae-05d5-4abd-9111-39e1473ac5df | | fa:16:3e:ae:45:d0 | ip_address='192.168.11.15', subnet_id='0f00f9a7-515f-417f-a513-364bd23db358' | ACTIVE |
| cb3d05ef-a93e-4b59-81bf-53b4409aee85 | | fa:16:3e:51:0a:62 | ip_address='10.0.0.13', subnet_id='4027d517-da45-483d-b2a2-4276acfb0d5d' | ACTIVE |
| e8544e87-e931-4062-839b-01b5e2bd8922 | | fa:16:3e:29:8b:ff | ip_address='192.168.11.20', subnet_id='0f00f9a7-515f-417f-a513-364bd23db358' | N/A |
+--------------------------------------+------+-------------------+------------------------------------------------------------------------------+--------+
root@ctrl00:~# openstack server add floating ip b25132a4-ccfe-4611-90f4-1a55e5c3b83a 192.168.11.21
add_floating_ip
root@ctrl00:~# openstack server list
+--------------------------------------+-------+--------+--------------------+--------+---------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+-------+--------+--------------------+--------+---------+
| b25132a4-ccfe-4611-90f4-1a55e5c3b83a | demo1 | ACTIVE | demo-net=10.0.0.13 | cirros | m1.tiny |
+--------------------------------------+-------+--------+--------------------+--------+---------+
root@ctrl00:~# openstack floating ip set --port cb3d05ef-a93e-4b59-81bf-53b4409aee85 --fixed-ip-address 10.0.0.13 192.168.11.21
root@ctrl00:~# openstack server list
+--------------------------------------+-------+--------+-----------------------------------+--------+---------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+-------+--------+-----------------------------------+--------+---------+
| b25132a4-ccfe-4611-90f4-1a55e5c3b83a | demo1 | ACTIVE | demo-net=10.0.0.13, 192.168.11.21 | cirros | m1.tiny |
+--------------------------------------+-------+--------+-----------------------------------+--------+---------+
root@ctrl00:~#

is working without problem. Here are --debug outputs:

with instance id: http://pastebin.pl/view/9cf23fff
with instance name: http://pastebin.pl/view/acf1f580

Revision history for this message
Holosian (holosian) wrote :
Revision history for this message
Sean Feole (sfeole) wrote :
Download full text (3.9 KiB)

Ran into this today as well:

looks like api changes broke this.
https://git.openstack.org/cgit/openstack-dev/grenade/commit/?id=fce6befbb50fdc774f16fa963dd51e2bb8eedd63

For now the following workaround that I'm using is:

$ openstack server list
+--------------------------------------+----------------------+--------+----------------------------------+-------------+----------+
| ID | Name | Status | Networks | Image | Flavor |
+--------------------------------------+----------------------+--------+----------------------------------+-------------+----------+
| 0e4853f1-3af9-4351-ad75-b096b5bd3e53 | xenial-uefi-182922-1 | ACTIVE | private=172.16.0.9 | xenial-uefi | m1.small |
| c1229557-b7ee-4131-bb84-754319c5d88a | xenial-uefi-182922-2 | ACTIVE | private=172.16.0.8 | xenial-uefi | m1.small |
+--------------------------------------+----------------------+--------+----------------------------------+-------------+----------+

$neutron port-list -F id -F fixed_ips

neutron CLI is deprecated and will be removed in the future. Use openstack CLI instead.
+--------------------------------------+-------------------------------------------------------------------------------------+
| id | fixed_ips |
+--------------------------------------+-------------------------------------------------------------------------------------+
| 0e7a7afe-5f1d-436e-a4c8-8dfdcd3c68c1 | {"subnet_id": "e1aa7691-149c-4dcd-b504-248b02f28b2a", "ip_address": "172.16.0.9"} |
| 3bea6557-5e0a-4b1a-86a4-65ba53fc52af | {"subnet_id": "fe6ae8d3-8a6d-4755-b304-b32d6875d04b", "ip_address": "10.245.172.7"} |
| 630f258f-4dfc-45ad-b05c-a5c062ad1f6e | {"subnet_id": "e1aa7691-149c-4dcd-b504-248b02f28b2a", "ip_address": "172.16.0.2"} |
| 8a54b735-5c27-460f-a84c-8e8edf77b2bb | {"subnet_id": "e1aa7691-149c-4dcd-b504-248b02f28b2a", "ip_address": "172.16.0.8"} |
| c9a1892f-f97b-44b9-a626-59a7b176848e | {"subnet_id": "fe6ae8d3-8a6d-4755-b304-b32d6875d04b", "ip_address": "10.245.172.4"} |
| cb3e76ce-f5ea-4ebf-956f-0d3f63ee1fe0 | {"subnet_id": "fe6ae8d3-8a6d-4755-b304-b32d6875d04b", "ip_address": "10.245.172.3"} |
| d8c5ccdf-b540-4649-8c51-ed84a4f25999 | {"subnet_id": "e1aa7691-149c-4dcd-b504-248b02f28b2a", "ip_address": "172.16.0.1"} |
| fe0af27c-5d86-481c-9aed-b9753a8d6a2d | {"subnet_id": "e1aa7691-149c-4dcd-b504-248b02f28b2a", "ip_address": "172.16.0.7"} |
+--------------------------------------+-------------------------------------------------------------------------------------+

Take note of the private ip address.

Find the neutron port id that corresponds to your private/fixedip.

$openstack floating ip set --port 0e7a7afe-5f1d-436e-a4c8-8dfdcd3c68c1 10.245.172.4
$openstack floating ip set --port 8a54b735-5c27-460f-a84c-8e8edf77b2bb 10.245.172.3

⟫ openstack server list
+--------------------------------------+----------------------+--------+----------------------------------+-------------+----------+
| ID | Name | Status | Networks ...

Read more...

Tom Barron (tpb)
Changed in python-openstackclient:
status: New → Confirmed
Revision history for this message
Tom Barron (tpb) wrote :

related-fix (workaround) for manila: https://review.openstack.org/#/c/556351

affects: python-openstackclient → manila
affects: manila → python-openstackclient
Tom Barron (tpb)
Changed in manila:
status: New → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to manila (master)

Fix proposed to branch: master
Review: https://review.opendev.org/724726

Changed in manila:
assignee: nobody → Goutham Pacha Ravi (gouthamr)
importance: Undecided → Low
milestone: none → victoria-1
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to manila (master)

Reviewed: https://review.opendev.org/724726
Committed: https://git.openstack.org/cgit/openstack/manila/commit/?id=5998d04e79c52c5048ab251247b4f00d5b761067
Submitter: Zuul
Branch: master

commit 5998d04e79c52c5048ab251247b4f00d5b761067
Author: Goutham Pacha Ravi <email address hidden>
Date: Thu Apr 30 11:19:40 2020 -0700

    [devstack][ci] Fix floatingip allocation

    A fix was committed [1] to the python-openstackclient
    project to handle VMs with multiple ports. We can
    drop the workaround of setting a floating IP to the
    VM's port.

    [1] https://opendev.org/openstack/python-openstackclient/commit/013c9a4f3a44cb0b81fc7affe9b933e701cb5dba

    Change-Id: I67c38b4e6695c05a8272a86448ed248b492a279d
    Closes-Bug: #1747721
    Signed-off-by: Goutham Pacha Ravi <email address hidden>

Changed in manila:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.