heat_template_version: 2013-05-23 description: This Heat template creates a new Neutron network, a router to the external network and plugs instances into this new network. All instances are located in the same L2 domain. parameters: image: type: string description: Name of image to use for servers flavor: type: string description: Flavor to use for servers external_net: type: string description: ID or name of external network # server_endpoint: # type: string # description: Server endpoint address dns_nameservers: type: comma_delimited_list description: DNS nameservers for the subnet resources: private_net: type: OS::Neutron::Net properties: name: {{ unique }}_net private_subnet: type: OS::Neutron::Subnet properties: network_id: { get_resource: private_net } cidr: 172.172.172.0/24 dns_nameservers: { get_param: dns_nameservers } router: type: OS::Neutron::Router properties: external_gateway_info: network: { get_param: external_net } router_interface: type: OS::Neutron::RouterInterface properties: router_id: { get_resource: router } subnet_id: { get_resource: private_subnet } {% for agent in agents.values() %} {{ agent.id }}: type: OS::Nova::Server properties: name: {{ agent.id }} image: { get_param: image } flavor: { get_param: flavor } availability_zone: "{{ agent.availability_zone }}" networks: - port: { get_resource: {{ agent.id }}_port } - port: { get_resource: {{ agent.id }}_mgmt_port } {{ agent.id }}_port: type: OS::Neutron::Port properties: network_id: { get_resource: private_net } fixed_ips: - subnet_id: { get_resource: private_subnet } {{ agent.id }}_mgmt_port: type: OS::Neutron::Port properties: network_id: { get_param: external_net } {% endfor %} outputs: {% for agent in agents.values() %} {{ agent.id }}_instance_name: value: { get_attr: [ {{ agent.id }}, instance_name ] } {{ agent.id }}_ip: value: { get_attr: [ {{ agent.id }}_port, fixed_ips, 0, ip_address ] } # value: { get_attr: [ {{ agent.id }}, networks, { get_attr: [private_net, name] }, 0 ] } {{ agent.id }}_pip: value: { get_attr: [ {{ agent.id }}_mgmt_port, fixed_ips, 0, ip_address ] } {{ agent.id }}_dmac: value: { get_attr: [ {{ agent.id }}_port, mac_address ] } {% endfor %}