VNFD is presented in an arbitrary on horizon

Bug #1823854 reported by JangwonLee
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
tacker
Won't Fix
Undecided
JangwonLee

Bug Description

When a user creates a VNFD with a template of type dic, VNFD is presented on Horizon in an arbitrary order, non-identical to the order of the input file.

The result like below(by Horizon)
template: tosca-vnfd-alarm-scale.yaml

description: Demo example
metadata: {template_name: sample-tosca-vnfd}
topology_template:
  node_templates:
    CP1:
      properties: {anti_spoofing_protection: false, management: true}
      requirements:
      - virtualLink: {node: VL1}
      - virtualBinding: {node: VDU1}
      type: tosca.nodes.nfv.CP.Tacker
    VDU1:
      capabilities:
        nfv_compute:
          properties: {disk_size: 1 GB, mem_size: 512 MB, num_cpus: 2}
      properties:
        availability_zone: nova
        image: cirros-0.4.0-x86_64-disk
        metadata: {metering.server_group: SG1}
        mgmt_driver: noop
      type: tosca.nodes.nfv.VDU.Tacker
    VL1:
      properties: {network_name: net_mgmt, vendor: Tacker}
      type: tosca.nodes.nfv.VL
  policies:
  - SP1:
      properties: {cooldown: 120, default_instances: 1, increment: 1, max_instances: 3,
        min_instances: 1}
      targets: [VDU1]
      type: tosca.policies.tacker.Scaling
  - vdu_cpu_usage_monitoring_policy:
      triggers:
        vdu_hcpu_usage_scaling_out:
          action: [SP1]
          condition: {aggregation_method: mean, comparison_operator: gt, constraint: utilization
              greater_than 80%, evaluations: 1, granularity: 60, resource_type: instance,
            threshold: 80}
          event_type: {implementation: ceilometer, type: tosca.events.resource.utilization}
          metadata: SG1
          metric: cpu_util
        vdu_lcpu_usage_scaling_in:
          action: [SP1]
          condition: {aggregation_method: mean, comparison_operator: lt, constraint: utilization
              less_than 10%, evaluations: 1, granularity: 60, resource_type: instance,
            threshold: 10}
          event_type: {implementation: ceilometer, type: tosca.events.resource.utilization}
          metadata: SG1
          metric: cpu_util
      type: tosca.policies.tacker.Alarming
tosca_definitions_version: tosca_simple_profile_for_nfv_1_0_0

It caused by the property of dict. At first, after 'yaml.load()' the order has changed.
And 'yaml.safe_dump()' dumps changed dict order by alphabet. So the above result has created.

We need to make ordered_load and ordered_dump function to fix the VNFD order.

JangwonLee (jangwonlee)
Changed in tacker:
assignee: nobody → JangwonLee (jangwonlee)
Yasufumi Ogawa (yasufum)
Changed in tacker:
status: New → Won't Fix
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.