Validating a stack fails as one nested stack can't find an id from another

Bug #1518676 reported by Removed by request
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Thomas Herve
Kilo
Fix Released
Medium
Thomas Herve
Liberty
Fix Released
Medium
Unassigned

Bug Description

In this example, a parent stack is creating a subnet in one nested stack and a loadbalancer in another:

resources:

  network:
    type: Test::Network

  load_balancer:
    type: Test::LoadBalancer
    properties:
      private_subnet: {get_attr: [network, private_subnet_id]}
    depends_on: network

Validation will fail in this case (and stack will not start creating) with this error:

RESP BODY: {"explanation": "The server could not comply with the request since it is either malformed or otherwise incorrect.", "code": 400, "error": {"message": "Failed to validate: : resources.load_balancer: : At least one of the following properties must be specified: subnet, subnet_id", "traceback": null, "type": "StackValidationFailed"}, "title": "Bad Request"}

This was tested on version 0.8.0 and it was working on previous versions (I'm using the same templates for the past 2 major openstack versions)

Revision history for this message
Removed by request (removed3381998) wrote :

Re-checked. This works well with version 0.6.0

Revision history for this message
Removed by request (removed3381998) wrote :

Thanks therve,
0.8.0 is Liberty and 0.6.0 which is Kilo.

===

The nested "net" stack is this:

heat_template_version: 2013-05-23
description: >
  Network provider template

resources:
  private_network:
    type: OS::Neutron::Net
    properties:
      name: private_net_heat
      shared: false

  private_subnet:
    type: OS::Neutron::Subnet
    properties:
      name: private_subnet_heat
      network: {get_resource: private_network}
      ip_version: 4
      cidr: 10.1.10.1/24
      gateway_ip: 10.1.10.1
      allocation_pools: [{"start": 10.1.10.10, "end":10.1.10.200}]

outputs:
  private_network_id:
    description: Private network ID
    value: {get_resource: private_network}
  private_subnet_id:
    description: Private subnet ID
    value: {get_resource: private_subnet}

===

The LB nested stack is this:

heat_template_version: 2013-05-23
description: >
  Load Balancing provider template

parameters:
  private_subnet:
    type: string

resources:
  monitor:
    type: OS::Neutron::HealthMonitor
    properties:
      type: TCP
      delay: 5
      max_retries: 5
      timeout: 5

  pool:
    type: OS::Neutron::Pool
    properties:
      protocol: HTTP
      monitors: [{get_resource: monitor}]
      subnet_id: {get_param: private_subnet}
      lb_method: ROUND_ROBIN
      vip:
        protocol_port: 80

  lb:
    type: OS::Neutron::LoadBalancer
    properties:
      protocol_port: 80
      pool_id: {get_resource: pool}

outputs:
  pool_id:
    description: LoadBalancer Pool ID
    value: {get_resource: pool}

Thomas Herve (therve)
Changed in heat:
importance: Undecided → Medium
assignee: nobody → Thomas Herve (therve)
milestone: none → mitaka-1
Revision history for this message
Rabi Mishra (rabi) wrote :

This seems to be broken by the commit[1]. Probably we should revert it.

[1]https://github.com/openstack/heat/commit/97f7b4f5cd0d6707516f277e9cd319947ee48b18

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

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

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

Reviewed: https://review.openstack.org/248719
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=003df61ae026174d27b2c44a63527ab93ccc4ac1
Submitter: Jenkins
Branch: master

commit 003df61ae026174d27b2c44a63527ab93ccc4ac1
Author: Thomas Herve <email address hidden>
Date: Mon Nov 23 15:09:14 2015 +0100

    Translate properties before update

    This adds the translation rule call to properties before update, so that
    we can remove resource code that refers to deprecated properties. The
    new ones are used everywhere with the expectation that the translation
    occurred.

    Change-Id: Ibdf91ae711f82de5c60896f2452e2872bb3dc9cb
    Closes-Bug: #1518676

Changed in heat:
status: In Progress → Fix Committed
Revision history for this message
Thierry Carrez (ttx) wrote : Fix included in openstack/heat 6.0.0.0b1

This issue was fixed in the openstack/heat 6.0.0.0b1 development milestone.

Changed in heat:
status: Fix Committed → Fix Released
tags: added: liberty-backport-potential
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/258307

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/liberty)

Reviewed: https://review.openstack.org/258307
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=4d4936691b00378eb8326ce2ff72af2f121ac5aa
Submitter: Jenkins
Branch: stable/liberty

commit 4d4936691b00378eb8326ce2ff72af2f121ac5aa
Author: huangtianhua <email address hidden>
Date: Wed Dec 16 15:46:39 2015 +0800

    Translate properties before update

    This adds the translation rule call to properties
    before update. The new ones are used everywhere
    with the expectation that the translation occurred.

    Closes-Bug: #1518676
    (cherry picked from commit 003df61ae026174d27b2c44a63527ab93ccc4ac1)

    Change-Id: Iac729b951f56e61be25417719690dca0571db12f

tags: added: in-stable-liberty
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/kilo)

Fix proposed to branch: stable/kilo
Review: https://review.openstack.org/259023

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/kilo)

Reviewed: https://review.openstack.org/259023
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=032715014563c689ad294e599cfb9fdd0278a607
Submitter: Jenkins
Branch: stable/kilo

commit 032715014563c689ad294e599cfb9fdd0278a607
Author: Thomas Herve <email address hidden>
Date: Thu Dec 17 14:54:45 2015 +0100

    Fix property comparison in neutron resources

    We were trying to validate deprecated neutron properties with
    properties.data, which work when you have a reference, but not a
    parameter. Instead, compare it None which is what's the value when it's
    not set at all.

    We can't backport the original patch because it uses the new translation
    mechanism for deprecating properties.

    Change-Id: Ifa96a1cf94ced833afaf4b7ca306a953987548b6
    Closes-Bug: #1518676

Revision history for this message
Doug Hellmann (doug-hellmann) wrote : Fix included in openstack/heat 5.0.1

This issue was fixed in the openstack/heat 5.0.1 release.

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/liberty)

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/305687

Revision history for this message
OpenStack Infra (hudson-openstack) wrote :

Fix proposed to branch: stable/liberty
Review: https://review.openstack.org/306293

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Change abandoned on heat (stable/liberty)

Change abandoned by Thomas Herve (<email address hidden>) on branch: stable/liberty
Review: https://review.openstack.org/305687
Reason: Superceded

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to heat (stable/liberty)

Reviewed: https://review.openstack.org/306293
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=6c913f05f1f2bf270d3c35e3431318885971ffc4
Submitter: Jenkins
Branch: stable/liberty

commit 6c913f05f1f2bf270d3c35e3431318885971ffc4
Author: Thomas Herve <email address hidden>
Date: Thu Apr 14 09:06:39 2016 +0000

    Fix Translate properties before update

    This fixes the backport done at 4d4936691b00378eb8326ce2ff72af2f121ac5aa
    to contain all the changes in the original patch.

    Change-Id: Id4b752cf4b431c05c330b3e95629fd488c52063f
    Closes-Bug: #1518676

Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 5.0.2

This issue was fixed in the openstack/heat 5.0.2 release.

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.