Skip to content

Instantly share code, notes, and snippets.

@ShawnClake
Last active November 29, 2017 18:56
Show Gist options
  • Save ShawnClake/ed9e521178cf7e5266088ca4f6ecc624 to your computer and use it in GitHub Desktop.
Save ShawnClake/ed9e521178cf7e5266088ca4f6ecc624 to your computer and use it in GitHub Desktop.
OpenStack Heat Template - 4i_2n_1v
heat_template_version: 2017-02-24
parameters:
key_name:
type: string
description: Name of a KeyPair
flavor_name:
type: string
description: Name of a Flavor
image_name:
type: string
description: Name of an Image
vnf_image_name:
type: string
description: Name of a VNF image
tenant1_cidr:
type: string
description: CIDR for Tenant 1
tenant2_cidr:
type: string
description: CIDR for Tenant 2
resources:
tenant1:
type: https://gist.githubusercontent.com/ShawnClake/85a68a78463e8282b695067f03e472cf/raw/597e093374f536b78faf156925068f9028a6acc3/openstack-heat-template-2i_1n.yaml
properties:
key_name: { get_param: key_name }
flavor_name: { get_param: flavor_name }
image_name: { get_param: image_name }
subnet_cidr: { get_param: tenant1_cidr }
tenant2:
type: https://gist.githubusercontent.com/ShawnClake/85a68a78463e8282b695067f03e472cf/raw/597e093374f536b78faf156925068f9028a6acc3/openstack-heat-template-2i_1n.yaml
properties:
key_name: { get_param: key_name }
flavor_name: { get_param: flavor_name }
image_name: { get_param: image_name }
subnet_cidr: { get_param: tenant2_cidr }
vnf-server:
type: OS::Nova::Server
properties:
key_name: { get_param: key_name }
flavor: sktel.tiny
image: { get_param: vnf_image_name }
networks:
- network: provider_network
- network: { get_attr: [tenant1, resource.internal_net] }
- network: { get_attr: [tenant2, resource.internal_net] }
security_groups:
- default
- ssh
- vnc
- ping
outputs:
internal_net:
description: inet1
value: { get_attr: [tenant1, resource.internal_net] }
internal_net2:
description: inet2
value: { get_attr: [tenant2, resource.internal_net] }
@ShawnClake
Copy link
Author

JSON Template Structure:

{
  "template": {
    "provider": {
      "vnf-1": {
        "network-a": {
          "instance-1": {},
          "instance-2": {}
        },
        "network-b": {
          "instance-3": {},
          "instance-4": {}
        }
      }
    }
  }
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment