Ask Your Question

yaron's profile - activity

2015-11-08 01:17:56 -0500 received badge  Popular Question (source)
2015-11-08 01:17:56 -0500 received badge  Notable Question (source)
2015-11-08 01:17:56 -0500 received badge  Famous Question (source)
2015-10-14 11:05:39 -0500 asked a question Use same resource in multiple yaml file with Heat

I made a yaml file to define 3 networks,4 servers,1 router, 1 SecurityGroup. Each server use more than one network.

When all definition are in one single file, heat stack-create complete successfully.

I want to separate to multiple file to make it:
- more easy to read
- to be able to launch only specific instances

I though doing it with one yaml file for networks, one yaml file for each server, one yaml file for security group, and one yaml that launch everything together.

I started to put the Security group in a separate file but i got error:

PhysicalResourceNotFound: The Resource (arn:openstack:heat::2a86ebdb9b3f44e28716079ca27e9ac9:stacks/Company-SecurityGroup-o6f2oz2glxgh/ec742b1a-bbef-497c-a100-a5195e1bc839) could not be found.

SecurityGroup.yaml

heat_template_version: 2014-10-16

resources:
  server_security_group:
    type: OS::Neutron::SecurityGroup
    properties:
      name: server_security_group
      rules:
        - protocol: icmp
        - protocol: tcp
          port_range_min: 22
          port_range_max: 22
        - protocol: tcp
          port_range_min: 5433
          port_range_max: 5433
        - protocol: tcp
          port_range_min: 8080
          port_range_max: 8081
        - protocol: tcp
          port_range_min: 3030
          port_range_max: 3030

Launcher.yaml

heat_template_version: 2014-10-16

parameters:
  traffic_probe_port:
   type: string
   description: Fixed ip 
   default: 10.0.1.4

resources:

  SecurityGroup:
    type: SecurityGroup.yaml


   traffic_net:
     type: OS::Neutron::Net
     properties:
       name: TrafficNetwork

  traffic_net_subnet:
    type: OS::Neutron::Subnet
    properties:
    name: TrafficSubnet
    network_id: { get_resource: traffic_net }
    cidr: 10.0.1.0/24
    gateway_ip:
      allocation_pools:
        - start: 10.0.1.3
          end: 10.0.1.20


  traffic_net_port_vprobe:
    type: OS::Neutron::Port
    properties:
       network: { get_resource: traffic_net }
       fixed_ips:
          - ip_address: { get_param: traffic_probe_port }
     security_groups:
          - { get_resource: server_security_group }

   ....all network and server definitions

My goal is to do the Launcher file like the following. Is this possible?

heat_template_version: 2014-10-16

parameters:
  traffic_probe_port:
   type: string
   description: Fixed ip 
   default: 10.0.1.4

resources:

  SecurityGroup:
    type: SecurityGroup.yaml

 Networks:
   type: Networks.yaml

  Server1:
    type: Server1.yaml

  Server2:
    type: Server2.yaml

  Server3:
    type: Server3.yaml