OS::Neutron::Subnet can't refer to OS::Neutron::SubnetPool created in same template

Bug #1705052 reported by Nikita Gerasimov
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
OpenStack Heat
Fix Released
Medium
Rabi Mishra

Bug Description

heat version - 8.0.1

Step to reproduce:
1. template:
heat_template_version: 2017-02-24

description: test template

resources:
  test_subnetpool:
    type: OS::Neutron::SubnetPool
    properties:
      default_prefixlen: 25
      max_prefixlen: 32
      min_prefixlen: 22
      prefixes:
        - "192.168.0.0/16"
  test_net1:
    type: OS::Neutron::Net
    depends_on: test_subnetpool
  test_subnet1:
    type: OS::Neutron::Subnet
    depends_on: test_subnetpool
    properties:
      network: { get_resource: test_net1 }
      ip_version: 4
      subnetpool: { get_resource: test_subnetpool }
      prefixlen: 25

2. try to start template

Expected: heat create SubnetPool and assign subnet from pool to test_net1

Observed: "ERROR: At least one of the following properties must be specified: subnetpool, cidr."

heat-engine.log contain:
2017-07-18 15:08:53.687 2977411 INFO heat.engine.service [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] Creating stack test
2017-07-18 15:08:53.754 2977411 DEBUG neutronclient.v2_0.client [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] GET call to neutron for http://192.168.11.10:9696/v2.0/extensions.json used request id req-f0be59aa-31a2-42d9-8283-c6489f3a7734 _append_request_id /usr/lib/python2.7/site-packages/neutronclient/v2_0/client.py:128
2017-07-18 15:08:53.758 2977411 DEBUG oslo_policy._cache_handler [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] Reloading cached file /etc/heat/policy.json read_cached_file /usr/lib/python2.7/site-packages/oslo_policy/_cache_handler.py:40
2017-07-18 15:08:53.762 2977411 DEBUG oslo_policy.policy [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] Reloaded policy file: /etc/heat/policy.json _load_policy_file /usr/lib/python2.7/site-packages/oslo_policy/policy.py:666
2017-07-18 15:08:53.770 2977411 DEBUG heat.engine.parameter_groups [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] Validating Parameter Groups: OS::project_id, OS::stack_id validate /usr/lib/python2.7/site-packages/heat/engine/parameter_groups.py:42
2017-07-18 15:08:53.771 2977411 INFO heat.engine.resource [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] Validating (<heat.engine.resources.openstack.neutron.subnetpool.SubnetPool object at 0x557d290>,)
2017-07-18 15:08:53.774 2977411 INFO heat.engine.resource [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] Validating (<heat.engine.resources.openstack.neutron.net.Net object at 0x56262d0>,)
2017-07-18 15:08:53.775 2977411 INFO heat.engine.resource [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] Validating (<heat.engine.resources.openstack.neutron.subnet.Subnet object at 0x5641250>,)
2017-07-18 15:08:53.776 2977411 DEBUG heat.engine.stack [req-a609a8a1-dcbf-4830-aecf-6b3025a4ba56 - o3ltest - - -] At least one of the following properties must be specified: subnetpool, cidr. validate /usr/lib/python2.7/site-packages/heat/engine/stack.py:851

Rabi Mishra (rabi)
Changed in heat:
assignee: nobody → Rabi Mishra (rabi)
importance: Undecided → Medium
Thomas Herve (therve)
Changed in heat:
milestone: none → pike-3
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/485024

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/485024
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=3d29db4c7060a546de8f880cf9515c2e22102ef8
Submitter: Jenkins
Branch: master

commit 3d29db4c7060a546de8f880cf9515c2e22102ef8
Author: rabi <email address hidden>
Date: Wed Jul 19 09:13:13 2017 +0530

    Fix subnet validate() for subnetpool resource ref

    When a resource reference is used __getitem__() returns empty
    string before a resource is created and the validation fails.
    Check for None value instead which would be the case when the
    property is not specified.

    Change-Id: Ida4b32c3611d1638b9c0eb78cb2b31a32f112fa9
    Closes-Bug: #1705052

Changed in heat:
status: In Progress → Fix Released
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix proposed to heat (stable/ocata)

Fix proposed to branch: stable/ocata
Review: https://review.openstack.org/487645

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

This issue was fixed in the openstack/heat 9.0.0.0b3 development milestone.

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

Reviewed: https://review.openstack.org/487645
Committed: https://git.openstack.org/cgit/openstack/heat/commit/?id=71431371761afc198ed50339d5c653eded369562
Submitter: Jenkins
Branch: stable/ocata

commit 71431371761afc198ed50339d5c653eded369562
Author: rabi <email address hidden>
Date: Wed Jul 19 09:13:13 2017 +0530

    Fix subnet validate() for subnetpool resource ref

    When a resource reference is used __getitem__() returns empty
    string before a resource is created and the validation fails.
    Check for None value instead which would be the case when the
    property is not specified.

    Change-Id: Ida4b32c3611d1638b9c0eb78cb2b31a32f112fa9
    Closes-Bug: #1705052
    (cherry picked from commit 3d29db4c7060a546de8f880cf9515c2e22102ef8)

tags: added: in-stable-ocata
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix included in openstack/heat 8.0.4

This issue was fixed in the openstack/heat 8.0.4 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.