Scale of VNF instantiated according to the procedure of "ETSI NFV-SOL VNF Deployment as VM with TOSCA[1]" fails.
This is because, the scale process determines whether or not the scale can be set, but vnf_instantiated_info.scale_status is not set in VNF deployment with TOSCA.
* Instantiated VNF information
```
$ openstack vnflcm list
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| ID | VNF Instance Name | Instantiation State | VNF Provider | VNF Software Version | VNF Product Name | VNFD ID |
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
| 2c1f7511-5035-4cc7-b3b9-f05290a0eb45 | vnf-2c1f7511-5035-4cc7-b3b9-f05290a0eb45 | INSTANTIATED | Company | 1.0 | Sample VNF | b1bb0ce7-ebca-4fa7-95ed-4840d7000010 |
+--------------------------------------+------------------------------------------+---------------------+--------------+----------------------+------------------+--------------------------------------+
```
* Error when executing Scale command
```
$ openstack vnflcm scale --type SCALE_OUT --aspect-id VDU1_scale 2c1f7511-5035-4cc7-b3b9-f05290a0eb45
409-tackerFault
```
* Error logs
```
tacker-server[1000]: 2021-02-10 16:44:19.131 INFO tacker.wsgi [req-4fb1a060-6f5d-4d59-b675-c2d7a0fc1012 nfv_user nfv] POST http://127.0.0.1:9890/vnflcm/v1/vnf_instances/2c1f7511-5035-4cc7-b3b9-f05290a0eb45/scale
tacker-server[1000]: 2021-02-10 16:44:19.134 DEBUG tacker.db.vnfm.vnfm_db [req-4fb1a060-6f5d-4d59-b675-c2d7a0fc1012 nfv_user nfv] vnf_db <tacker.db.vnfm.vnfm_db.VNF[object at 7ff1429171f0] {tenant_id='4b8e276e25fc4e658050621d57a6c349', id='2c1f7511-5035-4cc7-b3b9-f05290a0eb45', created_at=datetime.datetime(2021, 2, 10, 7, 38, 11), updated_at=datetime.datetime(2021, 2, 10, 7, 39, 17), deleted_at=datetime.datetime(1, 1, 1, 0, 0), vnfd_id='b1bb0ce7-ebca-4fa7-95ed-4840d7000010', name='vnf-2c1f7511-5035-4cc7-b3b9-f05290a0eb45', description=None, instance_id='2cf6ffd0-530c-4f72-ab6d-c9270d18a9c8', mgmt_ip_address=None, status='ACTIVE', vim_id='d0728d23-f47f-4789-8011-78b966ad3e50', placement_attr={'regions': ['RegionOne']}, error_reason=None}> _make_vnf_dict /usr/local/lib/python3.8/dist-packages/tacker/db/vnfm/vnfm_db.py:227
...snip...
tacker-server[1000]: 2021-02-10 16:44:19.146 ERROR tacker.api.vnflcm.v1.controller [req-4fb1a060-6f5d-4d59-b675-c2d7a0fc1012 nfv_user nfv] NOT SCALE VNF
tacker-server[1000]: 2021-02-10 16:44:19.146 INFO tacker.wsgi [req-4fb1a060-6f5d-4d59-b675-c2d7a0fc1012 nfv_user nfv] http://127.0.0.1:9890/vnflcm/v1/vnf_instances/2c1f7511-5035-4cc7-b3b9-f05290a0eb45/scale returned with HTTP 409
tacker-server[1000]: 2021-02-10 16:44:19.146 INFO tacker.wsgi [req-4fb1a060-6f5d-4d59-b675-c2d7a0fc1012 nfv_user nfv] 127.0.0.1 - - [10/Feb/2021 16:44:19] "POST /vnflcm/v1/vnf_instances/2c1f7511-5035-4cc7-b3b9-f05290a0eb45/scale HTTP/1.1" 409 280 0.048298
```
* Source code returning an error response
https://opendev.org/openstack/tacker/src/branch/master/tacker/api/vnflcm/v1/controller.py
```
def scale(self, request, id, body):
context = request.environ['tacker.context']
context.can(vnf_lcm_policies.VNFLCM % 'scale')
try:
vnf_info = self._vnfm_plugin.get_vnf(context, id)
if vnf_info['status'] != constants.ACTIVE:
return self._make_problem_detail(
'VNF IS NOT ACTIVE', 409, title='VNF IS NOT ACTIVE')
vnf_instance = self._get_vnf_instance(context, id)
if not vnf_instance.instantiated_vnf_info.scale_status:
return self._make_problem_detail(
'NOT SCALE VNF', 409, title='NOT SCALE VNF')
return self._scale(context, vnf_info, vnf_instance, body)
```
* Error reason
Vnf_instantiated_info.scale_status is not set for VNF instantiated with "ETSI NFV-SOL VNF Deployment as VM with TOSCA".
Since the scale process determines whether or not the scale can be set, it is necessary to add a process to set vnf_instantiated_info.scale_status even in VNF deployment with TOSCA.
```
mysql> select scale_status from vnf_instantiated_info where id="2c1f7511-5035-4cc7-b3b9-f05290a0eb45";
+--------------+
| scale_status |
+--------------+
| [] |
```
* Expected vnf_instantiated_info information("ETSI NFV-SOL VNF Deployment as VM with LCM operation user data[2]" result)
```
mysql> select scale_status from vnf_instantiated_info;
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| scale_status |
+---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------+
| [{"tacker_object.data": {"deleted": false, "aspect_id": "VDU1_scale", "scale_level": 0}, "tacker_object.name": "ScaleInfo", "tacker_object.changes": ["scale_level", "deleted", "aspect_id"], "tacker_object.version": "1.0", "tacker_object.namespace": "tacker"}] |
```
[1]:https://docs.openstack.org/tacker/latest/user/etsi_vnf_deployment_as_vm_with_tosca.html
[2]:https://docs.openstack.org/tacker/latest/user/etsi_vnf_deployment_as_vm_with_user_data.html