Change MTU size to private NICs
[demo.git] / heat / vLB / packet_gen_vlb.yaml
1 ##########################################################################
2 #
3 #==================LICENSE_START==========================================
4
5 #
6 # Copyright © 2017 AT&T Intellectual Property. All rights reserved.
7 #
8 # Licensed under the Apache License, Version 2.0 (the "License");
9 # you may not use this file except in compliance with the License.
10 # You may obtain a copy of the License at
11 #        http://www.apache.org/licenses/LICENSE-2.0
12 #
13 # Unless required by applicable law or agreed to in writing, software
14 # distributed under the License is distributed on an "AS IS" BASIS,
15 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
16 # See the License for the specific language governing permissions and
17 # limitations under the License.
18 #
19 #==================LICENSE_END============================================
20 #
21 # ECOMP is a trademark and service mark of AT&T Intellectual Property.
22 #
23 ##########################################################################
24
25 heat_template_version: 2013-05-23
26
27 description: Heat template to deploy a packet generator for the vLoadBalancer/vDNS demo app for ONAP
28
29 ##############
30 #            #
31 # PARAMETERS #
32 #            #
33 ##############
34
35 parameters:
36   public_net_id:
37     type: string
38     label: Public network name or ID
39     description: Public network that enables remote connection to VNF
40   vpg_image_name:
41     type: string
42     label: Image name or ID
43     description: Image to be used for compute instance
44   vpg_flavor_name:
45     type: string
46     label: Flavor
47     description: Type of instance (flavor) to be used
48   vpg_name_0:
49     type: string
50     label: vPacketGenerator name
51     description: Name of the vPacketGenerator
52   key_name:
53     type: string
54     label: Key pair name
55     description: Public/Private key pair name
56   pub_key:
57     type: string
58     label: Public key
59     description: Public key to be installed on the compute instance
60   repo_url_blob:
61     type: string
62     label: Repository URL
63     description: URL of the repository that hosts the demo packages
64   repo_url_artifacts:
65     type: string
66     label: Repository URL
67     description: URL of the repository that hosts the demo packages
68   vlb_ipaddr:
69     type: string
70     label: Public IP of the vLoadBalancer to which we want to send traffic
71     description: Public IP of the vLoadBalancer to which we want to send traffic
72   install_script_version:
73     type: string
74     label: Installation script version number
75     description: Version number of the scripts that install the vFW demo app
76   demo_artifacts_version:
77     type: string
78     label: Artifacts version used in demo vnfs
79     description: Artifacts (jar, tar.gz) version used in demo vnfs
80   cloud_env:
81     type: string
82     label: Cloud environment
83     description: Cloud environment (e.g., openstack, rackspace)
84
85 #############
86 #           #
87 # RESOURCES #
88 #           #
89 #############
90
91 resources:
92
93   random-str:
94     type: OS::Heat::RandomString
95     properties:
96       length: 4
97
98   my_keypair:
99     type: OS::Nova::KeyPair
100     properties:
101       name:
102         str_replace:
103           template: base_rand
104           params:
105             base: { get_param: key_name }
106             rand: { get_resource: random-str }
107       public_key: { get_param: pub_key }
108       save_private_key: false
109
110  
111   vpg_0:
112     type: OS::Nova::Server
113     properties:
114       image: { get_param: vpg_image_name }
115       flavor: { get_param: vpg_flavor_name }
116       name: { get_param: vpg_name_0 }
117       key_name: { get_resource: my_keypair }
118       networks:
119         - network: { get_param: public_net_id }
120       user_data_format: RAW
121       user_data:
122         str_replace:
123           params:
124             __repo_url_blob__ : { get_param: repo_url_blob }
125             __repo_url_artifacts__ : { get_param: repo_url_artifacts }
126             __vlb_ipaddr__: { get_param: vlb_ipaddr }
127             __demo_artifacts_version__ : { get_param: demo_artifacts_version }
128             __install_script_version__ : { get_param: install_script_version }
129             __cloud_env__: { get_param: cloud_env }
130           template: |
131             #!/bin/bash
132
133             # Create configuration files
134             mkdir /opt/config
135             echo "__vlb_ipaddr__" > /opt/config/vlb_ipaddr.txt
136             echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
137             echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
138             echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
139             echo "__install_script_version__" > /opt/config/install_script_version.txt
140             echo "__cloud_env__" > /opt/config/cloud_env.txt
141
142             # Download and run install script
143             curl -k __repo_url_blob__/org.openecomp.demo/vnfs/vlb/__install_script_version__/v_packetgen_install.sh -o /opt/v_packetgen_install.sh
144             cd /opt
145             chmod +x v_packetgen_install.sh
146             ./v_packetgen_install.sh