Ask Your Question
0

Child's parameters are being unrecognized by parent template. [closed]

asked 2017-02-16 08:16:32 -0600

udayutkarsh gravatar image

updated 2017-02-16 08:17:36 -0600

Hi,

I am new to writing HOT templates in yaml files. I have created following three files:
1) child.yaml, which launches a VM
2) parent.yaml which calls child.yaml inorder to multiply chile instances.
3) an environmen file

I am passing child's parameters from parent. But while creating heat stack it does not recognize child parameters and throwing error.

Please see the contents:

child.yaml::
========
heat_template_version: 2016-04-08
description: this is test file to demonstrate nesting templates

parameters:
  vm-name:
    type: string
    default: ud-test-vm

resources:
  instance:
    type: OS::Nova::Server
    properties:
      name: { get_param: vm-name }
      flavor: m1.svc
      networks:
      - network: enm_internal_network_megha
      key_name: enm_keypair
      image: cirros

parent.yaml:
=========

heat_template_version: 2015-04-30
description: this demo master file

parameters:
  vm-name-master:
    type: string
    default: vm-name-calling

resources:
  instance-calling:
    type: ./child.yaml
    properties:
      vm-name = { get_param: vm-name-master }

environment.yaml
=============
parameter_defaults:
  vm-name-master: vm-envi


how even I am getting following error:

ERROR: Property error: : resources.instance-calling.properties: : Unknown Property vm-name = { get_param

Here "vm-name" is child's parameter and I am trying to pass its value from parent.

Please let me know for any solution.
edit retag flag offensive reopen merge delete

Closed for the following reason duplicate question by udayutkarsh
close date 2017-02-17 02:54:11.097098

1 answer

Sort by ยป oldest newest most voted
0

answered 2017-02-16 08:54:44 -0600

zaneb gravatar image

Don't use '=' to assign property values. It should be:

vm-name: {get_param: vm-name-master}
edit flag offensive delete link more

Get to know Ask OpenStack

Resources for moderators

Question Tools

1 follower

Stats

Asked: 2017-02-16 08:16:32 -0600

Seen: 133 times

Last updated: Feb 16 '17