implement mac & IP allocate in v2 db plugin base

Bug #1008029 reported by dan wendlandt
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
neutron
Fix Released
Critical
Gary Kotton

Bug Description

existing db plugin base has hard-coded MAC and no IP allocation.

will first do a simple allocation mechanism with no support for policies.

Revision history for this message
dan wendlandt (danwent) wrote :

happy to have someone take this away from me if they want :)

Changed in quantum:
importance: Undecided → High
milestone: none → folsom-2
assignee: nobody → dan wendlandt (danwent)
Gary Kotton (garyk)
Changed in quantum:
assignee: dan wendlandt (danwent) → Gary Kotton (garyk)
dan wendlandt (danwent)
Changed in quantum:
status: New → Confirmed
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/8597

Changed in quantum:
status: Confirmed → In Progress
dan wendlandt (danwent)
Changed in quantum:
importance: High → Critical
Revision history for this message
Gary Kotton (garyk) wrote :

MAC allocation: this is a rudimentary algorithm. a random mac address will be created above a base MAC address. the address will be checked for uniqueness on the network. if this fails then another address will be generated. this will be done n times. n and the basemac should be defined in the configuration file (pending common config update)
IP allocation: for the first stage a similar algorithm as above will be used. a random ip in the defined subnet will be selected. this will be checked for uniqueness. if this fails then another address will be generated. this will be done n times. the range of ip's will exclude the gateway address.
Once the above are in we can work on improving the IP allocation. Dan had a great idea for the IP allocations. A database table will maintain a range of free ip addresses. when an ip is to be allocated the first or last address from the range is allocated. the database entry is updated with the new range. when an entry is freed it will either be added to an existing range or a new entry will be created. deletion may require linking ranges together.

Revision history for this message
Sumit Naiksatam (snaiksat) wrote :

Hi Gary, thanks for doing this. Just a thought, in the case of IP addresses, it might help to make it slightly more deterministic, would facilitate in debugging. I believe Dan's suggestion here is along those lines. Even something like allocating the next available address (next being the numerically higher address, with wrap around) might be good to start with.

Changed in quantum:
assignee: Gary Kotton (garyk) → dan wendlandt (danwent)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/8597
Committed: http://github.com/openstack/quantum/commit/b6cb4316da8559398653e24de550b321f12e3e86
Submitter: Jenkins
Branch: master

commit b6cb4316da8559398653e24de550b321f12e3e86
Author: Gary Kotton <email address hidden>
Date: Tue Jun 19 16:32:22 2012 -0700

    Ensure unique mac address allocation.
    This is the first part of bug 1008029

    If the port command does not contain a MAC address then Quantum will generate
    a random MAC address. The mac address will be saved in the database to ensure
    that it is not used by another port on the same network.

    Added mock-based test for mac exhaustion.

    Change-Id: I4d3fe12fd1e3c347b8e286d920a0609d0b3c4e8c

Changed in quantum:
status: In Progress → Fix Committed
dan wendlandt (danwent)
Changed in quantum:
assignee: dan wendlandt (danwent) → Gary Kotton (garyk)
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to quantum (master)

Fix proposed to branch: master
Review: https://review.openstack.org/8794

Changed in quantum:
status: Fix Committed → In Progress
Gary Kotton (garyk)
Changed in quantum:
status: In Progress → Fix Committed
Changed in quantum:
status: Fix Committed → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to quantum (master)

Reviewed: https://review.openstack.org/8794
Committed: http://github.com/openstack/quantum/commit/681d096ef26247f6f8db8faca1abe9ae6a186562
Submitter: Jenkins
Branch: master

commit 681d096ef26247f6f8db8faca1abe9ae6a186562
Author: Gary Kotton <email address hidden>
Date: Thu Jun 21 04:53:48 2012 -0400

    Implement IP address allocation.

    This fixes bug 1008029.

    The allocation is done as follows (according to the value of
    port['fixed_ips']):
    - api_router.ATTR_NOT_SPECIFIED - Quantum will generate an IP address.
    If a v4 subnet is defined then a v4 address will be generated. If
    a v6 subnet is defined then a v6 address will be generated. If both are
    defined then both v4 and v6 addresses will be generated.
    - user configuration which may contain a list of the following:
       - ip_address - the specific IP address will be generated
       - subnet_id - an IP address from the subnet will be generated

    Change-Id: I3bb1b83b8824364b37dbecfa140331c4a1fd2762

Changed in quantum:
status: In Progress → Fix Committed
Thierry Carrez (ttx)
Changed in quantum:
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in quantum:
milestone: folsom-2 → 2012.2
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.