Network/broadcast addresses can be associated by AssociateAddress

Bug #751229 reported by Masanori Itoh
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Compute (nova)
Fix Released
Medium
Ivan Kolodyazhny
Diablo
Fix Released
Undecided
Unassigned

Bug Description

Hi,

As I mentioned in the discussion of:
  https://bugs.launchpad.net/nova/+bug/746922/comments/1
currently AllocateAddress can return network or broadcast addresses, and
furthermore they can be associated to instances.

Please see the bottom 'euca-associate-address' and 'euca-describe-instances'
calls. In the case below, 10.6.0.0 was associated to an instance.

I think it's better avoiding allocation of network and broadcast addresses
as early as we can, maybe in AllocateAddress call.

The problem is, that Floating IP netmask information is not stored anywhere currently.
An easy workaround could be just excluding Floating IPs with the maximum and minimum 'id's from the query used
in floating_ip_allocate_address() in SRC/nova/db/sqlalchemy/apy.py.
But, this is stupid.

Another idea is that excluding network and broadcast addresses
from inserting into 'floating_ips' table in 'nova-manage floating create'.

What do you think about?

root@shayol:/home/itoumsn# euca-run-instances ami-250c5dc3 -k itoumsn_01 -t m1.t
iny
RESERVATION r-19tfo8qv admin default
INSTANCE i-00000001 ami-250c5dc3 scheduling i
toumsn_01 (admin, None) 0 m1.tiny 2011-04-01T17:04:51Z unknown
zone
root@shayol:/home/itoumsn# euca-describe-instances
RESERVATION r-19tfo8qv admin default
INSTANCE i-00000001 ami-250c5dc3 10.0.0.3 10.0.0.3 r
unning itoumsn_01 (admin, shayol) 0 m1.tiny 2011-04-01T17:04
:51Z nova

root@shayol:/home/itoumsn# tail -f nova/instances/instance-00000001/console.log
udhcpc (v1.17.2) started
Sending discover...
Sending select for 10.0.0.3...
Lease of 10.0.0.3 obtained, lease time 120
starting DHCP forEthernet interface eth0 [ OK ]
cloud-setup: checking http://169.254.169.254/2009-04-04/meta-data/instance-id
cloud-setup: successful after 1/30 tries: up 38.21. iid=i-00000001
cloud-setup: cloudinit: getting ssh keys: [0=itoumsn_01]
stty: /dev/console
generating DSS host key [WATING].. [ OK ]
generating RSA host key [WATING].. [ OK ]
startup dropbear [ OK ]
stty: /dev/console
startup inetd [ OK ]
stty: /dev/console
startup crond [ OK ]
^C
root@shayol:/home/itoumsn# ssh root@10.0.0.3 -i itoumsn_01.pem

Chop wood, carry water.

# df
Filesystem 512-blocks Used Available Use% Mounted on
/dev/vda 47594 34552 10586 77% /
tmpfs 48 0 48 0% /dev/shm
# exit
logout
Connection to 10.0.0.3 closed.

root@shayol:/home/itoumsn# euca-describe-addresses
ADDRESS 10.6.0.0 None (admin)
ADDRESS 10.6.0.1 None (admin)
ADDRESS 10.6.0.3 None (admin)

*** AllocateAddress returns sequentially by first hit strategy,
    and thus we got '10.6.0.0' ***

root@shayol:/home/itoumsn# euca-associate-address 10.6.0.3 -i i-00000001
ADDRESS 10.6.0.3 i-00000001

root@shayol:/home/itoumsn# euca-describe-addresses
ADDRESS 10.6.0.0 None (admin)
ADDRESS 10.6.0.1 None (admin)
ADDRESS 10.6.0.3 i-00000001 (admin)

root@shayol:/home/itoumsn# euca-associate-address 10.6.0.0 -i i-00000001
ADDRESS 10.6.0.0 i-00000001

root@shayol:/home/itoumsn# euca-describe-instances
RESERVATION r-19tfo8qv admin default
INSTANCE i-00000001 ami-250c5dc3 10.6.0.0 10.0.0.3 r
unning itoumsn_01 (admin, shayol) 0 m1.tiny 2011-04-01T17:04
:51Z nova

*** 10.6.0.0 is the network address in this Floating IP space! ***

Related branches

Thierry Carrez (ttx)
Changed in nova:
importance: Undecided → Medium
status: New → Confirmed
Thierry Carrez (ttx)
Changed in nova:
assignee: nobody → Ivan kolodyazhny (e0ne)
status: Confirmed → In Progress
Ivan Kolodyazhny (e0ne)
Changed in nova:
status: In Progress → Fix Committed
status: Fix Committed → In Progress
Revision history for this message
Thierry Carrez (ttx) wrote :

@Ivan: could you refresh your merge proposal and set it to "Needs review" ? Or did you stop working on that ?

Revision history for this message
Ivan Kolodyazhny (e0ne) wrote :

@Thierry: I'll create new patch asap.

Revision history for this message
Ivan Kolodyazhny (e0ne) wrote :
Ivan Kolodyazhny (e0ne)
Changed in nova:
status: In Progress → Fix Committed
Ivan Kolodyazhny (e0ne)
Changed in nova:
status: Fix Committed → In Progress
Revision history for this message
Ivan Kolodyazhny (e0ne) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (master)

Reviewed: https://review.openstack.org/2663
Committed: http://github.com/openstack/nova/commit/135fd9191677f35c43aaff4f01af7e88cd57acb1
Submitter: Jenkins
Branch: master

commit 135fd9191677f35c43aaff4f01af7e88cd57acb1
Author: Ivan Kolodyazhny <email address hidden>
Date: Wed Dec 28 23:30:35 2011 +0200

    Bug 751229: Floating address range fixed

    Change-Id: I4c7ab8512fe3a00dd555d3a183b2c2348cef9e21

Changed in nova:
status: In Progress → Fix Committed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to nova (stable/diablo)

Fix proposed to branch: stable/diablo
Review: https://review.openstack.org/2805

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to nova (stable/diablo)

Reviewed: https://review.openstack.org/2805
Committed: http://github.com/openstack/nova/commit/1085e9d0fdc81eea734482e42a5fcb6ae1f4e8f7
Submitter: Jenkins
Branch: stable/diablo

commit 1085e9d0fdc81eea734482e42a5fcb6ae1f4e8f7
Author: Ivan Kolodyazhny <email address hidden>
Date: Wed Dec 28 23:30:35 2011 +0200

    Bug 751229: Floating address range fixed

    Change-Id: I4c7ab8512fe3a00dd555d3a183b2c2348cef9e21

tags: added: in-stable-diablo
Thierry Carrez (ttx)
Changed in nova:
milestone: none → essex-3
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in nova:
milestone: essex-3 → 2012.1
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.