Bug 1313980

Summary: add interface doesn't select the first free IP from range
Product: Red Hat OpenStack Reporter: Martin Pavlásek <mpavlase>
Component: python-django-horizonAssignee: Matthias Runge <mrunge>
Status: CLOSED UPSTREAM QA Contact: Ido Ovadia <iovadia>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 8.0 (Liberty)CC: aortega, athomas, mrunge, yeylon
Target Milestone: ---   
Target Release: 8.0 (Liberty)   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2016-03-07 09:09:35 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:

Description Martin Pavlásek 2016-03-02 18:17:14 UTC
Description of problem:
When adding a router interface to network, the interface should get the first free IP address from the subnet (/24).

Version-Release number of selected component (if applicable):


How reproducible:
100%

Steps to Reproduce:
1. create router "test_router"
2. create network "test_net"
3. in test_net create subnet "test_subnet":
net address 10.0.0.0/24
IPv4
checkDisable gateway
click to Create
4. Network topology, click to router, Add interface, select "test_net: 10.0.0.0/24 (test_subnet)", leave IP address empty, submit the dialogue
5. red popoup is displayed: "Error: Failed to add_interface: Bad router request: Subnet for router interface must have a gateway IP" - it's valid behaviour so far
6. networks - click to "test_net" row, edit subnet "test_subnet":
uncheck Disable gateway,
set gateway IP 10.0.0.1,
check enable DHCP (is already checked by default),
allocation pool: 10.0.0.2,10.0.0.254
hit Save button
7. Network topology, click to router "test_router", Add interface, select "test_net: 10.0.0.0/24 (test_subnet)", leave IP address empty, submit the dialogue


Actual results:
Adding interface is trying to use first IP address from the subnet range, but it's already used as gateway, so red popup is displayed instead:
Error: Failed to add_interface: Unable to complete operation for network 490131be-13e9-49b8-b515-6d2dec8847da. The IP address 10.0.0.1 is in use.

Expected results:
The first unoccupied address is selected automatically.

Additional info:
If is new subnet created with gateway IP from beginning, router port is created successfully and it picks the same IP as is defined as subnet gateway

Comment 2 Martin Pavlásek 2016-03-03 08:58:47 UTC
I've forgotten to mention version of packages (RHEL 7.2):

python-django-horizon-8.0.1-1.el7ost.noarch
openstack-dashboard-8.0.1-1.el7ost.noarch
openstack-packstack-puppet-7.0.0-0.12.dev1699.g8f54936.el7ost.noarch
openstack-neutron-common-7.0.1-10.el7ost.noarch
openstack-neutron-ml2-7.0.1-10.el7ost.noarch
openstack-neutron-7.0.1-10.el7ost.noarch

Comment 3 Matthias Runge 2016-03-07 09:09:35 UTC
I don't see, how this is specifically related to the product. Moving this upstream