``openstack vnflcm scale`` cannot be executed without '--additional-param-file' option

Bug #1903280 reported by Hiroo Kitamura
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
python-tackerclient
High
Unassigned

Bug Description

When executing ETSI-NFV compliant VNF scaling with ``openstack vnflcm scale``, if '--additional-param-file' is omitted, it cannot be executed.
No error is displayed and no request is sent to Tacker.

---
$ openstack vnflcm scale --type 'SCALE_OUT' --aspect-id 'worker_instance' de51ccc2-f09d-43a8-8912-1ae8230ecd75
$
---

I get an error even if I prepare an appropriate additional-param-file and execute scale.

---
$ cat scale_param.json
{
  "key": "value"
}
$ openstack vnflcm scale --type 'SCALE_OUT' --aspect-id 'worker_instance' de51ccc2-f09d-43a8-8912-1ae8230ecd75 --additional-param-file scale_param.json
'type' is a required property
---

I think there are some bugs in the code below.

---
    def take_action(self, parsed_args):
        """Execute scale_vnf_instance and output result comment.

        Args:
            parsed_args ([Namespace]): [description]
        """
        client = self.app.client_manager.tackerclient
        if parsed_args.additional_param_file:
            result = client.scale_vnf_instance(
                parsed_args.vnf_instance,
                self.args2body(file_path=parsed_args.additional_param_file))
            if not result:
                print((_('Scale request for VNF Instance %(id)s has been'
                         ' accepted.') % {'id': parsed_args.vnf_instance}))
---

Specifically, I think the following are bugs.

* Although '--additional-param-file' is Cardinality: 0.1 in Scale-Spec, it is mandatory.
* Request-body does not contain arguments such as'--type' or'--aspect-id', only the contents of'--additional-param-file'
*'--I' is an unnecessary argument that is not used

Target code:
  https://opendev.org/openstack/python-tackerclient/src/branch/master/tackerclient/osc/v1/vnflcm/vnflcm.py#L522

Scale-Spec:
  https://specs.openstack.org/openstack/tacker-specs/specs/victoria/support-scale-api-based-on-etsi-nfv-sol.html

Revision history for this message
Wataru Juso (w-juso) wrote :

> Specifically, I think the following are bugs.
>
> * Although '--additional-param-file' is Cardinality: 0.1 in Scale-Spec, it is mandatory.
> * Request-body does not contain arguments such as'--type' or'--aspect-id', only the contents of'--additional-param-file'
> *'--I' is an unnecessary argument that is not used

Mandatory of cardinality is aspectid and type in spec.
What would be the following modifications?

openstack vnflcm scale [-h] [--number-of-steps] [--additional-param-file]
                                  <vnf-instance> <type> <aspect-id>

Revision history for this message
Hiroo Kitamura (h-kitamura) wrote :

I think the following modification is better.
This is because the user does not have to worry about the order of setting vnf-instance/type/aspect-id.

openstack vnflcm scale [-h] [--number-of-steps] [--additional-param-file] --type <type> --aspect-id <aspect-id>
                                  <vnf-instance>

I'm assuming "--flavor" in nova's `openstack server create`.
Please try to reference.
https://opendev.org/openstack/python-novaclient/src/branch/master/novaclient/v2/shell.py

Yasufumi Ogawa (yasufum)
Changed in python-tackerclient:
importance: Undecided → High
Revision history for this message
Wataru Juso (w-juso) wrote :

Thank you for reply.

I understood worrying the order of setting vnf-instance/type/aspect-id.
I will modify aware of the order of setting.

Wataru Juso (w-juso)
Changed in python-tackerclient:
status: New → In Progress
Revision history for this message
Wataru Juso (w-juso) wrote :
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/python-tackerclient 1.5.0

This issue was fixed in the openstack/python-tackerclient 1.5.0 release.

To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers