create ports having the same address

Bug #1241230 reported by Arata Notsu
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Ironic
Fix Released
High
Haomeng,Wang

Bug Description

First, create a port AA:BB:CC:DD:EE:FF.
    $ ironic port-create --node_id a823094e-bed9-4723-9c15-fed0bbae208f --address AA:BB:CC:DD:EE:FF
    +----------+--------------------------------------+
    | Property | Value |
    +----------+--------------------------------------+
    | extra | {} |
    | uuid | 708087bc-8271-4295-a582-7d916c58923e |
    | node_id | a823094e-bed9-4723-9c15-fed0bbae208f |
    | address | AA:BB:CC:DD:EE:FF |
    +----------+--------------------------------------+

Next, try to create a port with the same address. It fails since the address already exists (OK).
    $ ironic port-create --node_id a823094e-bed9-4723-9c15-fed0bbae208f --address AA:BB:CC:DD:EE:FF

    MAC address already exists.

However, if use "-" instead of ":", we can do it (BAD).
    $ ironic port-create --node_id a823094e-bed9-4723-9c15-fed0bbae208f --address AA-BB-CC-DD-EE-FF
    +----------+--------------------------------------+
    | Property | Value |
    +----------+--------------------------------------+
    | extra | {} |
    | uuid | 7e1a3ee3-d8cd-47a1-8269-658bf4a2d2e4 |
    | node_id | a823094e-bed9-4723-9c15-fed0bbae208f |
    | address | AA-BB-CC-DD-EE-FF |
    +----------+--------------------------------------+

    $ ironic port-list
    +--------------------------------------+-------------------+
    | UUID | Address |
    +--------------------------------------+-------------------+
    | 7e1a3ee3-d8cd-47a1-8269-658bf4a2d2e4 | AA-BB-CC-DD-EE-FF |
    | 708087bc-8271-4295-a582-7d916c58923e | AA:BB:CC:DD:EE:FF |
    +--------------------------------------+-------------------+

Haomeng,Wang (whaom)
Changed in ironic:
assignee: nobody → Haomeng,Wang (whaom)
Revision history for this message
Haomeng,Wang (whaom) wrote :

We should follow "The standard (IEEE 802) format for printing MAC-48 addresses" - http://en.wikipedia.org/wiki/MAC_address, the MAC address hexadecimal digits are separated by hyphens (-) or colons (:), so have to make sure we store one Single format(such as colons) in the database, convert to colons if the input MAC is separated by hyphens, compare the existing MAC with same delimiter, then the comparison logic is working.

I will submit the code change to review.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to ironic (master)

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

Changed in ironic:
status: New → In Progress
Revision history for this message
Haomeng,Wang (whaom) wrote :

Commit the change - https://review.openstack.org/52761, please help to review.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to ironic (master)

Reviewed: https://review.openstack.org/52761
Committed: http://github.com/openstack/ironic/commit/124694c40974d6354a37034fb2bdc0faabc0ec10
Submitter: Jenkins
Branch: master

commit 124694c40974d6354a37034fb2bdc0faabc0ec10
Author: Haomeng, Wang <email address hidden>
Date: Sat Oct 19 19:36:16 2013 +0800

    Support uniform MAC address with colons

    The MAC address hexadecimal digits are separated by hyphens (-) or colons (:),
    however to avoid confusing, we dont support hyphens.

    Change-Id: I6099d654181ef0cb9b91ea3426c09e5128c65bdf
    Closes-Bug: #1241230

Changed in ironic:
status: In Progress → Fix Committed
aeva black (tenbrae)
Changed in ironic:
importance: Undecided → High
Thierry Carrez (ttx)
Changed in ironic:
milestone: none → icehouse-1
status: Fix Committed → Fix Released
Thierry Carrez (ttx)
Changed in ironic:
milestone: icehouse-1 → 2014.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.