aboutsummaryrefslogtreecommitdiffstats
path: root/tools/os_deploy_tgen/templates/l2fip.hot
diff options
context:
space:
mode:
authorSridhar Rao <sridhar.rao@spirent.com>2020-11-25 09:10:56 +0000
committerGerrit Code Review <gerrit@opnfv.org>2020-11-25 09:10:56 +0000
commit092de71ff79b23ab05d013ceb417b4f0b48dcc55 (patch)
treea5742662468d6b44217f2aa87fb35fbb43dbbdd2 /tools/os_deploy_tgen/templates/l2fip.hot
parent104d58d57e60f3b7a2866b9b6d48a028a445a00a (diff)
parent9ec3918b56f1e8862fe140455928cdcd87a2554b (diff)
Merge "Openstack: Using VSPERF to Test on Openstack."
Diffstat (limited to 'tools/os_deploy_tgen/templates/l2fip.hot')
-rw-r--r--tools/os_deploy_tgen/templates/l2fip.hot122
1 files changed, 122 insertions, 0 deletions
diff --git a/tools/os_deploy_tgen/templates/l2fip.hot b/tools/os_deploy_tgen/templates/l2fip.hot
new file mode 100644
index 00000000..4d4b52f7
--- /dev/null
+++ b/tools/os_deploy_tgen/templates/l2fip.hot
@@ -0,0 +1,122 @@
+heat_template_version: 2013-05-23
+
+description:
+ This Heat template creates a new Neutron network, a router to the external
+ network and plugs instances into this new network. All instances are located
+ in the same L2 domain.
+
+parameters:
+ image:
+ type: string
+ description: Name of image to use for servers
+ flavor:
+ type: string
+ description: Flavor to use for servers
+ external_net:
+ type: string
+ description: ID or name of external network
+# server_endpoint:
+# type: string
+# description: Server endpoint address
+ dns_nameservers:
+ type: comma_delimited_list
+ description: DNS nameservers for the subnet
+
+resources:
+ user_config:
+ type: OS::Heat::CloudConfig
+ properties:
+ cloud_config:
+ spirent:
+ driver: "sockets"
+
+ private_net:
+ type: OS::Neutron::Net
+ properties:
+ name: {{ unique }}_net
+ port_security_enabled: false
+
+ private_subnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: private_net }
+ cidr: 172.172.172.0/24
+ dns_nameservers: { get_param: dns_nameservers }
+
+ private_datanet:
+ type: OS::Neutron::Net
+ properties:
+ name: {{ unique }}_datanet
+ port_security_enabled: false
+
+ private_datasubnet:
+ type: OS::Neutron::Subnet
+ properties:
+ network_id: { get_resource: private_datanet }
+ cidr: 172.172.168.0/24
+ dns_nameservers: { get_param: dns_nameservers }
+
+ router:
+ type: OS::Neutron::Router
+ properties:
+ external_gateway_info:
+ network: { get_param: external_net }
+
+ router_interface:
+ type: OS::Neutron::RouterInterface
+ properties:
+ router_id: { get_resource: router }
+ subnet_id: { get_resource: private_subnet }
+
+{% for agent in agents.values() %}
+
+ {{ agent.id }}:
+ type: OS::Nova::Server
+ properties:
+ name: {{ agent.id }}
+ image: { get_param: image }
+ flavor: { get_param: flavor }
+ availability_zone: "{{ agent.availability_zone }}"
+ networks:
+ - port: { get_resource: {{ agent.id }}_port }
+ - port: { get_resource: {{ agent.id }}_dataport }
+
+ {{ agent.id }}_port:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: private_net }
+ port_security_enabled: false
+ fixed_ips:
+ - subnet_id: { get_resource: private_subnet }
+
+ {{ agent.id }}_dataport:
+ type: OS::Neutron::Port
+ properties:
+ network_id: { get_resource: private_datanet }
+ port_security_enabled: false
+ fixed_ips:
+ - subnet_id: { get_resource: private_datasubnet }
+
+ {{ agent.id }}_fip_port:
+ type: OS::Neutron::FloatingIP
+ depends_on:
+ - router_interface
+ properties:
+ floating_network: { get_param: external_net }
+ port_id: { get_resource: {{ agent.id }}_port }
+
+
+{% endfor %}
+
+outputs:
+{% for agent in agents.values() %}
+ {{ agent.id }}_instance_name:
+ value: { get_attr: [ {{ agent.id }}, instance_name ] }
+ {{ agent.id }}_ip:
+ value: { get_attr: [ {{ agent.id }}_dataport, fixed_ips, 0, ip_address ] }
+ {{ agent.id }}_pip:
+ value: { get_attr: [ {{ agent.id }}_fip_port, floating_ip_address ] }
+ {{ agent.id }}_dmac:
+ value: { get_attr: [ {{ agent.id }}_dataport, mac_address ] }
+
+{% endfor %}