[NEUTRON-123] [stable/beryllium]After creating port with multiple fixedIPs resulting in only fixedIP per subnet getting written to MDSAL Created: 15/Apr/16  Updated: 19/Nov/19  Resolved: 08/Jul/16

Status: Resolved
Project: neutron
Component/s: northbound-api
Affects Version/s: unspecified
Fix Version/s: None

Type: Bug
Reporter: Suraj Ranjan Assignee: Unassigned
Resolution: Done Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified
Environment:

Operating System: All
Platform: All


External issue ID: 5735
Priority: High

 Description   

Upon creating a port and then updating with multiple fixed IPs per subnet, only one is getting reflected in neutron router config DS.

openstack command used for creating port with multiple fixed-ips:

neutron port-create ext-net --fixed-ip subnet_id=d8c6125a-8d1a-4802-8bfe-d287776c8b41,ip_address=12.12.12.8 --fixed-ip subnet_id=d8c6125a-8d1a-4802-8bfe-d287776c8b41,ip_address=12.12.12.9

What get reflected in MDSAL:

{
"ports": [
{
"id": "6d8c0b04-f0d5-44d5-bc4d-43e530839e75",
"tenant_id": "3b54ee92f05c4a45a7e8474badb2e3c8",
"network_id": "65ddef7d-0261-4d2d-8c3e-a028bde26695",
"name": "",
"admin_state_up": true,
"status": "ACTIVE",
"mac_address": "FA:16:3E:EA:6E:94",
"fixed_ips": [

{ "ip_address": "12.12.12.9", "subnet_id": "d8c6125a-8d1a-4802-8bfe-d287776c8b41" }

],
"device_id": "",
"device_owner": "",
"security_groups": [
{
"id": "40ea057d-1549-4727-86ea-4c3e5dcf107c",
"tenant_id": "3b54ee92f05c4a45a7e8474badb2e3c8",
"name": "default",
"description": "Default security group",
"security_group_rules": [

{ "id": "1a11c807-e185-40aa-afe3-3696e0f12d64", "tenant_id": "3b54ee92f05c4a45a7e8474badb2e3c8", "direction": "ingress", "ethertype": "IPv6", "remote_group_id": "40ea057d-1549-4727-86ea-4c3e5dcf107c", "security_group_id": "40ea057d-1549-4727-86ea-4c3e5dcf107c" }

,

{ "id": "40e96508-a362-43f1-97ea-8486ab461bc4", "tenant_id": "3b54ee92f05c4a45a7e8474badb2e3c8", "direction": "egress", "ethertype": "IPv4", "security_group_id": "40ea057d-1549-4727-86ea-4c3e5dcf107c" }

,

{ "id": "a16611c1-f4e6-4223-b48b-c1b11b8ec6c1", "tenant_id": "3b54ee92f05c4a45a7e8474badb2e3c8", "direction": "ingress", "ethertype": "IPv4", "remote_group_id": "40ea057d-1549-4727-86ea-4c3e5dcf107c", "security_group_id": "40ea057d-1549-4727-86ea-4c3e5dcf107c" }

,

{ "id": "673ca49f-0ba9-4e70-a63c-0b6f4bf4fb5e", "tenant_id": "3b54ee92f05c4a45a7e8474badb2e3c8", "direction": "egress", "ethertype": "IPv6", "security_group_id": "40ea057d-1549-4727-86ea-4c3e5dcf107c" }

]
}
],
"allowed_address_pairs": [],
"binding:host_id": "",
"binding:vnic_type": "normal",
"binding:vif_type": "unbound",
"binding:vif_details": [
{}
]
}
]
}



 Comments   
Comment by Vishal Thapar [ 18/Apr/16 ]

Issue is in neutron-ports.yang:

list fixed-ips {
key subnet-id;
leaf subnet-id

{ type yang:uuid; }

leaf ip-address

{ type inet:ip-address; }

}

Yang model allows only one ip-address per subnet. It should be leaf-list, at very list.

Comment by Isaku Yamahata [ 19/Apr/16 ]

Yes, neutron API allows for port to have multiple ip addresses from single subnets.

Does the following change work?
list fixed-ips {
key "subnet-id ip-address"; <<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<<
leaf subnet-id

{ type yang:uuid; }

leaf ip-address

{ type inet:ip-address; }

}

Comment by Vishal Thapar [ 19/Apr/16 ]

Yes, this would work but will make it difficult to make queries like 'get all fixed IPs for a subnet' as IP would also need to be part of a key given by user/application.

Comment by Vishal Thapar [ 11/May/16 ]

http://developer.openstack.org/api-ref-networking-v2.html#listPorts suggests that change proposed by Isaku is best way to go. I'll confirm it form q-svc.log

Refer meeting log for details:
http://meetings.opendaylight.org/opendaylight-neutron/2016/neutron_northbound/opendaylight-neutron-neutron_northbound.2016-05-11-15.01.log.html

Comment by Vishal Thapar [ 12/May/16 ]

This is what we get from OpenStack:
'fixed_ips': [

{ 'subnet_id': u'2044aba1-3ff4-401b-a398-1bf92f9692ce', 'ip_address': u'172.16.0.5' }

,

{ 'subnet_id': u'2044aba1-3ff4-401b-a398-1bf92f9692ce', 'ip_address': u'172.16.0.8' }

]

So, should be good to just change the key to 'subnet-id ip-address'. I believe such a change may not even be disruptive unless someone is explicitly trying to get individual entry using the key.

Comment by Abhinav Gupta [ 08/Jul/16 ]

Fixed by https://git.opendaylight.org/gerrit/#/c/35839/9
Hence, closing the bug.

Generated at Wed Feb 07 20:25:37 UTC 2024 using Jira 8.20.10#820010-sha1:ace47f9899e9ee25d7157d59aa17ab06aee30d3d.