Revision history [back]

click to hide/show revision 1
initial version

How to display child attributes from parent yaml files?

 I have a child yaml file named child.yaml::
====================================================

heat_template_version: 2015-04-30

description: Simple template to deploy a single compute instance

parameters:
  key_name:
    type: string
  image_id:
    type: string
  flavor_id:
    type: string
  network_id:
    type: string
  vm_name:
    type: string

resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      name: { get_param: vm_name }
      key_name: { get_param: key_name }
      image: { get_param: image_id }
      flavor: { get_param: flavor_id }
      networks:
       - network: { get_param: network_id }

The parent file which looks like as under (parent.yaml )::
=====================================================

heat_template_version: 2015-04-30

description: Simple template to deploy a single compute instance

parameters:

  key_name:
    type: string
    label: Key Name
    description: Name of key-pair to be used for compute instance
    default: enm_keypair

  image_id:
    type: string
    label: Image ID
    description: Image to be used for compute instance
    default: 7fa4f3fc-4c1d-41c1-bf07-4899328878ca

  flavor_id:
    type: string
    label: Instance Type
    description: Type of instance (flavor) to be used
    default: m1.tiny

  network_id:
    type: string
    label: Instance Type
    description: Type of instance (flavor) to be used
    default: enm_internal_network_megha

  vm_name1:
    type: string
    default: vm1

  vm_name2:
    type: string
    default: vm2    

resources:
  my_instance1:
    type: ./child.yaml
    properties:
      vm_name: {get_param: vm_name1 }
      key_name: { get_param: key_name }
      image_id: { get_param: image_id }
      flavor_id: { get_param: flavor_id }
      network_id: { get_param: network_id }

 my_instance1:
     type: ./child.yaml
     properties:
        vm_name: {get_param: vm_name2 }
        key_name: { get_param: key_name }
        image_id: { get_param: image_id }
        flavor_id: { get_param: flavor_id }
        network_id: { get_param: network_id }

Now i need to create a stack from parent.yaml file (which invokes child.yaml two times in order to create two vms) to display ip addresses (or any other attributes) of both VMs (vm1 and vm2).

I have tried implementing output section in parent yaml but could not get values. Kindly help

How to display child attributes from parent yaml files?

 

I have a child yaml file named child.yaml:: ==================================================== ====================================================

heat_template_version: 2015-04-30

description: Simple template to deploy a single compute instance

parameters:
  key_name:
    type: string
  image_id:
    type: string
  flavor_id:
    type: string
  network_id:
    type: string
  vm_name:
    type: string

resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      name: { get_param: vm_name }
      key_name: { get_param: key_name }
      image: { get_param: image_id }
      flavor: { get_param: flavor_id }
      networks:
       - network: { get_param: network_id }

The parent file which looks like as under (parent.yaml )::
=====================================================

heat_template_version: 2015-04-30

description: Simple template to deploy a single compute instance

parameters:

  key_name:
    type: string
    label: Key Name
    description: Name of key-pair to be used for compute instance
    default: enm_keypair
keypair-01

  image_id:
    type: string
    label: Image ID
    description: Image to be used for compute instance
    default: 7fa4f3fc-4c1d-41c1-bf07-4899328878ca

  flavor_id:
    type: string
    label: Instance Type
    description: Type of instance (flavor) to be used
    default: m1.tiny

  network_id:
    type: string
    label: Instance Type
    description: Type of instance (flavor) to be used
    default: enm_internal_network_megha

  vm_name1:
    type: string
    default: vm1

  vm_name2:
    type: string
    default: vm2    

resources:
  my_instance1:
    type: ./child.yaml
    properties:
      vm_name: {get_param: vm_name1 }
      key_name: { get_param: key_name }
      image_id: { get_param: image_id }
      flavor_id: { get_param: flavor_id }
      network_id: { get_param: network_id }

 my_instance1:
     type: ./child.yaml
     properties:
        vm_name: {get_param: vm_name2 }
        key_name: { get_param: key_name }
        image_id: { get_param: image_id }
        flavor_id: { get_param: flavor_id }
        network_id: { get_param: network_id }

Now i need to create a stack from parent.yaml file (which invokes child.yaml two times in order to create two vms) to display ip addresses (or any other attributes) of both VMs (vm1 and vm2).

I have tried implementing output section in parent yaml but could not get values. Kindly help me writing outputs section so that I can display ip addresses of both vms.

How to display child attributes from parent yaml files?

I have a child yaml file named child.yaml:: ====================================================

heat_template_version: 2015-04-30

description: Simple template to deploy a single compute instance

parameters:
  key_name:
    type: string
  image_id:
    type: string
  flavor_id:
    type: string
  network_id:
    type: string
  vm_name:
    type: string

resources:
  my_instance:
    type: OS::Nova::Server
    properties:
      name: { get_param: vm_name }
      key_name: { get_param: key_name }
      image: { get_param: image_id }
      flavor: { get_param: flavor_id }
      networks:
       - network: { get_param: network_id }

The parent file which looks like as under (parent.yaml )::
=====================================================

heat_template_version: 2015-04-30

description: Simple template to deploy a single compute instance

parameters:

  key_name:
    type: string
    label: Key Name
    description: Name of key-pair to be used for compute instance
    default: keypair-01

  image_id:
    type: string
    label: Image ID
    description: Image to be used for compute instance
    default: 7fa4f3fc-4c1d-41c1-bf07-4899328878ca
cirros

  flavor_id:
    type: string
    label: Instance Type
    description: Type of instance (flavor) to be used
    default: m1.tiny

  network_id:
    type: string
    label: Instance Type
    description: Type of instance (flavor) to be used
    default: enm_internal_network_megha
private

  vm_name1:
    type: string
    default: vm1

  vm_name2:
    type: string
    default: vm2    

resources:
  my_instance1:
    type: ./child.yaml
    properties:
      vm_name: {get_param: vm_name1 }
      key_name: { get_param: key_name }
      image_id: { get_param: image_id }
      flavor_id: { get_param: flavor_id }
      network_id: { get_param: network_id }

 my_instance1:
     type: ./child.yaml
     properties:
        vm_name: {get_param: vm_name2 }
        key_name: { get_param: key_name }
        image_id: { get_param: image_id }
        flavor_id: { get_param: flavor_id }
        network_id: { get_param: network_id }

Now i need to create a stack from parent.yaml file (which invokes child.yaml two times in order to create two vms) to display ip addresses (or any other attributes) of both VMs (vm1 and vm2).

I have tried implementing output section in parent yaml but could not get values. Kindly help me writing outputs section so that I can display ip addresses of both vms.vms from parent.yaml.