Package: python3-openstacksdk Version: 0.17.2-2 Hi,
There is a bug in openstacksdk library which causes problem with subnet create from subnet-pool with some prefix-length How to reproduce ? root@openstack-controller:/home/debian# openstack subnet pool create --pool-prefix 192.0.2.0/25 --pool-prefix 192.0.2.128/25 --address-scope bgp --share selfservice +-------------------+--------------------------------------+ | Field | Value | +-------------------+--------------------------------------+ | address_scope_id | 59322c32-6d3c-47ae-99d1-92b988a412c8 | | created_at | 2019-03-12T08:21:36Z | | default_prefixlen | 8 | | default_quota | None | | description | | | id | 93672311-203d-4fb6-82ae-b469dd047bad | | ip_version | 4 | | is_default | False | | max_prefixlen | 32 | | min_prefixlen | 8 | | name | selfservice | | prefixes | 192.0.2.0/24 | | project_id | 0ed98ec832f848bbb8146b4fe6070110 | | revision_number | 0 | | shared | True | | tags | | | updated_at | 2019-03-12T08:21:36Z | +-------------------+--------------------------------------+ root@openstack-controller:/home/debian# openstack subnet create --network selfservice1 --subnet-pool selfservice --prefix-length 25 selfservice1 HttpException: 500: Server Error for url: http://openstack-ctrl:9696/v2.0/subnets, {"NeutronError": {"message": "Failed to allocate subnet: Insufficient prefix space to allocate subnet size /8.", "type": "SubnetAllocationError", "detail": ""}} In log you can find bad prefix /8 019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation [req-b6a4410e-564b-4f1a-a492-3b8d77d50bc1 c6fa01a00b7244e7b6e2a5ea5a1fb5a5 0ed98ec832f848bbb8146b4fe6070110 - default default] POST failed.: neutron.common.exceptions.SubnetAllocationError: Failed to allocate subnet: Insufficient prefix space to allocate subnet size /8. 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation Traceback (most recent call last): 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/pecan/core.py", line 683, in __call__ 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation self.invoke_controller(controller, args, kwargs, state) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/pecan/core.py", line 574, in invoke_controller 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation result = controller(*args, **kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 140, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation setattr(e, '_RETRY_EXCEEDED', True) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 220, in __exit__ 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation self.force_reraise() 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation six.reraise(self.type_, self.value, self.tb) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation raise value 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 136, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return f(*args, **kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_db/api.py", line 154, in wrapper 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation ectxt.value = e.inner_exc 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 220, in __exit__ 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation self.force_reraise() 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation six.reraise(self.type_, self.value, self.tb) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation raise value 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_db/api.py", line 142, in wrapper 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return f(*args, **kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 183, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation LOG.debug("Retry wrapper got retriable exception: %s", e) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 220, in __exit__ 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation self.force_reraise() 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation six.reraise(self.type_, self.value, self.tb) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation raise value 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 179, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return f(*dup_args, **dup_kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/pecan_wsgi/controllers/utils.py", line 76, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return f(*args, **kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/pecan_wsgi/controllers/resource.py", line 159, in post 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return self.create(resources) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/pecan_wsgi/controllers/resource.py", line 177, in create 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return {key: creator(*creator_args, **creator_kwargs)} 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/common/utils.py", line 622, in inner 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return f(self, context, *args, **kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/db/api.py", line 123, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return method(*args, **kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 140, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation setattr(e, '_RETRY_EXCEEDED', True) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 220, in __exit__ 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation self.force_reraise() 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation six.reraise(self.type_, self.value, self.tb) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation raise value 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 136, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return f(*args, **kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_db/api.py", line 154, in wrapper 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation ectxt.value = e.inner_exc 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 220, in __exit__ 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation self.force_reraise() 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation six.reraise(self.type_, self.value, self.tb) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation raise value 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_db/api.py", line 142, in wrapper 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return f(*args, **kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 183, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation LOG.debug("Retry wrapper got retriable exception: %s", e) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 220, in __exit__ 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation self.force_reraise() 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation six.reraise(self.type_, self.value, self.tb) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/six.py", line 693, in reraise 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation raise value 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron_lib/db/api.py", line 179, in wrapped 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return f(*dup_args, **dup_kwargs) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/plugins/ml2/plugin.py", line 1144, in create_subnet 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation result, mech_context = self._create_subnet_db(context, subnet) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/plugins/ml2/plugin.py", line 1118, in _create_subnet_db 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation context, subnet) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/db/db_base_plugin_v2.py", line 832, in _create_subnet_precommit 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation subnetpool_id) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/db/ipam_pluggable_backend.py", line 525, in allocate_subnet 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation ipam_subnet = ipam_driver.allocate_subnet(subnet_request) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/ipam/drivers/neutrondb_ipam/driver.py", line 280, in allocate_subnet 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation subnet = super(NeutronDbPool, self).allocate_subnet(subnet_request) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/ipam/subnet_alloc.py", line 178, in allocate_subnet 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation return self._allocate_any_subnet(request) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation File "/usr/lib/python3/dist-packages/neutron/ipam/subnet_alloc.py", line 145, in _allocate_any_subnet 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation str(request.prefixlen)) 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation neutron.common.exceptions.SubnetAllocationError: Failed to allocate subnet: Insufficient prefix space to allocate subnet size /8. 2019-03-12 08:38:04.265 20093 ERROR neutron.pecan_wsgi.hooks.translation 2019-03-12 08:38:04.272 20093 DEBUG neutron.pecan_wsgi.hooks.notifier [req-b6a4410e-564b-4f1a-a492-3b8d77d50bc1 c6fa01a00b7244e7b6e2a5ea5a1fb5a5 0ed98ec832f848bbb8146b4fe6070110 - default default] No notification will be sent due to unsuccessful status code: 500 after /usr/lib/python3/dist-packages/neutron/pecan_wsgi/hooks/notifier.py:79 This is fixed in upstream https://review.openstack.org/#/c/550558 Thanks, Michal Arbet