stack@stack-eclipse-82:/opt/stack/quantum$ quantum port-list
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| 08185995-0e95-4f88-83ba-8aabba7e83d5 | | fa:16:3e:5b:60:40 | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.2"} |
| 54dd7e9d-0b68-425a-9b99-b34ded620ecf | | fa:16:3e:b0:b0:b5 | {"subnet_id": "c4f17078-5fc3-4741-8690-e3deb30ac1b3", "ip_address": "172.24.4.226"} |
| a7f4f421-d8b9-427e-8248-f512790a9f7b | | fa:16:3e:b0:c7:0e | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.1"} |
| a8d0fcbf-92f6-4b9b-8720-d3e5e432bd7e | | fa:16:3e:8b:a7:e6 | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.3"} |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
stack@stack-eclipse-82:/opt/stack/quantum$ quantum port-update a8d0fcbf-92f6-4b9b-8720-d3e5e432bd7e --fixed-ips type=dict {ip_address=10.0.0.20,subnet_id=276dadc6-50ff-4d5b-aa31-953ddca64245}
Updated port: a8d0fcbf-92f6-4b9b-8720-d3e5e432bd7e
stack@stack-eclipse-82:/opt/stack/quantum$ quantum port-list
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| 08185995-0e95-4f88-83ba-8aabba7e83d5 | | fa:16:3e:5b:60:40 | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.2"} |
| 54dd7e9d-0b68-425a-9b99-b34ded620ecf | | fa:16:3e:b0:b0:b5 | {"subnet_id": "c4f17078-5fc3-4741-8690-e3deb30ac1b3", "ip_address": "172.24.4.226"} |
| a7f4f421-d8b9-427e-8248-f512790a9f7b | | fa:16:3e:b0:c7:0e | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.1"} |
| a8d0fcbf-92f6-4b9b-8720-d3e5e432bd7e | | fa:16:3e:8b:a7:e6 | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.20"} |
| | | | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.21"} |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
stack@stack-eclipse-82:/opt/stack/quantum$ stack@stack-eclipse-82:/opt/stack/quantum$ quantum port-update a8d0fcbf-92f6-4b9b-8720-d3e5e432bd7e --fixed-ips type=dict {ip_address=10.0.0.10,ip_address=10.0.0.12}
Updated port: a8d0fcbf-92f6-4b9b-8720-d3e5e432bd7e
stack@stack-eclipse-82:/opt/stack/quantum$ quantum port-list
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| id | name | mac_address | fixed_ips |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
| 08185995-0e95-4f88-83ba-8aabba7e83d5 | | fa:16:3e:5b:60:40 | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.2"} |
| 54dd7e9d-0b68-425a-9b99-b34ded620ecf | | fa:16:3e:b0:b0:b5 | {"subnet_id": "c4f17078-5fc3-4741-8690-e3deb30ac1b3", "ip_address": "172.24.4.226"} |
| a7f4f421-d8b9-427e-8248-f512790a9f7b | | fa:16:3e:b0:c7:0e | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.1"} |
| a8d0fcbf-92f6-4b9b-8720-d3e5e432bd7e | | fa:16:3e:8b:a7:e6 | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.10"} |
| | | | {"subnet_id": "276dadc6-50ff-4d5b-aa31-953ddca64245", "ip_address": "10.0.0.12"} |
+--------------------------------------+------+-------------------+-------------------------------------------------------------------------------------+
stack@stack-eclipse-82:/opt/stack/quantum$ quantum port-update a8d0fcbf-92f6-4b9b-8720-d3e5e432bd7e --fixed-ips type=dict {ip_address=10.0.0.20}
Invalid input for fixed_ips. Reason: Invalid data format for fixed IP: '{u'{ip_address': u'10.0.0.20}'}'.
stack@stack-eclipse-82:/opt/stack/quantum$
There seem to be 2 issues here:
1. The parameters passed in for --fixed_ips are always split and each parameter results in a seperate update to the port. So, if ip_address and its subnet are passed in the --fixed_ips dict, port is updated once with the ip_address and once again with the subnet. Hence the port ends up with 2 ip_addresses instead on 1. The ip_adress and subnet have to be part of the same update request. So, there should be a way to differentiate the 2 cases : 1. when ip_address and subnet should be part of the same update. 2. when ip_adress and subnet should form seperate updates.
2. 2 IP addresses can be passed in as a parameters to --fixed_ips, but passing in a single IP returns an error. There is an inconsistency in the deserialization of one parameter vs multiple parameters. When 1 parameter is passed in, it gets deserialized to a dict but with 2 or greater parameters, it gets desrialized to a list of dicts. Arguement checking in Quantum server accepts only a paremeter of type list of dicts.
Trying to find a solution that solves both seemingly unrelated issues. Will update with the proposal. In the meantime, hoping that this bugs moves out of being "undecided".