ERROR tacker.api.v1.resource KeyError: 'resize_compute'

Bug #1662890 reported by Amit Bhardwaj
12
This bug affects 2 people
Affects Status Importance Assigned to Milestone
tacker
Expired
Undecided
Unassigned

Bug Description

Hello,

Template used: https://github.com/openstack/tacker/blob/master/samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml

Tacker version: 0.7.1
Openstack release: Newton

I am using above mentioned template and getting following error in tacker.log:

2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource [req-6a733992-03eb-47f9-a318-6d169d244967 75d8b1daa51a46fb8ed5f9095409f9f6 6e665ce96bfa4907ac24b694b94711ab - - -] create failed
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource Traceback (most recent call last):
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/api/v1/resource.py", line 83, in resource
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource result = method(request=request, **args)
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/api/v1/base.py", line 395, in create
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource obj = obj_creator(request.context, **kwargs)
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 394, in create_vnf
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource vnf_dict = self._create_vnf(context, vnf_info, vim_auth, infra_driver)
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 346, in _create_vnf
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource self.add_alarm_url_to_vnf(vnf_dict)
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 261, in add_alarm_url_to_vnf
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource vnf_dict, name, policy)
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/monitor.py", line 222, in update_vnf_with_alarm
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource driver = policy_dict['triggers']['resize_compute'][
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource KeyError: 'resize_compute'
2017-02-08 18:41:09.632 11302 ERROR tacker.api.v1.resource
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource [req-e8e3ee0b-9d93-4d31-9943-108c9ec2e82d 75d8b1daa51a46fb8ed5f9095409f9f6 6e665ce96bfa4907ac24b694b94711ab - - -] create failed
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource Traceback (most recent call last):
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/api/v1/resource.py", line 83, in resource
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource result = method(request=request, **args)
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/api/v1/base.py", line 395, in create
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource obj = obj_creator(request.context, **kwargs)
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 394, in create_vnf
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource vnf_dict = self._create_vnf(context, vnf_info, vim_auth, infra_driver)
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 346, in _create_vnf
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource self.add_alarm_url_to_vnf(vnf_dict)
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 261, in add_alarm_url_to_vnf
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource vnf_dict, name, policy)
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/monitor.py", line 222, in update_vnf_with_alarm
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource driver = policy_dict['triggers']['resize_compute'][
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource KeyError: 'resize_compute'
2017-02-08 18:48:09.414 11302 ERROR tacker.api.v1.resource

Please suggest what could be wrong here.

Regards
AB

Revision history for this message
dharmendra (dharmendra-kushwaha) wrote :

It looks resize_compute is missing in template.
Could you please try with https://github.com/openstack/tacker/blob/stable/newton/samples/tosca-templates/vnfd/tosca-vnfd-alarm-scale.yaml

Revision history for this message
Amit Bhardwaj (bhardwajamit23) wrote :
Download full text (4.3 KiB)

Hello Dharmendra,

I used the template that you have shared. It works if I keep my VM instance name as VDU1 only.

    VDU1:
      type: tosca.nodes.nfv.VDU.Tacker
      properties:
        image: {get_input: image}
        flavor: {get_input: flavor}
        availability_zone: {get_input: zone}
        name: amitbhardwaj_mtcgw_repo_dns_1
        mgmt_driver: noop

If for example I use something else in place of VDU1, it fails with following exception:

2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource [req-a4cc3374-d262-4ab1-b9b8-61104a19147f 75d8b1daa51a46fb8ed5f9095409f9f6 6e665ce96bfa4907ac24b694b94711ab - - -] create failed
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource Traceback (most recent call last):
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/api/v1/resource.py", line 83, in resource
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource result = method(request=request, **args)
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/api/v1/base.py", line 395, in create
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource obj = obj_creator(request.context, **kwargs)
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 394, in create_vnf
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource vnf_dict = self._create_vnf(context, vnf_info, vim_auth, infra_driver)
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 353, in _create_vnf
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource self.delete_vnf(context, vnf_id)
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 220, in __exit__
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource self.force_reraise()
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/lib/python2.7/dist-packages/oslo_utils/excutils.py", line 196, in force_reraise
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource six.reraise(self.type_, self.value, self.tb)
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/plugin.py", line 350, in _create_vnf
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource context=context, vnf=vnf_dict, auth_attr=vim_auth)
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/common/driver_manager.py", line 70, in invoke
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource return getattr(driver, method_name)(**kwargs)
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/common/log.py", line 35, in wrapper
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource return method(*args, **kwargs)
2017-02-09 12:56:09.370 11302 ERROR tacker.api.v1.resource File "/usr/local/lib/python2.7/dist-packages/tacker/vnfm/infra_driver...

Read more...

Revision history for this message
Amit Bhardwaj (bhardwajamit23) wrote :

Hello Again,

Link 438 of /usr/local/lib/python2.7/dist-packages/tacker/vnfm/infra_drivers/openstack/openstack.py
has a hardcoded reference of VDU1

                if 'policies' in topology_tpl_dict:
                    for policies in topology_tpl_dict['policies']:
                        policy_name, policy_dt = list(policies.items())[0]
                        if policy_dt['type'] == \
                                'tosca.policy.tacker.Scaling':
                            # Fixed metadata. it will be fixed
                            # once targets are supported
                            metadata_dict = dict()
                            metadata_dict['metering.vnf_id'] = vnf['id']
                            sub_heat_dict['resources']['VDU1']['properties']['metadata'] =\
                                metadata_dict
                            matching_metadata_dict = dict()
                            matching_metadata_dict['metadata.user_metadata.vnf_id'] =\
                                vnf['id']
                            mon_policy_hot['properties']['matching_metadata'] =\
                                matching_metadata_dict

Can you please check?

Revision history for this message
Amit Bhardwaj (bhardwajamit23) wrote : Re: [Bug 1662890] Re: ERROR tacker.api.v1.resource KeyError: 'resize_compute'
Download full text (12.8 KiB)

Also, I tried with VDU1 as hard-coded name for VM and I am getting error:

^[[B2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors [-] An
error occurred during processing the request: (<Request at 0x7fcbbd5adb10
POST
http://newton-controller:9890/v1.0/vnfs/0bd2b14e-883f-43e2-8721-0bbffc8a7ecd/vdu1_cpu_usage_monitoring_policy_2/SP1/4lukw7d9
>,)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors Traceback
(most recent call last):
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/lib/python2.7/dist-packages/oslo_middleware/catch_errors.py", line
38, in __call__
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors
response = req.get_response(self.application)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/lib/python2.7/dist-packages/webob/request.py", line 1299, in send
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors
application, catch_exc_info=False)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/lib/python2.7/dist-packages/webob/request.py", line 1263, in
call_application
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors
app_iter = application(self.environ, start_response)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/lib/python2.7/dist-packages/webob/dec.py", line 130, in __call__
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors resp =
self.call_func(req, *args, **self.kwargs)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/lib/python2.7/dist-packages/webob/dec.py", line 195, in call_func
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors return
self.func(req, *args, **kwargs)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/local/lib/python2.7/dist-packages/tacker/wsgi.py", line 312, in
__call__
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors
response = self.process_request(req)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/local/lib/python2.7/dist-packages/tacker/alarm_receiver.py", line 58,
in process_request
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors
token_identity = token.create_token()
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/local/lib/python2.7/dist-packages/tacker/vnfm/monitor_drivers/token.py",
line 36, in create_token
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors
token_id = sess.auth.get_token(sess)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/lib/python2.7/dist-packages/keystoneauth1/identity/base.py", line 90,
in get_token
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors return
self.get_access(session).auth_token
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/lib/python2.7/dist-packages/keystoneauth1/identity/base.py", line
136, in get_access
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors
self.auth_ref = self.get_auth_ref(session)
2017-02-13 18:16:59.774 11302 ERROR oslo_middleware.catch_errors File
"/usr/lib/python2.7/d...

Revision history for this message
Amit Bhardwaj (bhardwajamit23) wrote :

Is anyone working on this?

Revision history for this message
dharmendra (dharmendra-kushwaha) wrote :

Hi Amit,

I suspect, Tacker version(0.7.1) mentioned in description seems incorrect.

Points you mentioned in comment #3 already fixed.

could you please verify it again, and please share the execution steps & your vnfd file.

It will be better to test on Ocata/stable or latest master.

Changed in tacker:
status: New → Incomplete
Revision history for this message
Amit Bhardwaj (bhardwajamit23) wrote :
Download full text (3.4 KiB)

Hello Dharmendra,

root@newton-controller:/home/ubuntu# tacker --version
0.7.1

My Template:

  node_templates:
    VL_publicnet:
      type: tosca.nodes.nfv.VL
      properties:
        network_name: provider
        vendor: Tacker

    VL_priv1:
      type: tosca.nodes.nfv.VL
      properties:
        network_name: { get_input: priv1_net_name }
        vendor: Tacker
        ip_version: 4
        cidr: { get_input: priv1_net_cidr }
        start_ip: { get_input: priv1_net_pool_start }
        end_ip: { get_input: priv1_net_pool_end }
        gateway_ip: { get_input: priv1_net_gateway }

    VL_priv2:
      type: tosca.nodes.nfv.VL
      properties:
        network_name: { get_input: priv2_net_name }
        vendor: Tacker
        ip_version: 4
        cidr: { get_input: priv2_net_cidr }
        start_ip: { get_input: priv2_net_pool_start }
        end_ip: { get_input: priv2_net_pool_end }
        gateway_ip: { get_input: priv2_net_gateway }

    VL_extint:
      type: tosca.nodes.nfv.VL
      properties:
        network_name: { get_input: extint_net_name }
        vendor: Tacker
        ip_version: 4
        cidr: { get_input: extint_net_cidr }
        start_ip: { get_input: extint_net_pool_start }
        end_ip: { get_input: extint_net_pool_end }
        gateway_ip: { get_input: extint_net_gateway }

    VDU1:
      type: tosca.nodes.nfv.VDU.Tacker
      properties:
        image: {get_input: image}
        flavor: {get_input: flavor}
        availability_zone: {get_input: zone}
        name: amitbhardwaj_mtcgw_repo_dns_1
        mgmt_driver: noop

    CP_repo_dns_publicnet:
      type: tosca.nodes.nfv.CP.Tacker
      properties:
        management: true
        order: 0
        anti_spoofing_protection: false
      requirements:
        - virtualLink:
            node: VL_publicnet
        - virtualBinding:
            node: VDU1

    CP_repo_dns_priv1:
      type: tosca.nodes.nfv.CP.Tacker
      properties:
        management: true
        order: 0
        anti_spoofing_protection: false
      requirements:
        - virtualLink:
            node: VL_priv1
        - virtualBinding:
            node: VDU1

    CP_repo_dns_priv2:
      type: tosca.nodes.nfv.CP.Tacker
      properties:
        order: 1
        anti_spoofing_protection: false
      requirements:
        - virtualLink:
            node: VL_priv2
        - virtualBinding:
            node: VDU1

  policies:
    - SP1:
        type: tosca.policy.tacker.Scaling
        properties:
          increment: 1
          cooldown: 60
          min_instances: 1
          max_instances: 3
          default_instances: 2
          targets: [VDU1]

    - vdu1_cpu_usage_monitoring_policy_2:
        type: tosca.policies.tacker.Alarming
        triggers:
            resize_compute:
                event_type:
                    type: tosca.events.resource.utilization
                    implementation: ceilometer
                metrics: cpu_util
                condition:
                    threshold: 10
                    constraint: utilization less_than 10%
                    period: 200
                    evaluations: 1
                    method: avg
                    comparis...

Read more...

Revision history for this message
Launchpad Janitor (janitor) wrote :

[Expired for tacker because there has been no activity for 60 days.]

Changed in tacker:
status: Incomplete → Expired
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.