Add new fixed IP to existing Neutron port, if one is attached

Bug #1568809 reported by Peter Slovak
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Dashboard (Horizon)
Confirmed
Medium
Vishal Manchanda

Bug Description

Currently, the "Attach Interface" button in dashboard always creates and attaches a new interface, no matter whether the instance already has an interface attached from a given subnet.

However, from the networking/routing standpoint, it doesn't make sense to have a VM connected to the same subnet via two different "physical" interfaces (eth0 and eth1 for example) - this makes the second and all the subsequent IPs from that subnet unreachable unless you set up source-based routing (inside the VM).

So, instead of creating a new Neutron port for each fixed IP, it might be better to update an existing port in that subnet, if one has already been attached to the instance. This is compatible with the Unix view of more IPs in one subnet - they work on the same base MAC address and cooperate with DHCP nicely. Moreover, such aliases don't confuse the routing table and these IPs work "out of the box".

Changed in horizon:
status: New → Confirmed
importance: Undecided → Wishlist
milestone: none → next
Revision history for this message
Cynthia Lopes do Sacramento (clsacramento) wrote :

Hi, I'm interested on this functionality to be available. Meanwhile, any one has the alternative on how to achieve the same result with the CLI?
Cheers

Revision history for this message
Peter Slovak (slovak-peto) wrote :

Essentially you always need to update an existing Neutron port in one of two ways:
1) Modify the "fixed_ips" list of dictionaries
2) Modify the "allowed_address_pairs" list of dictionaries

The first one is more management-clean because Neutron will then take the new IP(s) into account when you try to assign them to another port, for example. On the other hand, the current DHCP implementation will get confused by multiple IP records for the same MAC and will only offer the least recently added IP address.

The second way basically just says "let these IPs in and out of this port" and doesn't in any way modify DHCP offers nor checks whether the added IPs have already been assigned elsewhere. Have a look at the answer here: https://ask.openstack.org/en/question/84676/how-to-add-multiple-ip-inside-allowed-address-pairs/

Revision history for this message
Akihiro Motoki (amotoki) wrote :

The requested feature is available in neutron APi from long ago. You can use all things through CLI for neutron (neutron CLI or openstack CLI).

The reporter seems to request a network related feature to horizon. Horizon is a GUI project, so as horizon we only handle GUI side. As Horizon, we can add a menu like "Add IP" or "Remove IP" to the port table (but it is a minor feature and can be low-hanging-fruit)

tags: added: neutron
Akihiro Motoki (amotoki)
tags: added: low-hanging-fruit
Revision history for this message
Akihiro Motoki (amotoki) wrote :

Considering my comment #1 in bug 1718405, I am raising the priority to Medium.

Changed in horizon:
importance: Wishlist → Medium
Changed in horizon:
assignee: nobody → Vishal Manchanda (vishalmanchanda)
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.