Added HOT Template for 2 Servers Without Floating IPs

Previously, a HOT template existed for deploying 2 servers using
an existing Neutron network and assigning Floating IPs to provide
public access.  This template does not work well when using
Neutron Provider Networking Extensions where Floating IPs are
unneeded to directly access instances. The template also creates
and associates the 2 servers to a Neutron Security Group that
allows SSH and ICMP.

Change-Id: Id827ce8fe2ea705066ca536bfe86e5a06a3fce2a
This commit is contained in:
danehans 2014-01-08 22:12:31 +00:00
parent dfad1beddf
commit 106c7a207d
1 changed files with 78 additions and 0 deletions

View File

@ -0,0 +1,78 @@
heat_template_version: 2013-05-23
description: HOT template to deploy two servers to an existing Neutron network.
parameters:
key_name:
type: string
description: Name of keypair to assign to servers
image:
type: string
description: Name of image to use for servers
flavor:
type: string
description: Flavor to use for servers
net_id:
type: string
description: ID of Neutron network into which servers get deployed
subnet_id:
type: string
description: ID of Neutron sub network into which servers get deployed
resources:
server1:
type: OS::Nova::Server
properties:
name: Server1
image: { get_param: image }
flavor: { get_param: flavor }
key_name: { get_param: key_name }
networks:
- port: { get_resource: server1_port }
server1_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: net_id }
fixed_ips:
- subnet_id: { get_param: subnet_id }
security_groups: [{ get_resource: server_security_group }]
server2:
type: OS::Nova::Server
properties:
name: Server2
image: { get_param: image }
flavor: { get_param: flavor }
key_name: { get_param: key_name }
networks:
- port: { get_resource: server2_port }
server2_port:
type: OS::Neutron::Port
properties:
network_id: { get_param: net_id }
fixed_ips:
- subnet_id: { get_param: subnet_id }
security_groups: [{ get_resource: server_security_group }]
server_security_group:
type: OS::Neutron::SecurityGroup
properties:
description: Test group to demonstrate Neutron security group functionality with Heat.
name: test-security-group
rules: [
{remote_ip_prefix: 0.0.0.0/0,
protocol: tcp,
port_range_min: 22,
port_range_max: 22},
{remote_ip_prefix: 0.0.0.0/0,
protocol: icmp}]
outputs:
server1_provider_ip:
description: IP address of server1 in provider network
value: { get_attr: [ server1, first_address ] }
server2_provider_ip:
description: IP address of server2 in provider network
value: { get_attr: [ server2, first_address ] }