SHARE
TWEET

Untitled

a guest Jan 21st, 2019 57 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. heat_template_version: 2016-04-08
  2.  
  3. description: >
  4.   OpenStack Sample template.
  5.   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.
  6.  
  7. parameters:
  8.   controller_instance_type:
  9.     type: string
  10.     description: Instance type for controller node
  11.     default: medium
  12.   network_instance_type:
  13.     type: string
  14.     description: Instance type for network node
  15.     default: medium
  16.   compute_instance_type:
  17.     type: string
  18.     description: Instance type for compute node
  19.     default: medium
  20.   image_id:
  21.     type: string
  22.     description: >
  23.       Name or ID of the image to use for the instance.
  24.     default: Ubuntu 16.04 LTS
  25.   key_name:
  26.     type: string
  27.     description: Name of a KeyPair to enable SSH access to the instance
  28.   network_name:
  29.     type: string
  30.     description: >
  31.       Network with Intenet connection
  32.     default: mtorres-net
  33.   subnetwork_name:
  34.     type: string
  35.     description: >
  36.       Subnet of the network with Intenet connection
  37.     default: mtorres-subnet
  38.   management_net_cidr:
  39.     type: string
  40.     description: >
  41.       Management network CIDR
  42.     default: "10.0.0.0/24"
  43.   tunnel_net_cidr:
  44.     type: string
  45.     description: >
  46.       Tunnel network CIDR
  47.     default: "10.0.1.0/24"
  48.  
  49. resources:
  50.   mamagement_net:
  51.     type: OS::Neutron::Net
  52.     properties:
  53.       name: management-net
  54.  
  55.   management_subnet:
  56.     type: OS::Neutron::Subnet
  57.     properties:
  58.       network_id: {get_resource: mamagement_net}
  59.       cidr: { get_param: management_net_cidr }
  60.       dns_nameservers: [ 150.214.156.2, 8.8.8.8 ]
  61.  
  62.   tunnel_net:
  63.     type: OS::Neutron::Net
  64.     properties:
  65.       name: tunnel-net
  66.  
  67.   tunnel_subnet:
  68.     type: OS::Neutron::Subnet
  69.     properties:
  70.       network_id: {get_resource: tunnel_net}
  71.       cidr: { get_param: tunnel_net_cidr }
  72.       dns_nameservers: [ 150.214.156.2, 8.8.8.8 ]
  73.  
  74.   external_controller_port:
  75.     type: OS::Neutron::Port
  76.     properties:
  77.       network_id: { get_param: network_name }
  78.       fixed_ips:
  79.       - subnet_id: { get_param: subnetwork_name }
  80.  
  81.   controller_floating_ip:
  82.     type: OS::Neutron::FloatingIP
  83.     properties:
  84.       floating_network_id: lowcost-net
  85.       port_id: { get_resource: external_controller_port }
  86.  
  87.   controller_management_port:
  88.     type: OS::Neutron::Port
  89.     properties:
  90.       network: { get_resource: mamagement_net }
  91.       fixed_ips:
  92.         - subnet_id: { get_resource: management_subnet }
  93.  
  94.   controller_tunnel_port:
  95.     type: OS::Neutron::Port
  96.     properties:
  97.       network: { get_resource: tunnel_net }
  98.       fixed_ips:
  99.         - subnet_id: { get_resource: tunnel_subnet }
  100.  
  101.   controller:
  102.     type: OS::Nova::Server
  103.     properties:
  104.       name: virtual-control
  105.       image: { get_param: image_id }
  106.       flavor: { get_param: controller_instance_type }
  107.       key_name: { get_param: key_name }
  108.       networks:
  109. #        - network: { get_param: network_name }
  110.         - port: { get_resource: external_controller_port }
  111.         - port: { get_resource: controller_management_port }
  112.         - port: { get_resource: controller_tunnel_port }
  113.  
  114.   external_network_port:
  115.     type: OS::Neutron::Port
  116.     properties:
  117.       network_id: mtorres-net
  118.       fixed_ips:
  119.       - subnet_id: mtorres-subnet
  120.  
  121.   network_floating_ip:
  122.     type: OS::Neutron::FloatingIP
  123.     properties:
  124.       floating_network_id: lowcost-net
  125.       port_id: { get_resource: external_network_port }
  126.  
  127.   network_management_port:
  128.     type: OS::Neutron::Port
  129.     properties:
  130.       network: { get_resource: mamagement_net }
  131.       fixed_ips:
  132.         - subnet_id: { get_resource: management_subnet }
  133.  
  134.   network_tunnel_port:
  135.     type: OS::Neutron::Port
  136.     properties:
  137.       network: { get_resource: tunnel_net }
  138.       fixed_ips:
  139.         - subnet_id: { get_resource: tunnel_subnet }
  140.  
  141.   network:
  142.     type: OS::Nova::Server
  143.     properties:
  144.       name: virtual-network
  145.       image: { get_param: image_id }
  146.       flavor: { get_param: network_instance_type }
  147.       key_name: { get_param: key_name }
  148.       networks:
  149.         # - network: { get_param: network_name }
  150.         - port: { get_resource: external_network_port }
  151.         - port: { get_resource: network_management_port }
  152.         - port: { get_resource: network_tunnel_port }
  153.  
  154.   external_compute_port:
  155.     type: OS::Neutron::Port
  156.     properties:
  157.       network_id: mtorres-net
  158.       fixed_ips:
  159.       - subnet_id: mtorres-subnet
  160.  
  161.   compute_floating_ip:
  162.     type: OS::Neutron::FloatingIP
  163.     properties:
  164.       floating_network_id: lowcost-net
  165.       port_id: { get_resource: external_compute_port }
  166.  
  167.   compute_management_port:
  168.     type: OS::Neutron::Port
  169.     properties:
  170.       network: { get_resource: mamagement_net }
  171.       fixed_ips:
  172.         - subnet_id: { get_resource: management_subnet }
  173.  
  174.   compute_tunnel_port:
  175.     type: OS::Neutron::Port
  176.     properties:
  177.       network: { get_resource: tunnel_net }
  178.       fixed_ips:
  179.         - subnet_id: { get_resource: tunnel_subnet }
  180.  
  181.   compute:
  182.     type: OS::Nova::Server
  183.     properties:
  184.       name: virtual-compute
  185.       image: { get_param: image_id }
  186.       flavor: { get_param: compute_instance_type }
  187.       key_name: { get_param: key_name }
  188.       networks:
  189.         # - network: { get_param: network_name }
  190.         - port: { get_resource: external_compute_port }
  191.         - port: { get_resource: compute_management_port }
  192.         - port: { get_resource: compute_tunnel_port }
  193.  
  194.  
  195.  
  196. outputs:
  197.   controller_instance_name:
  198.     description: Name of the instance
  199.     value: { get_attr: [controller, name] }
  200.   controller_instance_ip:
  201.     description: IP address of the instance
  202.     value: { get_attr: [controller_floating_ip, floating_ip_address] }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top