Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- heat_template_version: 2016-04-08
- description: >
- OpenStack Sample template.
- This template creates virtual infrastructure for OpenStack instances. The basic infrastructure constists of two networks (management-net and tunnel-net) and three nodes: controller, networks and one compute node.
- parameters:
- controller_instance_type:
- type: string
- description: Instance type for controller node
- default: medium
- network_instance_type:
- type: string
- description: Instance type for network node
- default: medium
- compute_instance_type:
- type: string
- description: Instance type for compute node
- default: medium
- image_id:
- type: string
- description: >
- Name or ID of the image to use for the instance.
- default: Ubuntu 16.04 LTS
- key_name:
- type: string
- description: Name of a KeyPair to enable SSH access to the instance
- network_name:
- type: string
- description: >
- Network with Intenet connection
- default: mtorres-net
- subnetwork_name:
- type: string
- description: >
- Subnet of the network with Intenet connection
- default: mtorres-subnet
- management_net_cidr:
- type: string
- description: >
- Management network CIDR
- default: "10.0.0.0/24"
- tunnel_net_cidr:
- type: string
- description: >
- Tunnel network CIDR
- default: "10.0.1.0/24"
- resources:
- mamagement_net:
- type: OS::Neutron::Net
- properties:
- name: management-net
- management_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: {get_resource: mamagement_net}
- cidr: { get_param: management_net_cidr }
- dns_nameservers: [ 150.214.156.2, 8.8.8.8 ]
- tunnel_net:
- type: OS::Neutron::Net
- properties:
- name: tunnel-net
- tunnel_subnet:
- type: OS::Neutron::Subnet
- properties:
- network_id: {get_resource: tunnel_net}
- cidr: { get_param: tunnel_net_cidr }
- dns_nameservers: [ 150.214.156.2, 8.8.8.8 ]
- external_controller_port:
- type: OS::Neutron::Port
- properties:
- network_id: { get_param: network_name }
- fixed_ips:
- - subnet_id: { get_param: subnetwork_name }
- controller_floating_ip:
- type: OS::Neutron::FloatingIP
- properties:
- floating_network_id: lowcost-net
- port_id: { get_resource: external_controller_port }
- controller_management_port:
- type: OS::Neutron::Port
- properties:
- network: { get_resource: mamagement_net }
- fixed_ips:
- - subnet_id: { get_resource: management_subnet }
- controller_tunnel_port:
- type: OS::Neutron::Port
- properties:
- network: { get_resource: tunnel_net }
- fixed_ips:
- - subnet_id: { get_resource: tunnel_subnet }
- controller:
- type: OS::Nova::Server
- properties:
- name: virtual-control
- image: { get_param: image_id }
- flavor: { get_param: controller_instance_type }
- key_name: { get_param: key_name }
- networks:
- # - network: { get_param: network_name }
- - port: { get_resource: external_controller_port }
- - port: { get_resource: controller_management_port }
- - port: { get_resource: controller_tunnel_port }
- external_network_port:
- type: OS::Neutron::Port
- properties:
- network_id: mtorres-net
- fixed_ips:
- - subnet_id: mtorres-subnet
- network_floating_ip:
- type: OS::Neutron::FloatingIP
- properties:
- floating_network_id: lowcost-net
- port_id: { get_resource: external_network_port }
- network_management_port:
- type: OS::Neutron::Port
- properties:
- network: { get_resource: mamagement_net }
- fixed_ips:
- - subnet_id: { get_resource: management_subnet }
- network_tunnel_port:
- type: OS::Neutron::Port
- properties:
- network: { get_resource: tunnel_net }
- fixed_ips:
- - subnet_id: { get_resource: tunnel_subnet }
- network:
- type: OS::Nova::Server
- properties:
- name: virtual-network
- image: { get_param: image_id }
- flavor: { get_param: network_instance_type }
- key_name: { get_param: key_name }
- networks:
- # - network: { get_param: network_name }
- - port: { get_resource: external_network_port }
- - port: { get_resource: network_management_port }
- - port: { get_resource: network_tunnel_port }
- external_compute_port:
- type: OS::Neutron::Port
- properties:
- network_id: mtorres-net
- fixed_ips:
- - subnet_id: mtorres-subnet
- compute_floating_ip:
- type: OS::Neutron::FloatingIP
- properties:
- floating_network_id: lowcost-net
- port_id: { get_resource: external_compute_port }
- compute_management_port:
- type: OS::Neutron::Port
- properties:
- network: { get_resource: mamagement_net }
- fixed_ips:
- - subnet_id: { get_resource: management_subnet }
- compute_tunnel_port:
- type: OS::Neutron::Port
- properties:
- network: { get_resource: tunnel_net }
- fixed_ips:
- - subnet_id: { get_resource: tunnel_subnet }
- compute:
- type: OS::Nova::Server
- properties:
- name: virtual-compute
- image: { get_param: image_id }
- flavor: { get_param: compute_instance_type }
- key_name: { get_param: key_name }
- networks:
- # - network: { get_param: network_name }
- - port: { get_resource: external_compute_port }
- - port: { get_resource: compute_management_port }
- - port: { get_resource: compute_tunnel_port }
- outputs:
- controller_instance_name:
- description: Name of the instance
- value: { get_attr: [controller, name] }
- controller_instance_ip:
- description: IP address of the instance
- value: { get_attr: [controller_floating_ip, floating_ip_address] }
Add Comment
Please, Sign In to add comment