← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 2055419] [NEW] network autoallocation fails for non-admin user

 

Public bug reported:

Description
===========
Automatic allocation of network topologies (https://docs.openstack.org/neutron/latest/admin/config-auto-allocation.html) causes unexpected API error when requested by user without admin role.

Tempest test affected:

tempest.api.compute.admin.test_auto_allocate_network.AutoAllocateNetworkTest.test_server_multi_create_auto_allocate

is failing.

Steps to reproduce
==================

* request server creation with network autoallocation as user without
admin role:

$ openstack --os-compute-api-version 2.37 server create --flavor
<flavor> --image <image> --nic auto vm1

Expected result
===============
Forbidden response (if i understand documentation correctly) or creation of network and router (if it is allowed).

Actual result
=============
Unexpected API Error.

 ERROR nova.api.openstack.wsgi [None req-<someid> <someid> <someid> - - default default] Unexpected exception in API method: neutronclient.common.exceptions.NotFound: The resource could not be found.
Neutron server returns request_ids: ['req-<someid>']
 ERROR nova.api.openstack.wsgi Traceback (most recent call last):
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/openstack/wsgi.py", line 658, in wrapped
 ERROR nova.api.openstack.wsgi     return f(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
 ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
 ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
 ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   [Previous line repeated 11 more times]
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/openstack/compute/servers.py", line 786, in create
 ERROR nova.api.openstack.wsgi     instances, resv_id = self.compute_api.create(
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 2207, in create
 ERROR nova.api.openstack.wsgi     return self._create_instance(
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 1683, in _create_instance
 ERROR nova.api.openstack.wsgi     ) = self._validate_and_build_base_options(
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 1081, in _validate_and_build_base_options
 ERROR nova.api.openstack.wsgi     max_network_count = self._check_requested_networks(
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 543, in _check_requested_networks
 ERROR nova.api.openstack.wsgi     return self.network_api.validate_networks(context, requested_networks,
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2648, in validate_networks
 ERROR nova.api.openstack.wsgi     ports_needed_per_instance = self._ports_needed_per_instance(
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2509, in _ports_needed_per_instance
 ERROR nova.api.openstack.wsgi     if not self._can_auto_allocate_network(context, neutron):
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2438, in _can_auto_allocate_network
 ERROR nova.api.openstack.wsgi     neutron.validate_auto_allocated_topology_requirements(
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
 ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/debtcollector/renames.py", line 41, in decorator
 ERROR nova.api.openstack.wsgi     return wrapped(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 2160, in validate_auto_allocated_topology_requirements
 ERROR nova.api.openstack.wsgi     return self.get_auto_allocated_topology(project_id, fields=['dry-run'])
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
 ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/debtcollector/renames.py", line 41, in decorator
 ERROR nova.api.openstack.wsgi     return wrapped(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 2144, in get_auto_allocated_topology
 ERROR nova.api.openstack.wsgi     return self.get(
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
 ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 356, in get
 ERROR nova.api.openstack.wsgi     return self.retry_request("GET", action, body=body,
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
 ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 333, in retry_request
 ERROR nova.api.openstack.wsgi     return self.do_request(method, action, body=body,
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
 ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 297, in do_request
 ERROR nova.api.openstack.wsgi     self._handle_fault_response(status_code, replybody, resp)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
 ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 272, in _handle_fault_response
 ERROR nova.api.openstack.wsgi     exception_handler_v20(status_code, error_body)
 ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 90, in exception_handler_v20
 ERROR nova.api.openstack.wsgi     raise client_exc(message=error_message,
 ERROR nova.api.openstack.wsgi neutronclient.common.exceptions.NotFound: The resource could not be found.
 ERROR nova.api.openstack.wsgi Neutron server returns request_ids: ['req-<someid>']
 ERROR nova.api.openstack.wsgi
 INFO nova.api.openstack.wsgi [None req-<someid> <someid> <someid> - - default default] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
<class 'neutronclient.common.exceptions.NotFound'>

Environment
===========
* OpenStack 2023.2 Bobcat
* Libvirt + KVM
* Neutron with OpenVSwitch
* deployed with kolla-ansible 17.1.0
* neutron-base v. 23.1.0
* nova-base v. 28.0.1

** Affects: nova
     Importance: Undecided
         Status: New


** Tags: neutron

** Description changed:

  Description
  ===========
  Automatic allocation of network topologies (https://docs.openstack.org/neutron/latest/admin/config-auto-allocation.html) causes unexpected API error when requested by user without admin role.
  
- Tempest test affected: 
- tempest.api.compute.admin.test_auto_allocate_network.AutoAllocateNetworkTest.test_server_multi_create_auto_allocate is failing
+ Tempest test affected:
+ 
+ tempest.api.compute.admin.test_auto_allocate_network.AutoAllocateNetworkTest.test_server_multi_create_auto_allocate
+ 
+ is failing.
+ 
  Steps to reproduce
  ==================
  
  * request server creation with network autoallocation as user without
  admin role:
  
  $ openstack --os-compute-api-version 2.37 server create --flavor
  <flavor> --image <image> --nic auto vm1
  
  Expected result
  ===============
  Forbidden response (if i understand documentation correctly) or creation of network and router (if it is allowed).
  
  Actual result
  =============
  Unexpected API Error.
  
-  ERROR nova.api.openstack.wsgi [None req-<someid> <someid> <someid> - - default default] Unexpected exception in API method: neutronclient.common.exceptions.NotFound: The resource could not be found.
+  ERROR nova.api.openstack.wsgi [None req-<someid> <someid> <someid> - - default default] Unexpected exception in API method: neutronclient.common.exceptions.NotFound: The resource could not be found.
  Neutron server returns request_ids: ['req-<someid>']
-  ERROR nova.api.openstack.wsgi Traceback (most recent call last):
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/openstack/wsgi.py", line 658, in wrapped
-  ERROR nova.api.openstack.wsgi     return f(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
-  ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
-  ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
-  ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   [Previous line repeated 11 more times]
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/openstack/compute/servers.py", line 786, in create
-  ERROR nova.api.openstack.wsgi     instances, resv_id = self.compute_api.create(
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 2207, in create
-  ERROR nova.api.openstack.wsgi     return self._create_instance(
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 1683, in _create_instance
-  ERROR nova.api.openstack.wsgi     ) = self._validate_and_build_base_options(
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 1081, in _validate_and_build_base_options
-  ERROR nova.api.openstack.wsgi     max_network_count = self._check_requested_networks(
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 543, in _check_requested_networks
-  ERROR nova.api.openstack.wsgi     return self.network_api.validate_networks(context, requested_networks,
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2648, in validate_networks
-  ERROR nova.api.openstack.wsgi     ports_needed_per_instance = self._ports_needed_per_instance(
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2509, in _ports_needed_per_instance
-  ERROR nova.api.openstack.wsgi     if not self._can_auto_allocate_network(context, neutron):
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2438, in _can_auto_allocate_network
-  ERROR nova.api.openstack.wsgi     neutron.validate_auto_allocated_topology_requirements(
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
-  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/debtcollector/renames.py", line 41, in decorator
-  ERROR nova.api.openstack.wsgi     return wrapped(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 2160, in validate_auto_allocated_topology_requirements
-  ERROR nova.api.openstack.wsgi     return self.get_auto_allocated_topology(project_id, fields=['dry-run'])
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
-  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/debtcollector/renames.py", line 41, in decorator
-  ERROR nova.api.openstack.wsgi     return wrapped(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 2144, in get_auto_allocated_topology
-  ERROR nova.api.openstack.wsgi     return self.get(
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
-  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 356, in get
-  ERROR nova.api.openstack.wsgi     return self.retry_request("GET", action, body=body,
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
-  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 333, in retry_request
-  ERROR nova.api.openstack.wsgi     return self.do_request(method, action, body=body,
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
-  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 297, in do_request
-  ERROR nova.api.openstack.wsgi     self._handle_fault_response(status_code, replybody, resp)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
-  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 272, in _handle_fault_response
-  ERROR nova.api.openstack.wsgi     exception_handler_v20(status_code, error_body)
-  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 90, in exception_handler_v20
-  ERROR nova.api.openstack.wsgi     raise client_exc(message=error_message,
-  ERROR nova.api.openstack.wsgi neutronclient.common.exceptions.NotFound: The resource could not be found.
-  ERROR nova.api.openstack.wsgi Neutron server returns request_ids: ['req-<someid>']
-  ERROR nova.api.openstack.wsgi
-  INFO nova.api.openstack.wsgi [None req-<someid> <someid> <someid> - - default default] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
+  ERROR nova.api.openstack.wsgi Traceback (most recent call last):
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/openstack/wsgi.py", line 658, in wrapped
+  ERROR nova.api.openstack.wsgi     return f(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
+  ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
+  ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
+  ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   [Previous line repeated 11 more times]
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/openstack/compute/servers.py", line 786, in create
+  ERROR nova.api.openstack.wsgi     instances, resv_id = self.compute_api.create(
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 2207, in create
+  ERROR nova.api.openstack.wsgi     return self._create_instance(
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 1683, in _create_instance
+  ERROR nova.api.openstack.wsgi     ) = self._validate_and_build_base_options(
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 1081, in _validate_and_build_base_options
+  ERROR nova.api.openstack.wsgi     max_network_count = self._check_requested_networks(
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 543, in _check_requested_networks
+  ERROR nova.api.openstack.wsgi     return self.network_api.validate_networks(context, requested_networks,
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2648, in validate_networks
+  ERROR nova.api.openstack.wsgi     ports_needed_per_instance = self._ports_needed_per_instance(
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2509, in _ports_needed_per_instance
+  ERROR nova.api.openstack.wsgi     if not self._can_auto_allocate_network(context, neutron):
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2438, in _can_auto_allocate_network
+  ERROR nova.api.openstack.wsgi     neutron.validate_auto_allocated_topology_requirements(
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
+  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/debtcollector/renames.py", line 41, in decorator
+  ERROR nova.api.openstack.wsgi     return wrapped(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 2160, in validate_auto_allocated_topology_requirements
+  ERROR nova.api.openstack.wsgi     return self.get_auto_allocated_topology(project_id, fields=['dry-run'])
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
+  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/debtcollector/renames.py", line 41, in decorator
+  ERROR nova.api.openstack.wsgi     return wrapped(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 2144, in get_auto_allocated_topology
+  ERROR nova.api.openstack.wsgi     return self.get(
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
+  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 356, in get
+  ERROR nova.api.openstack.wsgi     return self.retry_request("GET", action, body=body,
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
+  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 333, in retry_request
+  ERROR nova.api.openstack.wsgi     return self.do_request(method, action, body=body,
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
+  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 297, in do_request
+  ERROR nova.api.openstack.wsgi     self._handle_fault_response(status_code, replybody, resp)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
+  ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 272, in _handle_fault_response
+  ERROR nova.api.openstack.wsgi     exception_handler_v20(status_code, error_body)
+  ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 90, in exception_handler_v20
+  ERROR nova.api.openstack.wsgi     raise client_exc(message=error_message,
+  ERROR nova.api.openstack.wsgi neutronclient.common.exceptions.NotFound: The resource could not be found.
+  ERROR nova.api.openstack.wsgi Neutron server returns request_ids: ['req-<someid>']
+  ERROR nova.api.openstack.wsgi
+  INFO nova.api.openstack.wsgi [None req-<someid> <someid> <someid> - - default default] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
  <class 'neutronclient.common.exceptions.NotFound'>
- 
  
  Environment
  ===========
  * OpenStack 2023.2 Bobcat
  * Libvirt + KVM
  * Neutron with OpenVSwitch
  * deployed with kolla-ansible 17.1.0
  * neutron-base v. 23.1.0
  * nova-base v. 28.0.1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to OpenStack Compute (nova).
https://bugs.launchpad.net/bugs/2055419

Title:
  network autoallocation fails for non-admin user

Status in OpenStack Compute (nova):
  New

Bug description:
  Description
  ===========
  Automatic allocation of network topologies (https://docs.openstack.org/neutron/latest/admin/config-auto-allocation.html) causes unexpected API error when requested by user without admin role.

  Tempest test affected:

  tempest.api.compute.admin.test_auto_allocate_network.AutoAllocateNetworkTest.test_server_multi_create_auto_allocate

  is failing.

  Steps to reproduce
  ==================

  * request server creation with network autoallocation as user without
  admin role:

  $ openstack --os-compute-api-version 2.37 server create --flavor
  <flavor> --image <image> --nic auto vm1

  Expected result
  ===============
  Forbidden response (if i understand documentation correctly) or creation of network and router (if it is allowed).

  Actual result
  =============
  Unexpected API Error.

   ERROR nova.api.openstack.wsgi [None req-<someid> <someid> <someid> - - default default] Unexpected exception in API method: neutronclient.common.exceptions.NotFound: The resource could not be found.
  Neutron server returns request_ids: ['req-<someid>']
   ERROR nova.api.openstack.wsgi Traceback (most recent call last):
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/openstack/wsgi.py", line 658, in wrapped
   ERROR nova.api.openstack.wsgi     return f(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
   ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
   ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/validation/__init__.py", line 110, in wrapper
   ERROR nova.api.openstack.wsgi     return func(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   [Previous line repeated 11 more times]
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/api/openstack/compute/servers.py", line 786, in create
   ERROR nova.api.openstack.wsgi     instances, resv_id = self.compute_api.create(
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 2207, in create
   ERROR nova.api.openstack.wsgi     return self._create_instance(
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 1683, in _create_instance
   ERROR nova.api.openstack.wsgi     ) = self._validate_and_build_base_options(
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 1081, in _validate_and_build_base_options
   ERROR nova.api.openstack.wsgi     max_network_count = self._check_requested_networks(
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/compute/api.py", line 543, in _check_requested_networks
   ERROR nova.api.openstack.wsgi     return self.network_api.validate_networks(context, requested_networks,
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2648, in validate_networks
   ERROR nova.api.openstack.wsgi     ports_needed_per_instance = self._ports_needed_per_instance(
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2509, in _ports_needed_per_instance
   ERROR nova.api.openstack.wsgi     if not self._can_auto_allocate_network(context, neutron):
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 2438, in _can_auto_allocate_network
   ERROR nova.api.openstack.wsgi     neutron.validate_auto_allocated_topology_requirements(
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
   ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/debtcollector/renames.py", line 41, in decorator
   ERROR nova.api.openstack.wsgi     return wrapped(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 2160, in validate_auto_allocated_topology_requirements
   ERROR nova.api.openstack.wsgi     return self.get_auto_allocated_topology(project_id, fields=['dry-run'])
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
   ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/debtcollector/renames.py", line 41, in decorator
   ERROR nova.api.openstack.wsgi     return wrapped(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 2144, in get_auto_allocated_topology
   ERROR nova.api.openstack.wsgi     return self.get(
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
   ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 356, in get
   ERROR nova.api.openstack.wsgi     return self.retry_request("GET", action, body=body,
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
   ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 333, in retry_request
   ERROR nova.api.openstack.wsgi     return self.do_request(method, action, body=body,
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
   ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 297, in do_request
   ERROR nova.api.openstack.wsgi     self._handle_fault_response(status_code, replybody, resp)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/nova/network/neutron.py", line 196, in wrapper
   ERROR nova.api.openstack.wsgi     ret = obj(*args, **kwargs)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 272, in _handle_fault_response
   ERROR nova.api.openstack.wsgi     exception_handler_v20(status_code, error_body)
   ERROR nova.api.openstack.wsgi   File "/var/lib/kolla/venv/lib/python3.10/site-packages/neutronclient/v2_0/client.py", line 90, in exception_handler_v20
   ERROR nova.api.openstack.wsgi     raise client_exc(message=error_message,
   ERROR nova.api.openstack.wsgi neutronclient.common.exceptions.NotFound: The resource could not be found.
   ERROR nova.api.openstack.wsgi Neutron server returns request_ids: ['req-<someid>']
   ERROR nova.api.openstack.wsgi
   INFO nova.api.openstack.wsgi [None req-<someid> <someid> <someid> - - default default] HTTP exception thrown: Unexpected API Error. Please report this at http://bugs.launchpad.net/nova/ and attach the Nova API log if possible.
  <class 'neutronclient.common.exceptions.NotFound'>

  Environment
  ===========
  * OpenStack 2023.2 Bobcat
  * Libvirt + KVM
  * Neutron with OpenVSwitch
  * deployed with kolla-ansible 17.1.0
  * neutron-base v. 23.1.0
  * nova-base v. 28.0.1

To manage notifications about this bug go to:
https://bugs.launchpad.net/nova/+bug/2055419/+subscriptions



Follow ups