scaling convertion fails

Bug #1615568 reported by Kanagaraj Manickam
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Heat Translator
Fix Released
Critical
bharaththiruveedula

Bug Description

I tried to convert the below TOSCA

tosca_definitions_version: tosca_simple_yaml_1_0

description: >
  Template for deploying servers based on policies.

topology_template:
  node_templates:
    my_server_1:
      type: tosca.nodes.Compute
      capabilities:
        host:
         properties:
           num_cpus: 2
           disk_size: 10 GB
           mem_size: 512 MB
        os:
         properties:
            # host Operating System image properties
            architecture: x86_64
            type: Linux
            distribution: RHEL
            version: 6.5
    my_server_2:
      type: tosca.nodes.Compute
      capabilities:
        host:
         properties:
           num_cpus: 2
           disk_size: 10 GB
           mem_size: 512 MB
        os:
         properties:
            # host Operating System image properties
            architecture: x86_64
            type: Linux
            distribution: RHEL
            version: 6.5
  policies:
    - asg:
        type: tosca.policies.Scaling
        description: Simple node autoscaling
        targets: [my_server_1, my_server_2]
        triggers:
          resize_compute:
            description: trigger
            condition:
              constraint: utilization greater_than 50%
              period: 60
              evaluations: 1
              method: average
        properties:
          min_instances: 2
          max_instances: 10
          default_instances: 3
          increment: 1

And it produces
manickan@mrkanag-os:~/devstack$ heat-translator --template-file /opt/stack/heat-translator/translator/tests/data/tosca_autoscaling.yaml
heat_template_version: 2013-05-23

description: >
  Template for deploying servers based on policies.

parameters: {}
resources:
  my_server_2:
    type: OS::Heat::AutoScalingGroup
    properties:
      min_size: 2
      default_instances: 3
      resources:
        type: OS::Nova::Server
        properties:
          flavor: m1.medium
          user_data_format: SOFTWARE_CONFIG
          image: rhel-6.5-test-image
      max_size: 10
  my_server_1:
    type: OS::Heat::AutoScalingGroup
    properties:
      min_size: 2
      default_instances: 3
      resources:
        type: OS::Nova::Server
        properties:
          flavor: m1.medium
          user_data_format: SOFTWARE_CONFIG
          image: rhel-6.5-test-image
      max_size: 10
  asg:
    type: OS::Heat::ScalingPolicy
    properties:
      auto_scaling_group_id:
        get_resource: my_server_2
      adjustment_type: change_in_capacity
      scaling_adjustment: 1
  asg_alarm:
    type: OS::Ceilometer::Alarm
    properties:
      meter_name: cpu_util
      description: Simple node autoscaling
      period: 60
      statistic: average
      threshold: 1
      comparison_operator: gt
outputs: {}

It suppose to create one ASG with my_sever_1 and my_server_2 and make the policy to point to it.

Here it creates two ASGs, which is wrong and policy points to only my_server_2 ASG, but actually it should refer ASG with both server in place as targets has both.

Also, it should output the IP address of scaled VMs. please refer the logic implemented at https://github.com/openstack/tacker/blob/master/tacker/vm/infra_drivers/heat/heat.py#L762-L794

Changed in heat-translator:
importance: Undecided → Critical
description: updated
Sahdev Zala (spzala)
Changed in heat-translator:
assignee: nobody → Santhosh64 (santhoshkumar-kondapalli)
Revision history for this message
Sridhar Ramaswamy (srics-r) wrote :

Folks - this is a critical blocker for Tacker vnf auto-scaling. I'd appreciate a quick fix. Thanks!

Revision history for this message
Sahdev Zala (spzala) wrote :

@Santhosh, can you please update on the progress of this bug fix? Thanks!

Revision history for this message
Santhosh64 (santhoshkumar-kondapalli) wrote : Re: [Bug 1615568] Re: scaling convertion fails
Download full text (4.6 KiB)

Hi Sridhar,

I assigned this bug one of my colleague. They will take care of it.

Thanks & Regards,
K.Santhosh
----- Original Message -----
From: Sahdev Zala <email address hidden>
To: santhoshkumar kondapalli <email address hidden>
Sent: Wed, 31 Aug 2016 07:26:58 +0530 (IST)
Subject: [Bug 1615568] Re: scaling convertion fails

@Santhosh, can you please update on the progress of this bug fix?
Thanks!

--
You received this bug notification because you are a bug assignee.
https://bugs.launchpad.net/bugs/1615568

Title:
  scaling convertion fails

Status in Heat Translator:
  New

Bug description:
  I tried to convert the below TOSCA

  tosca_definitions_version: tosca_simple_yaml_1_0

  description: >
    Template for deploying servers based on policies.

  topology_template:
    node_templates:
      my_server_1:
        type: tosca.nodes.Compute
        capabilities:
          host:
           properties:
             num_cpus: 2
             disk_size: 10 GB
             mem_size: 512 MB
          os:
           properties:
              # host Operating System image properties
              architecture: x86_64
              type: Linux
              distribution: RHEL
              version: 6.5
      my_server_2:
        type: tosca.nodes.Compute
        capabilities:
          host:
           properties:
             num_cpus: 2
             disk_size: 10 GB
             mem_size: 512 MB
          os:
           properties:
              # host Operating System image properties
              architecture: x86_64
              type: Linux
              distribution: RHEL
              version: 6.5
    policies:
      - asg:
          type: tosca.policies.Scaling
          description: Simple node autoscaling
          targets: [my_server_1, my_server_2]
          triggers:
            resize_compute:
              description: trigger
              condition:
                constraint: utilization greater_than 50%
                period: 60
                evaluations: 1
                method: average
          properties:
            min_instances: 2
            max_instances: 10
            default_instances: 3
            increment: 1

  And it produces
  manickan@mrkanag-os:~/devstack$ heat-translator --template-file /opt/stack/heat-translator/translator/tests/data/tosca_autoscaling.yaml
  heat_template_version: 2013-05-23

  description: >
    Template for deploying servers based on policies.

  parameters: {}
  resources:
    my_server_2:
      type: OS::Heat::AutoScalingGroup
      properties:
        min_size: 2
        default_instances: 3
        resources:
          type: OS::Nova::Server
          properties:
            flavor: m1.medium
            user_data_format: SOFTWARE_CONFIG
            image: rhel-6.5-test-image
        max_size: 10
    my_server_1:
      type: OS::Heat::AutoScalingGroup
      properties:
        min_size: 2
        default_instances: 3
        resources:
          type: OS::Nova::Server
          properties:
            flavor: m1.medium
            user_data_format: SOFTWARE_CONFIG
            image: rhel-6.5-test-image
        max_size: 10
    asg:
      type: OS::Heat::ScalingPolicy
...

Read more...

Revision history for this message
Sahdev Zala (spzala) wrote :

I got an update today as my latest follow up with Santhosh that he had to stop working on it and currently can't work it further. Bharath is taking ownership of it. @Bharath, thank you so much!!

Changed in heat-translator:
assignee: Santhosh64 (santhoshkumar-kondapalli) → bharaththiruveedula (bharath-ves)
Revision history for this message
xiaodong shang (shangxdy) wrote :

"it should output the IP address of scaled VMs."
I am working on the bug, and will submit patch as soon as possible.

Revision history for this message
Sahdev Zala (spzala) wrote :

Updating per IRC meeting yesterday. The fix needs a design change in the way translator works, currently it only produces a single translated template but the fix requires multiple translated template that are referenced through main template. Bharath is working on it and targeting to have patch updated early next week most likely by Monday. Shang will be creating another bug for his comment above and targeting to submit patch in next couple days.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat-translator (master)

Fix proposed to branch: master
Review: https://review.openstack.org/371063

Changed in heat-translator:
status: New → In Progress
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat-translator (master)

Reviewed: https://review.openstack.org/371063
Committed: https://git.openstack.org/cgit/openstack/heat-translator/commit/?id=1b55993df65e4152bb7417ea762bf9541d936b61
Submitter: Jenkins
Branch: master

commit 1b55993df65e4152bb7417ea762bf9541d936b61
Author: Bharath Thiruveedula <email address hidden>
Date: Fri Sep 16 00:32:31 2016 +0530

    Add nested template support for auto scaling

    Change-Id: I508ce675667f4d8346454a075ca1cbde5aa3c6b3
    Closes-Bug: #1615568

Changed in heat-translator:
status: In Progress → Fix Released
Revision history for this message
Sahdev Zala (spzala) wrote :

Programmatic access to the translated nested templates will be provided under https://review.openstack.org/#/c/342675/

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.