yahoo-eng-team team mailing list archive
-
yahoo-eng-team team
-
Mailing list archive
-
Message #68265
[Bug 1668223] Re: subnet create is not working with --use-default-subnet-pool
Reviewed: https://review.openstack.org/503000
Committed: https://git.openstack.org/cgit/openstack/neutron-lib/commit/?id=c315d5802d0aa5fa597db7cee7aa82c24c2ae4c2
Submitter: Jenkins
Branch: master
commit c315d5802d0aa5fa597db7cee7aa82c24c2ae4c2
Author: Jens Harbott <j.harbott@xxxxxxxx>
Date: Tue Sep 12 13:27:01 2017 +0000
Add the default-subnetpools extension to api-ref
Add a section about it in the subnet documentation and show the
``use_default_subnetpool`` is an optional parameter for the subnet create
and bulk-create requests.
Change-Id: I145bc3c86d6e0a4a062879dee8075199473d9904
Closes-Bug: 1668223
** Changed in: neutron
Status: In Progress => Fix Released
--
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to neutron.
https://bugs.launchpad.net/bugs/1668223
Title:
subnet create is not working with --use-default-subnet-pool
Status in neutron:
Fix Released
Status in python-openstackclient:
Fix Released
Status in OpenStack SDK:
Fix Released
Bug description:
Seems like the option is not passed properly to the API:
$ openstack --debug subnet create --ip-version 6 --use-default-subnet-pool --ipv6-address-mode slaac --ipv6-ra-mode slaac --network mynet mysubnet
...
REQ: curl -g -i -X POST http://10.42.1.126:9696/v2.0/subnets -H "User-Agent: openstacksdk/0.9.13 keystoneauth1/2.18.0 python-requests/2.12.5 CPython/2.7.12" -H "Content-Type: application/json" -H "X-Auth-Token: {SHA1}c61b74f7c026e385b8953576101f854d86cb0d48" -d '{"subnet": {"network_id": "1f20da97-ddd4-40f8-b8d3-6321de8671a0", "ipv6_ra_mode": "slaac", "ip_version": 6, "name": "mysubnet", "ipv6_address_mode": "slaac"}}'
http://10.42.1.126:9696 "POST /v2.0/subnets HTTP/1.1" 400 146
RESP: [400] Content-Type: application/json Content-Length: 146 X-Openstack-Request-Id: req-299d7f52-d5ce-4873-979d-f63626f380ab Date: Mon, 27 Feb 2017 10:30:31 GMT Connection: keep-alive
RESP BODY: {"NeutronError": {"message": "Bad subnets request: a subnetpool must be specified in the absence of a cidr.", "type": "BadRequest", "detail": ""}}
...
HttpException: HttpException: Bad Request, Bad subnets request: a subnetpool must be specified in the absence of a cidr.
END return value: 1
$
Running the same command using the neutron CLI is working fine:
$ neutron --debug subnet-create --name subnet6 --ip_version 6 --use-default-subnetpool --ipv6-address-mode slaac --ipv6-ra-mode slaac mynet
...
DEBUG: keystoneauth.session REQ: curl -g -i -X POST http://10.42.1.126:9696/v2.0/subnets.json -H "User-Agent: python-neutronclient" -H "Content-Type: application/json" -H "Accept: application/json" -H "X-Auth-Token: {SHA1}dd78a0939a35913dad4181aaf5f68e0c9277d74e" -d '{"sub
net": {"use_default_subnetpool": true, "network_id": "1f20da97-ddd4-40f8-b8d3-6321de8671a0", "ipv6_ra_mode": "slaac", "ip_version": 6, "ipv6_address_mode": "slaac", "name": "subnet6"}}'
DEBUG: keystoneauth.session RESP: [201] Content-Type: application/json Content-Length: 735 X-Openstack-Request-Id: req-13f0bc2a-e4e5-43dc-b048-e63acef8f131 Date: Mon, 27 Feb 2017 10:46:32 GMT Connection: keep-alive
RESP BODY: {"subnet": {"service_types": [], "description": "", "enable_dhcp": true, "tags": [], "network_id": "1f20da97-ddd4-40f8-b8d3-6321de8671a0", "tenant_id": "6de6f29dcf904ab8a12e8ca558f532e9", "created_at": "2017-02-27T10:46:31Z", "dns_nameservers": [], "updated_at":
"2017-02-27T10:46:31Z", "gateway_ip": "2001:db8:1234::1", "ipv6_ra_mode": "slaac", "allocation_pools": [{"start": "2001:db8:1234::2", "end": "2001:db8:1234:0:ffff:ffff:ffff:ffff"}], "host_routes": [], "revision_number": 2, "ip_version": 6, "ipv6_address_mode": "slaac", "c
idr": "2001:db8:1234::/64", "project_id": "6de6f29dcf904ab8a12e8ca558f532e9", "id": "ebb07be0-3f8d-4219-afbd-f81ca352954d", "subnetpool_id": "4c1661ba-b24c-4fda-8815-3f1fd29281af", "name": "subnet6"}}
...
So somehow this attribute is missing from the OSC's request:
"use_default_subnetpool": true
To manage notifications about this bug go to:
https://bugs.launchpad.net/neutron/+bug/1668223/+subscriptions