Quantum subnet-create --gateway option is ignored when used after --ip_version

Bug #1066234 reported by Quenten Grasso
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-neutronclient
Fix Released
Medium
Mark McClain

Bug Description

#quantum subnet-create --tenant_id 72e90ea837714723a2121712deadf4e6 --ip_version 4 4373779d-0e2e-45cf-b801-a8d8de25ab1d 10.0.1.0/24 --gateway 10.0.1.254 --prov_router_id=808d51cc-51b1-48d3-9d50-e275448c4818

Created a new subnet:
+------------------+--------------------------------------------+
| Field | Value |
+------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.1.2", "end": "10.0.1.254"} |
| cidr | 10.0.1.0/24 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 10.0.1.1 |
| host_routes | |
| id | 262a8c49-c178-41bf-8f38-a3fbc87f6597 |
| ip_version | 4 |
| name | |
| network_id | 4373779d-0e2e-45cf-b801-a8d8de25ab1d |
| tenant_id | 72e90ea837714723a2121712deadf4e6 |
+------------------+--------------------------------------------+

Work Around.....

# quantum subnet-create --tenant_id 72e90ea837714723a2121712deadf4e6 --gateway 10.0.1.254 --ip_version 4 4373779d-0e2e-45cf-b801-a8d8de25ab1d 10.0.1.0/24 --prov_router_id=808d51cc-51b1-48d3-9d50-e275448c4818

Created a new subnet:
+------------------+--------------------------------------------+
| Field | Value |
+------------------+--------------------------------------------+
| allocation_pools | {"start": "10.0.1.1", "end": "10.0.1.253"} |
| cidr | 10.0.1.0/24 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 10.0.1.254 |
| host_routes | |
| id | 5619e8af-63a6-494e-84f1-eeb5b260922c |
| ip_version | 4 |
| name | |
| network_id | 4373779d-0e2e-45cf-b801-a8d8de25ab1d |
| tenant_id | 72e90ea837714723a2121712deadf4e6 |
+------------------+--------------------------------------------+

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

This is not strictly a bug, as the CLI is operating as intended, but I agree it is confusing as hell for people new to the CLI and we should find a way to make it less confusing.

The real issue is that you were specifying --gateway AFTER the positional argument, whereas this option must be used BEFORE the positional argument. Arguments after the positional argument are passed through in the JSON request as is, but the problem is that the JSON value is actually gateway_ip, not gateway, so specifying --gateway after the positional arguments is essentially a noop.

See the description here: http://docs.openstack.org/cli/quick-start/content/quantum-cli-reference.html

Sorry for the confusion... we need an easier way to do this, as the current approach seems to confuse everyone.

Revision history for this message
Quenten Grasso (qgrasso-d) wrote :

Thanks, I suppose it maybe less confusing if we had two additional command options.

--network_id
--ip_subnet

quantum subnet-create --tenant_id 72e90ea837714723a2121712deadf4e6 --ip_version 4 --network_id 4373779d-0e2e-45cf-b801-a8d8de25ab1d --ip_subnet 10.0.1.0/24 --gateway 10.0.1.254 --prov_router_id=808d51cc-51b1-48d3-9d50-e275448c4818

As a suggestion,

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

yes, the fact that items that are positional args can ONLY be specified positionally, and cannot be specified via a flag is another good point.

we'll be talking about CLI improvements at the openstack summit next week and I think these are both topics to bring up.

Changed in quantum:
assignee: nobody → Mark McClain (markmcclain)
importance: Undecided → Medium
dan wendlandt (danwent)
affects: quantum → python-quantumclient
Revision history for this message
Akihiro Motoki (amotoki) wrote :

The lastest quantumclient 2.2 (or 2.1.2) support known options after positional parameters, so the bug reported has been addressed. The lastest quantumclient can be used combined with Folsom Quantum.

I confirmed it works.

$ quantum subnet-create net2 10.2.2.0/24 --ip-version 4 --gateway 10.2.2.200
Created a new subnet:
+------------------+----------------------------------------------+
| Field | Value |
+------------------+----------------------------------------------+
| allocation_pools | {"start": "10.2.2.1", "end": "10.2.2.199"} |
| | {"start": "10.2.2.201", "end": "10.2.2.254"} |
| cidr | 10.2.2.0/24 |
| dns_nameservers | |
| enable_dhcp | True |
| gateway_ip | 10.2.2.200 |
| host_routes | |
| id | c68dda9b-75cb-4f5f-a8de-b63d9027bf7e |
| ip_version | 4 |
| name | |
| network_id | 6e71cffa-d120-4f00-bbb7-cbd26bd1ccff |
| tenant_id | 5d3f1dd8a3cd4ed9a06dda8d759ef2e0 |
+------------------+----------------------------------------------+

Changed in python-quantumclient:
status: New → Fix Committed
milestone: none → 2.2
Revision history for this message
Akihiro Motoki (amotoki) wrote :
Akihiro Motoki (amotoki)
Changed in python-quantumclient:
status: Fix Committed → Fix Released
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.