When there are two projects (for example, Project A and Project B),
if both try to onboard a VNF Package that contains the same vnfdId,
the onboarding of the second project fails.
Currently, the vnfdId duplication check is performed globally across all projects,
instead of being scoped per tenant/project.
As a result, multi-tenancy is not properly supported in VNF Package onboarding.
$ openstack vnf p show a1cf34b0-ab73-4d36-8b32-0aac4f0c0c08 -c 'VNFD ID'
+---------+--------------------------------------+
| Field | Value |
+---------+--------------------------------------+
| VNFD ID | c922dbf4-ee96-4e4b-af0e-85d233504d48 |
+---------+--------------------------------------+
```
Project B:
The status remains `CREATED` instead of changing to `ONBOARDED`.
```
Traceback (most recent call last):
File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/server.py", line 165, in _process_incoming
res = self.dispatcher.dispatch(message)
File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 309, in dispatch
return self._do_dispatch(endpoint, method, ctxt, args)
File "/usr/local/lib/python3.8/dist-packages/oslo_messaging/rpc/dispatcher.py", line 229, in _do_dispatch
result = func(ctxt, **new_args)
File "/opt/stack/tacker/tacker/conductor/conductor_server.py", line 164, in decorated_function
vnf_package.save()
File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 227, in __exit__
self.force_reraise()
File "/usr/local/lib/python3.8/dist-packages/oslo_utils/excutils.py", line 200, in force_reraise
raise self.value
File "/opt/stack/tacker/tacker/conductor/conductor_server.py", line 127, in decorated_function
return function(self, context, *args, **kwargs)
File "/opt/stack/tacker/tacker/conductor/conductor_server.py", line 507, in load_csar_data
self._onboard_vnf_package(
File "/opt/stack/tacker/tacker/conductor/conductor_server.py", line 456, in _onboard_vnf_package
package_vnfd.create()
File "/usr/local/lib/python3.8/dist-packages/oslo_versionedobjects/base.py", line 226, in wrapper
return fn(self, *args, **kwargs)
File "/opt/stack/tacker/tacker/objects/vnf_package_vnfd.py", line 204, in create
db_vnf_package_vnfd = _vnf_package_vnfd_create(
File "/usr/local/lib/python3.8/dist-packages/oslo_db/sqlalchemy/enginefacade.py", line 1022, in wrapper
return fn(*args, **kwargs)
File "/opt/stack/tacker/tacker/objects/vnf_package_vnfd.py", line 39, in _vnf_package_vnfd_create
raise exceptions.VnfPackageVnfdIdDuplicate(
tacker.common.exceptions.VnfPackageVnfdIdDuplicate: Vnf package with vnfd id c922dbf4-ee96-4e4b-af0e-85d233504d48 already exists.
```
When there are two projects (for example, Project A and Project B),
if both try to onboard a VNF Package that contains the same vnfdId,
the onboarding of the second project fails.
Currently, the vnfdId duplication check is performed globally across all projects,
instead of being scoped per tenant/project.
As a result, multi-tenancy is not properly supported in VNF Package onboarding.
Project A:
``` ------- ------- ------- ------- ----+-- ------- ------- --+---- ------- ------- +------ ------- +------ ------- ------+ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ ------- ------- ------- ------- ----+-- ------- ------- --+---- ------- ------- +------ ------- +------ ------- ------+ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ ab73-4d36- 8b32-0aac4f0c0c 08 | Sample | ONBOARDED | NOT_IN_USE | ENABLED | { | v1/vnf_ packages/ a1cf34b0- ab73-4d36- 8b32-0aac4f0c0c 08" | v1/vnf_ packages/ a1cf34b0- ab73-4d36- 8b32-0aac4f0c0c 08/package_ content" | ------- ------- ------- ------- ----+-- ------- ------- --+---- ------- ------- +------ ------- +------ ------- ------+ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+
$ openstack vnf p list
+------
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+------
| a1cf34b0-
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/
| | | | | | } |
| | | | | | } |
+------
$ openstack vnf p show a1cf34b0- ab73-4d36- 8b32-0aac4f0c0c 08 -c 'VNFD ID' ---+--- ------- ------- ------- ------- ------- + ---+--- ------- ------- ------- ------- ------- + ee96-4e4b- af0e-85d233504d 48 | ---+--- ------- ------- ------- ------- ------- +
+------
| Field | Value |
+------
| VNFD ID | c922dbf4-
+------
```
Project B:
The status remains `CREATED` instead of changing to `ONBOARDED`.
``` ------- ------- ------- ------- ----+-- ------- ------- --+---- ------- ------- +------ ------- +------ ------- ------+ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ ------- ------- ------- ------- ----+-- ------- ------- --+---- ------- ------- +------ ------- +------ ------- ------+ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+ 90a3-4f3c- b510-c99f652f36 79 | | CREATED | NOT_IN_USE | DISABLED | { | v1/vnf_ packages/ 390b0bc9- 90a3-4f3c- b510-c99f652f36 79" | v1/vnf_ packages/ 390b0bc9- 90a3-4f3c- b510-c99f652f36 79/package_ content" | ------- ------- ------- ------- ----+-- ------- ------- --+---- ------- ------- +------ ------- +------ ------- ------+ ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------- ------+
$ openstack vnf p list
+------
| Id | Vnf Product Name | Onboarding State | Usage State | Operational State | Links |
+------
| 390b0bc9-
| | | | | | "self": { |
| | | | | | "href": "/vnfpkgm/
| | | | | | }, |
| | | | | | "packageContent": { |
| | | | | | "href": "/vnfpkgm/
| | | | | | } |
| | | | | | } |
+------
```
Tacker error log
``` lib/python3. 8/dist- packages/ oslo_messaging/ rpc/server. py", line 165, in _process_incoming .dispatch( message) lib/python3. 8/dist- packages/ oslo_messaging/ rpc/dispatcher. py", line 309, in dispatch dispatch( endpoint, method, ctxt, args) lib/python3. 8/dist- packages/ oslo_messaging/ rpc/dispatcher. py", line 229, in _do_dispatch tacker/ tacker/ conductor/ conductor_ server. py", line 164, in decorated_function package. save() lib/python3. 8/dist- packages/ oslo_utils/ excutils. py", line 227, in __exit__ force_reraise( ) lib/python3. 8/dist- packages/ oslo_utils/ excutils. py", line 200, in force_reraise tacker/ tacker/ conductor/ conductor_ server. py", line 127, in decorated_function tacker/ tacker/ conductor/ conductor_ server. py", line 507, in load_csar_data _onboard_ vnf_package( tacker/ tacker/ conductor/ conductor_ server. py", line 456, in _onboard_ vnf_package vnfd.create( ) lib/python3. 8/dist- packages/ oslo_versionedo bjects/ base.py" , line 226, in wrapper tacker/ tacker/ objects/ vnf_package_ vnfd.py" , line 204, in create vnf_package_ vnfd = _vnf_package_ vnfd_create( lib/python3. 8/dist- packages/ oslo_db/ sqlalchemy/ enginefacade. py", line 1022, in wrapper tacker/ tacker/ objects/ vnf_package_ vnfd.py" , line 39, in _vnf_package_ vnfd_create VnfPackageVnfdI dDuplicate( common. exceptions. VnfPackageVnfdI dDuplicate: Vnf package with vnfd id c922dbf4- ee96-4e4b- af0e-85d233504d 48 already exists.
Traceback (most recent call last):
File "/usr/local/
res = self.dispatcher
File "/usr/local/
return self._do_
File "/usr/local/
result = func(ctxt, **new_args)
File "/opt/stack/
vnf_
File "/usr/local/
self.
File "/usr/local/
raise self.value
File "/opt/stack/
return function(self, context, *args, **kwargs)
File "/opt/stack/
self.
File "/opt/stack/
package_
File "/usr/local/
return fn(self, *args, **kwargs)
File "/opt/stack/
db_
File "/usr/local/
return fn(*args, **kwargs)
File "/opt/stack/
raise exceptions.
tacker.
```