[Bug 1579891] Re: [SRU] Validating a stack fails as one nested stack can't find an id from another

Felipe Reyes 1579891 at bugs.launchpad.net
Thu May 12 17:08:12 UTC 2016


The version in wily-proposed fixes the problem

Evidence:

$ heat stack-create -f minimal_portneutron.yaml minimal_portneutron
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| id                                   | stack_name          | stack_status       | creation_time       | updated_time |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| 7a92cf83-8f89-4b0b-8630-f1bc51399bcf | minimal_portneutron | CREATE_IN_PROGRESS | 2016-05-12T16:59:24 | None         |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
$ heat stack-list
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| id                                   | stack_name          | stack_status    | creation_time       | updated_time |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| 7a92cf83-8f89-4b0b-8630-f1bc51399bcf | minimal_portneutron | CREATE_COMPLETE | 2016-05-12T16:59:24 | None         |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
$ heat stack-create -f minimal_portnested.yaml minimal_portnested
ERROR: Failed to validate: : resources.port: : At least one of the following properties must be specified: network, network_id

# install heat from proposed

$ heat stack-create -f minimal_portnested.yaml minimal_portnested
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| id                                   | stack_name          | stack_status       | creation_time       | updated_time |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
| 7a92cf83-8f89-4b0b-8630-f1bc51399bcf | minimal_portneutron | CREATE_COMPLETE    | 2016-05-12T16:59:24 | None         |
| 9081062e-b6c9-42cd-8fe2-6f7fe2eade52 | minimal_portnested  | CREATE_IN_PROGRESS | 2016-05-12T17:03:16 | None         |
+--------------------------------------+---------------------+--------------------+---------------------+--------------+
$ heat stack-list
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| id                                   | stack_name          | stack_status    | creation_time       | updated_time |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+
| 7a92cf83-8f89-4b0b-8630-f1bc51399bcf | minimal_portneutron | CREATE_COMPLETE | 2016-05-12T16:59:24 | None         |
| 9081062e-b6c9-42cd-8fe2-6f7fe2eade52 | minimal_portnested  | CREATE_COMPLETE | 2016-05-12T17:03:16 | None         |
+--------------------------------------+---------------------+-----------------+---------------------+--------------+


** Tags removed: verification-needed
** Tags added: verification-done

-- 
You received this bug notification because you are a member of Ubuntu
OpenStack, which is subscribed to heat in Ubuntu.
https://bugs.launchpad.net/bugs/1579891

Title:
  [SRU] Validating a stack fails as one nested stack can't find an id
  from another

Status in Ubuntu Cloud Archive:
  Invalid
Status in Ubuntu Cloud Archive liberty series:
  Fix Committed
Status in heat package in Ubuntu:
  Fix Released
Status in heat source package in Wily:
  Fix Committed

Bug description:
  [Impact]

  when a user tries to create nested templates, the network id cannot be
  retrieved raising an error, this works fine in Kilo.

  [Test Case]

  * Deploy openstack with heat enabled
    $ bzr branch lp:openstack-charm-testing
    $ cd openstack-charm-testing
    $ juju deployer -c default.yaml -d -v -s 10 wily-liberty
    $ juju action do heat/0 domain-setup
    $ ./configure
    $ cat << EOF > minimal_portneutron.yaml
  heat_template_version: 2014-10-16
  description: "Works well in Darmstadt Liberty LAB"
  resources:
    network:
      type: network.yaml
      properties:
        name:
          list_join:
            - '_'
            - [ heat, { get_param: 'OS::stack_name' } ]
    port:
      type: OS::Neutron::Port
      properties:
        network_id: { get_attr: [ network, network ] }
  EOF
    $ cat << EOF > minimal_portnested.yaml
  heat_template_version: 2014-10-16
  description: "ERROR: Failed to validate: : resources.port: : At least one of the following properties must be specified: network, network_id"
  resources:
    network:
      type: network.yaml
      properties:
        name:
          list_join:
            - '_'
            - [ heat, { get_param: 'OS::stack_name' } ]
    port:
      type: port.yaml # Fails with 'Either network or network_id should be specified.'
      properties:
        network_id: { get_attr: [ network, network ] }
    $ cat << EOF > port.yaml
  heat_template_version: 2014-10-16
  parameters:
    network_id:
      type: string
  resources:
    port:
      type: OS::Neutron::Port
      properties:
        network_id: { get_param: network_id }
    $ cat << EOF > network.yaml
  heat_template_version: 2014-10-16
  description: >
    Creates a Neutron network/subnet combination, along with a security group
    that allows all traffic from the subnet.
  parameters:
    name:
      description: The name for the created network.
      type: string
  resources:
    network:
      type: OS::Neutron::Net
      properties:
        name: { get_param: name }
  outputs:
    network:
      description: The neutron network created.
      value: { get_resource: network }
    $ source novarc
    $ heat stack-create -f minimal_portneutron.yaml minimal_portneutron
    $ heat stack-create -f minimal_portnested.yaml minimal_portnested

  Expected:

  The nested port is created

  Actual result:

  Traceback (most recent call last):
    File "/usr/bin/heat", line 10, in <module>
      sys.exit(main())
    File "/usr/lib/python2.7/dist-packages/heatclient/shell.py", line 705, in main
      HeatShell().main(args)
    File "/usr/lib/python2.7/dist-packages/heatclient/shell.py", line 655, in main
      args.func(client, args)
    File "/usr/lib/python2.7/dist-packages/heatclient/v1/shell.py", line 140, in do_stack_create
      hc.stacks.create(**fields)
    File "/usr/lib/python2.7/dist-packages/heatclient/v1/stacks.py", line 136, in create
      data=kwargs, headers=headers)
    File "/usr/lib/python2.7/dist-packages/keystoneclient/adapter.py", line 176, in post
      return self.request(url, 'POST', **kwargs)
    File "/usr/lib/python2.7/dist-packages/heatclient/common/http.py", line 317, in request
      raise exc.from_response(resp)
  heatclient.exc.HTTPBadRequest: ERROR: Failed to validate: : resources.port: : At least one of the following properties must be specified: network, network_id

  [Regression Potential]

  * This patch was tested in a production environment and also it was
  already merged in the Liberty stable branch
  https://review.openstack.org/306293 , so the regression potential is
  minimum.

  [Other Info]

  * Upstream bug 1518676

To manage notifications about this bug go to:
https://bugs.launchpad.net/cloud-archive/+bug/1579891/+subscriptions



More information about the Ubuntu-openstack-bugs mailing list