blob: 125eb583e18c0779219ac3d186ce61d0ea1a6546 [file] [log] [blame]
Jerry Floodc8bd4272017-10-19 13:43:43 -04001##########################################################################
2#
Jerry Floodc8bd4272017-10-19 13:43:43 -04003##########################################################################
4
DR695Hccff30b2017-02-17 18:44:24 -05005heat_template_version: 2013-05-23
6
Jerry Floodc8bd4272017-10-19 13:43:43 -04007description: Heat template to deploy a vDNS for ONAP (scaling-up scenario)
8
9##############
10# #
11# PARAMETERS #
12# #
13##############
DR695Hccff30b2017-02-17 18:44:24 -050014
15parameters:
16 vlb_image_name:
17 type: string
18 label: Image name or ID
19 description: Image to be used for compute instance
20 vlb_flavor_name:
21 type: string
22 label: Flavor
23 description: Type of instance (flavor) to be used
24 public_net_id:
25 type: string
26 label: Public network name or ID
27 description: Public network that enables remote connection to VNF
28 vlb_private_net_id:
29 type: string
30 label: vLoadBalancer private network name or ID
31 description: Private network that connects vLoadBalancer with vDNSs
Jerry Floodc8bd4272017-10-19 13:43:43 -040032 onap_private_net_id:
DR695Hccff30b2017-02-17 18:44:24 -050033 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040034 label: ONAP management network name or ID
35 description: Private network that connects ONAP component and the VNF
36 onap_private_subnet_id:
DR695Hccff30b2017-02-17 18:44:24 -050037 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040038 label: ONAP management sub-network name or ID
39 description: Private sub-network that connects ONAP component and the VNF
40 vlb_private_net_cidr:
41 type: string
42 label: vLoadBalancer private network CIDR
43 description: The CIDR of the vLoadBalancer private network
44 onap_private_net_cidr:
45 type: string
46 label: ONAP private network CIDR
47 description: The CIDR of the protected private network
DR695Hccff30b2017-02-17 18:44:24 -050048 vlb_private_ip_0:
49 type: string
50 label: vLoadBalancer private IP address towards the private network
51 description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs
52 vlb_private_ip_1:
53 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040054 label: vLoadBalancer private IP address towards the ONAP management network
55 description: Private IP address that is assigned to the vLoadBalancer to communicate with ONAP components
DR695Hccff30b2017-02-17 18:44:24 -050056 vdns_private_ip_0:
57 type: string
58 label: vDNS private IP address towards the private network
59 description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer
60 vdns_private_ip_1:
61 type: string
Jerry Floodc8bd4272017-10-19 13:43:43 -040062 label: vDNS private IP address towards the ONAP management network
63 description: Private IP address that is assigned to the vDNS to communicate with ONAP components
DR695Hccff30b2017-02-17 18:44:24 -050064 vdns_name_0:
65 type: string
66 label: vDNS name
67 description: Name of the vDNS
68 vnf_id:
69 type: string
70 label: VNF ID
Jerry Floodc8bd4272017-10-19 13:43:43 -040071 description: The VNF ID is provided by ONAP
DR695Hccff30b2017-02-17 18:44:24 -050072 vf_module_id:
73 type: string
74 label: vFirewall module ID
Jerry Floodc8bd4272017-10-19 13:43:43 -040075 description: The vLoadBalancer Module ID is provided by ONAP
DR695Hccff30b2017-02-17 18:44:24 -050076 key_name:
77 type: string
78 label: Key pair name
79 description: Public/Private key pair name
80 pub_key:
81 type: string
82 label: Public key
83 description: Public key to be installed on the compute instance
jf98609ab26342017-02-28 15:07:36 -050084 repo_url_blob:
DR695Hccff30b2017-02-17 18:44:24 -050085 type: string
86 label: Repository URL
87 description: URL of the repository that hosts the demo packages
jf98609ab26342017-02-28 15:07:36 -050088 repo_url_artifacts:
89 type: string
90 label: Repository URL
91 description: URL of the repository that hosts the demo packages
Jerry Floodc8bd4272017-10-19 13:43:43 -040092 install_script_version:
93 type: string
94 label: Installation script version number
95 description: Version number of the scripts that install the vFW demo app
jf98609ab26342017-02-28 15:07:36 -050096 demo_artifacts_version:
97 type: string
98 label: Artifacts version used in demo vnfs
99 description: Artifacts (jar, tar.gz) version used in demo vnfs
Jerry Floodc8bd4272017-10-19 13:43:43 -0400100 cloud_env:
101 type: string
102 label: Cloud environment
103 description: Cloud environment (e.g., openstack, rackspace)
104
105#############
106# #
107# RESOURCES #
108# #
109#############
DR695Hccff30b2017-02-17 18:44:24 -0500110
111resources:
jf98609ab26342017-02-28 15:07:36 -0500112
113 random-str:
114 type: OS::Heat::RandomString
115 properties:
116 length: 4
117
118 my_keypair:
119 type: OS::Nova::KeyPair
120 properties:
121 name:
122 str_replace:
123 template: base_rand
124 params:
125 base: { get_param: key_name }
126 rand: { get_resource: random-str }
127 public_key: { get_param: pub_key }
128 save_private_key: false
129
Jerry Floodc8bd4272017-10-19 13:43:43 -0400130 vdns_2_private_0_port:
131 type: OS::Neutron::Port
132 properties:
133 network: { get_param: vlb_private_net_id }
134 fixed_ips: [{"subnet": { get_param: vlb_private_net_id }, "ip_address": { get_param: vdns_private_ip_0 }}]
135
136 vdns_2_private_1_port:
137 type: OS::Neutron::Port
138 properties:
139 network: { get_param: onap_private_net_id }
140 fixed_ips: [{"subnet": { get_param: onap_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}]
141
142 vdns_2:
DR695Hccff30b2017-02-17 18:44:24 -0500143 type: OS::Nova::Server
144 properties:
145 image: { get_param: vlb_image_name }
146 flavor: { get_param: vlb_flavor_name }
147 name: { get_param: vdns_name_0 }
jf98609ab26342017-02-28 15:07:36 -0500148 key_name: { get_resource: my_keypair }
DR695Hccff30b2017-02-17 18:44:24 -0500149 networks:
150 - network: { get_param: public_net_id }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400151 - port: { get_resource: vdns_2_private_0_port }
152 - port: { get_resource: vdns_2_private_1_port }
DR695Hccff30b2017-02-17 18:44:24 -0500153 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
154 user_data_format: RAW
155 user_data:
156 str_replace:
157 params:
Jerry Floodc8bd4272017-10-19 13:43:43 -0400158 __lb_oam_int__: { get_param: vlb_private_ip_1 }
DR695Hccff30b2017-02-17 18:44:24 -0500159 __lb_private_ipaddr__: { get_param: vlb_private_ip_0 }
160 __local_private_ipaddr__: { get_param: vdns_private_ip_0 }
Jerry Floodc8bd4272017-10-19 13:43:43 -0400161 __oam_private_ipaddr__: { get_param: vdns_private_ip_1 }
162 __repo_url_blob__: { get_param: repo_url_blob }
163 __repo_url_artifacts__: { get_param: repo_url_artifacts }
164 __demo_artifacts_version__: { get_param: demo_artifacts_version }
165 __install_script_version__: { get_param: install_script_version }
166 __vlb_private_net_cidr__: { get_param: vlb_private_net_cidr }
167 __onap_private_net_cidr__: { get_param: onap_private_net_cidr }
168 __cloud_env__: { get_param: cloud_env }
DR695Hccff30b2017-02-17 18:44:24 -0500169 template: |
170 #!/bin/bash
171
Jerry Floodc8bd4272017-10-19 13:43:43 -0400172 # Create configuration files
Jerry Flood3fc36a32017-10-11 11:09:19 -0400173 mkdir /opt/config
Jerry Floodc8bd4272017-10-19 13:43:43 -0400174 echo "__lb_oam_int__" > /opt/config/lb_oam_int.txt
175 echo "__lb_private_ipaddr__" > /opt/config/lb_private_ipaddr.txt
176 echo "__local_private_ipaddr__" > /opt/config/local_private_ipaddr.txt
177 echo "__oam_private_ipaddr__" > /opt/config/oam_private_ipaddr.txt
178 echo "__repo_url_blob__" > /opt/config/repo_url_blob.txt
179 echo "__repo_url_artifacts__" > /opt/config/repo_url_artifacts.txt
180 echo "__demo_artifacts_version__" > /opt/config/demo_artifacts_version.txt
181 echo "__install_script_version__" > /opt/config/install_script_version.txt
182 echo "__vlb_private_net_cidr__" > /opt/config/vlb_private_net_cidr.txt
183 echo "__onap_private_net_cidr__" > /opt/config/onap_private_net_cidr.txt
184 echo "__cloud_env__" > /opt/config/cloud_env.txt
185
186 # Download and run install script
187 curl -k __repo_url_blob__/org.onap.demo/vnfs/vlb/__install_script_version__/v_dns_install.sh -o /opt/v_dns_install.sh
DR695Hccff30b2017-02-17 18:44:24 -0500188 cd /opt
Jerry Floodc8bd4272017-10-19 13:43:43 -0400189 chmod +x v_dns_install.sh
190 ./v_dns_install.sh