1 heat_template_version: 2013-05-23
3 description: Heat template to deploy a vDNS for OpenECOMP (scaling-up scenario)
8 label: Image name or ID
9 description: Image to be used for compute instance
13 description: Type of instance (flavor) to be used
16 label: Public network name or ID
17 description: Public network that enables remote connection to VNF
20 label: vLoadBalancer private network name or ID
21 description: Private network that connects vLoadBalancer with vDNSs
24 label: ECOMP management network name or ID
25 description: Private network that connects ECOMP component and the VNF
26 ecomp_private_subnet_id:
28 label: ECOMP management sub-network name or ID
29 description: Private sub-network that connects ECOMP component and the VNF
32 label: vLoadBalancer private IP address towards the private network
33 description: Private IP address that is assigned to the vLoadBalancer to communicate with the vDNSs
36 label: vLoadBalancer private IP address towards the ECOMP management network
37 description: Private IP address that is assigned to the vLoadBalancer to communicate with ECOMP components
40 label: vDNS private IP address towards the private network
41 description: Private IP address that is assigned to the vDNS to communicate with the vLoadBalancer
44 label: vDNS private IP address towards the ECOMP management network
45 description: Private IP address that is assigned to the vDNS to communicate with ECOMP components
49 description: Name of the vDNS
53 description: The VNF ID is provided by ECOMP
56 label: vFirewall module ID
57 description: The vLoadBalancer Module ID is provided by ECOMP
61 description: Public/Private key pair name
65 description: Public key to be installed on the compute instance
69 description: URL of the repository that hosts the demo packages
73 description: URL of the repository that hosts the demo packages
74 demo_artifacts_version:
76 label: Artifacts version used in demo vnfs
77 description: Artifacts (jar, tar.gz) version used in demo vnfs
82 type: OS::Heat::RandomString
87 type: OS::Nova::KeyPair
93 base: { get_param: key_name }
94 rand: { get_resource: random-str }
95 public_key: { get_param: pub_key }
96 save_private_key: false
99 type: OS::Nova::Server
101 image: { get_param: vlb_image_name }
102 flavor: { get_param: vlb_flavor_name }
103 name: { get_param: vdns_name_0 }
104 key_name: { get_resource: my_keypair }
106 - network: { get_param: public_net_id }
107 - port: { get_resource: vdns_private_0_port }
108 - port: { get_resource: vdns_private_1_port }
109 metadata: {vnf_id: { get_param: vnf_id }, vf_module_id: { get_param: vf_module_id }}
110 user_data_format: RAW
114 __lb_oam_int__ : { get_param: vlb_private_ip_1 }
115 __lb_private_ipaddr__: { get_param: vlb_private_ip_0 }
116 __local_private_ipaddr__: { get_param: vdns_private_ip_0 }
117 __repo_url_blob__ : { get_param: repo_url_blob }
118 __repo_url_artifacts__ : { get_param: repo_url_artifacts }
119 __demo_artifacts_version__ : { get_param: demo_artifacts_version }
123 LB_OAM_INT=__lb_oam_int__
124 LB_PRIVATE_IPADDR=__lb_private_ipaddr__
125 LOCAL_PRIVATE_IPADDR=__local_private_ipaddr__
126 REPO_URL_BLOB=__repo_url_blob__
127 REPO_URL_ARTIFACTS=__repo_url_artifacts__
128 DEMO_ARTIFACTS_VERSION=__demo_artifacts_version__
130 # Download required dependencies
131 add-apt-repository -y ppa:openjdk-r/ppa
133 apt-get install -y wget openjdk-8-jdk bind9 bind9utils bind9-doc apt-transport-https ca-certificates
134 apt-get install -y maven
137 # Download vDNS demo code for DNS Server
142 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/v_dns_init.sh
143 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/vdns.sh
144 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/dnsclient.sh
145 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/set_gre_tunnel.sh
147 mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=$REPO_URL_ARTIFACTS -Dartifact=org.openecomp.demo.vnf.vlb:dns-client:$DEMO_ARTIFACTS_VERSION:jar -Dtransitive=false -Ddest=.
149 mv dns-client-$DEMO_ARTIFACTS_VERSION.jar /opt/FDclient/
150 mv dnsclient.sh /opt/FDclient/
151 mv set_gre_tunnel.sh /opt/FDclient/
153 chmod +x v_dns_init.sh
155 chmod +x /opt/FDclient/dnsclient.sh
156 chmod +x /opt/FDclient/set_gre_tunnel.sh
158 echo $LB_OAM_INT > config/lb_oam_int.txt
159 echo $LB_PRIVATE_IPADDR > config/lb_private_ipaddr.txt
160 echo $LOCAL_PRIVATE_IPADDR > config/local_private_ipaddr.txt
161 echo $DEMO_ARTIFACTS_VERSION > config/artifacts_version.txt
163 # Download Bind config files
165 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/db_dnsdemo_openecomp_org
166 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/named.conf.options
167 wget $REPO_URL_BLOB/org.openecomp.demo/vnfs/vlb/$DEMO_ARTIFACTS_VERSION/named.conf.local
171 mkdir /etc/bind/zones
172 sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
173 mv db_dnsdemo_openecomp_org /etc/bind/zones/db.dnsdemo.openecomp.org
174 mv named.conf.options /etc/bind/
175 mv named.conf.local /etc/bind/
178 # Run instantiation script
180 mv vdns.sh /etc/init.d
181 update-rc.d vdns.sh defaults
185 type: OS::Neutron::Port
187 network: { get_param: vlb_private_net_id }
188 fixed_ips: [{"subnet": { get_param: vlb_private_net_id }, "ip_address": { get_param: vdns_private_ip_0 }}]
191 type: OS::Neutron::Port
193 network: { get_param: ecomp_private_net_id }
194 fixed_ips: [{"subnet": { get_param: ecomp_private_subnet_id }, "ip_address": { get_param: vdns_private_ip_1 }}]