Last active
November 10, 2016 23:25
-
-
Save allthingsclowd/4561910d2a28067c7eaf5a752df92667 to your computer and use it in GitHub Desktop.
Fujitsu K5 IaaS HOT - Linux server with global ip on existing network
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
heat_template_version: 2013-05-23 | |
# Author: Graham Land | |
# Date: 10/11/2016 | |
# Purpose: Demonstrate deployment of a Linux box with Global IP to an existing Network on K5 | |
description: > | |
HOT template to deploy a server into an existing neutron tenant network and | |
assign a floating IP addresses to the server so it is routable from the | |
public network. Fujitsu K5 OpenStack IaaS Public Cloud | |
parameters: | |
key_name: | |
type: string | |
label: Key name | |
description: Name of keypair to assign to servers "Alexa_KP""demostack" | |
default: "Alexa_KP" | |
image: | |
type: string | |
label: Image name or ID | |
description: Image to be used for compute instance | |
default: "Ubuntu Server 14.04 LTS (English) 01" | |
flavor: | |
type: string | |
label: Flavor | |
description: Type of instance (flavor) to be used | |
default: "S-1" | |
public_net_id: | |
type: string | |
label: external network ID | |
description: Public network | |
default: "d730db50-0e0c-4790-9972-1f6e2b8c4915" | |
private_net_id: | |
type: string | |
label: Private network name or ID | |
description: ID of private network into which servers get deployed | |
default: "d89a3835-046a-4c44-ad02-1b786e01176d" | |
private_subnet_id: | |
type: string | |
label: Private sub network name or ID | |
description: ID of private sub network into which servers get deployed | |
default: "9ab91700-97df-42d2-a9c2-d57adb73158c" | |
az: | |
type: string | |
label: Availability Zone | |
description: Region AZ to use | |
default: "uk-1b" | |
resources: | |
server1: | |
type: OS::Nova::Server | |
depends_on: [sys-vol] | |
properties: | |
admin_user: ubuntu | |
block_device_mapping: [{"volume_size": "3", "volume_id": {get_resource: sys-vol}, "delete_on_termination": True, "device_name": "/dev/vda"}] | |
name: "alexaVM" | |
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: | |
availability_zone: { get_param: az } | |
network_id: { get_param: private_net_id } | |
fixed_ips: | |
- subnet_id: { get_param: private_subnet_id } | |
security_groups: [{ get_resource: server_security_group }] | |
server1_floating_ip: | |
type: OS::Neutron::FloatingIP | |
depends_on: [server1_port] | |
properties: | |
availability_zone: { get_param: az } | |
floating_network_id: { get_param: public_net_id } | |
server1_floating_ip_association: | |
type: OS::Neutron::FloatingIPAssociation | |
depends_on: server1_floating_ip | |
properties: | |
floatingip_id: { get_resource: server1_floating_ip } | |
port_id: { get_resource: server1_port } | |
server_security_group: | |
type: OS::Neutron::SecurityGroup | |
properties: | |
description: Add security group rules for server | |
name: 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 | |
sys-vol: | |
type: OS::Cinder::Volume | |
depends_on: [server_security_group] | |
properties: | |
availability_zone: { get_param: az } | |
name: "boot-vol" | |
size: 3 | |
volume_type: "M1" | |
image : { get_param: image } | |
outputs: | |
server1_private_ip: | |
description: IP address of server1 in private network | |
value: { get_attr: [ server1, first_address ] } | |
server1_public_ip: | |
description: Floating IP address of server1 in public network | |
value: { get_attr: [ server1_floating_ip, floating_ip_address ] } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment