1 heat_template_version: 2015-10-15
3 description: Heat template to install ONAP components
13 # Generic parameters used across all ONAP components
16 description: Public network for floating IP address allocation
20 description: Name of the Ubuntu 14.04 image
24 description: Name of the Ubuntu 16.04 image
28 description: Name of the Small Flavor supported by the cloud provider
32 description: Name of the Medium Flavor supported by the cloud provider
36 description: Name of the Large Flavor supported by the cloud provider
40 description: Name of the Extra Large Flavor supported by the cloud provider
44 description: Base name of ONAP VMs
48 description: Public/Private key pair name
52 description: Public key to be installed on the compute instance
56 description: Complete URL for the Nexus repository.
60 description: Complete URL for the Nexus repository for docker images.
64 description: Nexus Repository username
68 description: Nexus Repository Password
72 description: Artifacts version of ONAP components
76 label: Version number of ONAP docker images
80 label: Gerrit code branch
81 description: Gerrit branch where to download the code from
85 description: DmaaP Topic name
89 description: Openstack tenant ID
93 description: Openstack username
97 description: Openstack API Key
101 description: URL of Openstack Horizon
105 description: URL of Openstack Keystone
109 type: comma_delimited_list
110 description: External DNS for OAM ONAP network
114 description: CIDR of the OAM ONAP network
118 description: A&AI IP Address
122 description: APP-C IP Address
126 description: DCAE IP Address
130 description: DNS IP Address
134 description: MSO IP Address
138 description: Message Router IP Address
142 description: Policy Engine IP Address
146 description: Portal IP Address
150 description: Robot Framework IP Address
154 description: SDC IP Address
158 description: SDN-C IP Address
162 description: VID IP Address
164 # Parameters for DCAE instantiation
167 description: DCAE Zone to use in VM names created by DCAE controller
171 description: DCAE State to use in VM names created by DCAE controller
175 description: Root URL of Nexus repository
179 description: Snapshot of Maven repository for DCAE deployment
183 description: Region where the DCAE controller will spin the VMs
187 description: Branch of the Gitlab repository
198 type: OS::Heat::RandomString
203 # Public key used to access ONAP components
205 type: OS::Nova::KeyPair
211 base: { get_param: key_name }
212 rand: { get_resource: random-str }
213 public_key: { get_param: pub_key }
214 save_private_key: false
217 # ONAP management private network
219 type: OS::Neutron::Net
223 template: oam_ecomp_rand
225 rand: { get_resource: random-str }
228 type: OS::Neutron::Subnet
232 template: oam_ecomp_rand
234 rand: { get_resource: random-str }
235 network_id: { get_resource: oam_ecomp }
236 cidr: { get_param: oam_network_cidr }
237 dns_nameservers: { get_param: external_dns }
240 type: OS::Neutron::Router
242 external_gateway_info:
243 network: { get_param: public_net_id }
246 type: OS::Neutron::RouterInterface
248 router_id: { get_resource: router }
249 subnet_id: { get_resource: oam_ecomp_subnet }
252 # DNS Server instantiation
254 type: OS::Neutron::Port
256 network: { get_resource: oam_ecomp }
257 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dns_ip_addr }}]
260 type: OS::Neutron::FloatingIP
262 floating_network_id: { get_param: public_net_id }
263 port_id: { get_resource: dns_private_port }
266 type: OS::Nova::Server
268 image: { get_param: ubuntu_1404_image }
269 flavor: { get_param: flavor_small }
272 template: base-dns-server
274 base: { get_param: vm_base_name }
275 key_name: { get_resource: vm_key }
277 - port: { get_resource: dns_private_port }
278 user_data_format: RAW
282 __nexus_repo__: { get_param: nexus_repo }
283 __artifacts_version__: { get_param: artifacts_version }
284 __oam_network_cidr__: { get_attr: [oam_ecomp_subnet, cidr] }
285 __dns_ip_addr__: { get_param: dns_ip_addr }
286 __aai_ip_addr__: { get_param: aai_ip_addr }
287 __appc_ip_addr__: { get_param: appc_ip_addr }
288 __dcae_ip_addr__: { get_param: dcae_ip_addr }
289 __mso_ip_addr__: { get_param: mso_ip_addr }
290 __mr_ip_addr__: { get_param: mr_ip_addr }
291 __policy_ip_addr__: { get_param: policy_ip_addr }
292 __portal_ip_addr__: { get_param: portal_ip_addr }
293 __robot_ip_addr__: { get_param: robot_ip_addr }
294 __sdc_ip_addr__: { get_param: sdc_ip_addr }
295 __sdnc_ip_addr__: { get_param: sdnc_ip_addr }
296 __vid_ip_addr__: { get_param: vid_ip_addr }
302 echo 127.0.0.1 $hn >> /etc/hosts
304 # Download dependencies
305 add-apt-repository -y ppa:openjdk-r/ppa
307 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk bind9 bind9utils bind9-doc ntp ntpdate
310 mkdir /etc/bind/zones
311 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/bind_zones -o /etc/bind/zones/db.simpledemo.openecomp.org
312 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/bind_options -o /etc/bind/named.conf.options
313 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/named.conf.local -o /etc/bind/named.conf.local
316 #NETMASK=$(echo "__oam_network_cidr__" | cut -d"/" -f2)
317 #if [[ $NETMASK == "8" ]]
319 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1)
320 #elif [[ $NETMASK == "16" ]]
322 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1).$(echo "__dns_ip_addr__" | cut -d"." -f2)
323 #elif [[ $NETMASK == "24" ]]
325 # ADDR=$(echo "__dns_ip_addr__" | cut -d"." -f1).$(echo "__dns_ip_addr__" | cut -d"." -f2).$(echo "__dns_ip_addr__" | cut -d"." -f3)
328 #sed -i "s/netmask/$ADDR\/$NETMASK/g" /etc/bind/named.conf.options
329 sed -i "s/dns_ip_addr/"__dns_ip_addr__"/g" /etc/bind/named.conf.options
331 A=$(echo "__dcae_ip_addr__" | cut -d"." -f1)
332 B=$(echo "__dcae_ip_addr__" | cut -d"." -f2)
333 C=$(echo "__dcae_ip_addr__" | cut -d"." -f3)
334 sed -i "s/aai_ip_addr/"__aai_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
335 sed -i "s/appc_ip_addr/"__appc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
336 sed -i "s/dcae_ip_addr/"__dcae_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
337 sed -i "s/dns_ip_addr/"__dns_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
338 sed -i "s/mso_ip_addr/"__mso_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
339 sed -i "s/mr_ip_addr/"__mr_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
340 sed -i "s/policy_ip_addr/"__policy_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
341 sed -i "s/portal_ip_addr/"__portal_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
342 sed -i "s/robot_ip_addr/"__robot_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
343 sed -i "s/sdc_ip_addr/"__sdc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
344 sed -i "s/sdnc_ip_addr/"__sdnc_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
345 sed -i "s/vid_ip_addr/"__vid_ip_addr__"/g" /etc/bind/zones/db.simpledemo.openecomp.org
346 sed -i "s/dcae_coll_ip_addr/"$A.$B.$C"/g" /etc/bind/zones/db.simpledemo.openecomp.org
349 sed -i "s/OPTIONS=.*/OPTIONS=\"-4 -u bind\"/g" /etc/default/bind9
351 # Restart bind to pick up configuration changes
352 service bind9 restart
357 type: OS::Neutron::Port
359 network: { get_resource: oam_ecomp }
360 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: aai_ip_addr }}]
363 type: OS::Neutron::FloatingIP
365 floating_network_id: { get_param: public_net_id }
366 port_id: { get_resource: aai_private_port }
369 type: OS::Nova::Server
372 image: { get_param: ubuntu_1404_image }
373 flavor: { get_param: flavor_xlarge }
378 base: { get_param: vm_base_name }
379 key_name: { get_resource: vm_key }
381 - port: { get_resource: aai_private_port }
382 user_data_format: RAW
386 __nexus_repo__: { get_param: nexus_repo }
387 __nexus_docker_repo__: { get_param: nexus_docker_repo }
388 __nexus_username__: { get_param: nexus_username }
389 __nexus_password__: { get_param: nexus_password }
390 __dmaap_topic__: { get_param: dmaap_topic }
391 __artifacts_version__: { get_param: artifacts_version }
392 __dns_ip_addr__: { get_param: dns_ip_addr }
393 __docker_version__: { get_param: docker_version }
398 echo 127.0.0.1 $hn >> /etc/hosts
400 # Create configuration files
402 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
403 echo "__nexus_username__" > /opt/config/nexus_username.txt
404 echo "__nexus_password__" > /opt/config/nexus_password.txt
405 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
406 echo "__docker_version__" > /opt/config/docker_version.txt
408 # Download dependencies
409 add-apt-repository -y ppa:openjdk-r/ppa
411 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
413 # Download scripts from Nexus
414 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
415 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_vm_init.sh -o /opt/aai_vm_init.sh
416 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/aai_serv.sh -o /opt/aai_serv.sh
417 chmod +x /opt/aai_vm_init.sh
418 chmod +x /opt/aai_serv.sh
419 mv /opt/aai_serv.sh /etc/init.d
420 update-rc.d aai_serv.sh defaults
422 # Download and install docker-engine and docker-compose
423 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
424 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
425 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
427 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
428 apt-get install -y docker-engine
432 mkdir /opt/openecomp/aai
433 mkdir /opt/openecomp/aai/logs
434 mkdir /opt/openecomp/aai/data
436 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
437 chmod +x /opt/docker/docker-compose
439 # DNS/GW IP address configuration
440 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
443 # Reboot the VM to pick up configuration changes
449 type: OS::Neutron::Port
451 network: { get_resource: oam_ecomp }
452 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mso_ip_addr }}]
455 type: OS::Neutron::FloatingIP
457 floating_network_id: { get_param: public_net_id }
458 port_id: { get_resource: mso_private_port }
461 type: OS::Nova::Server
463 image: { get_param: ubuntu_1604_image }
464 flavor: { get_param: flavor_large }
469 base: { get_param: vm_base_name }
470 key_name: { get_resource: vm_key }
472 - port: { get_resource: mso_private_port }
473 user_data_format: RAW
477 __nexus_repo__: { get_param: nexus_repo }
478 __nexus_docker_repo__: { get_param: nexus_docker_repo }
479 __nexus_username__: { get_param: nexus_username }
480 __nexus_password__: { get_param: nexus_password }
481 __openstack_username__: { get_param: openstack_username }
482 __openstack_tenant_id__: { get_param: openstack_tenant_id }
483 __openstack_api_key__: { get_param: openstack_api_key }
484 __keystone_url__: { get_param: keystone_url }
485 __dmaap_topic__: { get_param: dmaap_topic }
486 __artifacts_version__: { get_param: artifacts_version }
487 __dns_ip_addr__: { get_param: dns_ip_addr }
488 __docker_version__: { get_param: docker_version }
489 __gerrit_branch__: { get_param: gerrit_branch }
494 echo 127.0.0.1 $hn >> /etc/hosts
496 # Create configuration files
498 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
499 echo "__nexus_username__" > /opt/config/nexus_username.txt
500 echo "__nexus_password__" > /opt/config/nexus_password.txt
501 echo "__openstack_username__" > /opt/config/openstack_username.txt
502 echo "__openstack_tenant_id__" > /opt/config/tenant_id.txt
503 echo "__keystone_url__" > /opt/config/keystone.txt
504 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
505 echo "__docker_version__" > /opt/config/docker_version.txt
507 # Download dependencies
508 add-apt-repository -y ppa:openjdk-r/ppa
510 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
512 # Download scripts from Nexus
513 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
514 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_vm_init.sh -o /opt/mso_vm_init.sh
515 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mso_serv.sh -o /opt/mso_serv.sh
516 chmod +x /opt/mso_vm_init.sh
517 chmod +x /opt/mso_serv.sh
518 mv /opt/mso_serv.sh /etc/init.d
519 update-rc.d mso_serv.sh defaults
521 # Download and install docker-engine and docker-compose
522 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
523 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
524 echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
526 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
527 apt-get install -y docker-engine
531 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
532 chmod +x /opt/docker/docker-compose
534 # Clone Gerrit repository
536 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/mso/docker-config.git test_lab
537 MSO_ENCRYPTION_KEY=$(cat /opt/test_lab/encryption.key)
538 echo -n "__openstack_api_key__" | openssl aes-128-ecb -e -K $MSO_ENCRYPTION_KEY -nosalt | xxd -c 256 -p > /opt/config/api_key.txt
540 # Rename network interface
541 sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
542 grub-mkconfig -o /boot/grub/grub.cfg
543 sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
545 # DNS/GW IP address configuration
546 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
549 # Reboot the VM to pick up configuration changes
553 # Message Router instantiation
554 mrouter_private_port:
555 type: OS::Neutron::Port
557 network: { get_resource: oam_ecomp }
558 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: mr_ip_addr }}]
561 type: OS::Neutron::FloatingIP
563 floating_network_id: { get_param: public_net_id }
564 port_id: { get_resource: mrouter_private_port }
567 type: OS::Nova::Server
569 image: { get_param: ubuntu_1404_image }
570 flavor: { get_param: flavor_large }
573 template: base-message-router
575 base: { get_param: vm_base_name }
576 key_name: { get_resource: vm_key }
578 - port: { get_resource: mrouter_private_port }
579 user_data_format: RAW
583 __nexus_repo__: { get_param: nexus_repo }
584 __nexus_docker_repo__: { get_param: nexus_docker_repo }
585 __nexus_username__: { get_param: nexus_username }
586 __nexus_password__: { get_param: nexus_password }
587 __artifacts_version__: { get_param: artifacts_version }
588 __dns_ip_addr__: { get_param: dns_ip_addr }
589 __gerrit_branch__: { get_param: gerrit_branch }
594 echo 127.0.0.1 $hn >> /etc/hosts
596 # Create configuration files
598 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
599 echo "__nexus_username__" > /opt/config/nexus_username.txt
600 echo "__nexus_password__" > /opt/config/nexus_password.txt
602 # Download dependencies
603 add-apt-repository -y ppa:openjdk-r/ppa
605 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
607 # Download scripts from Nexus
608 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
609 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_vm_init.sh -o /opt/mr_vm_init.sh
610 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/mr_serv.sh -o /opt/mr_serv.sh
611 chmod +x /opt/mr_vm_init.sh
612 chmod +x /opt/mr_serv.sh
613 mv /opt/mr_serv.sh /etc/init.d
614 update-rc.d mr_serv.sh defaults
616 # Download and install docker-engine and docker-compose
617 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
618 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
619 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
621 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
622 apt-get install -y docker-engine
626 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
627 chmod +x /opt/docker/docker-compose
629 # Clone Gerrit repository
631 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/dcae/demo/startup/message-router.git dcae-startup-vm-message-router
633 # DNS/GW IP address configuration
634 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
637 # Reboot the VM to pick up configuration changes
641 # Robot Framework instantiation
643 type: OS::Neutron::Port
645 network: { get_resource: oam_ecomp }
646 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: robot_ip_addr }}]
649 type: OS::Neutron::FloatingIP
651 floating_network_id: { get_param: public_net_id }
652 port_id: { get_resource: robot_private_port }
655 type: OS::Nova::Server
657 image: { get_param: ubuntu_1604_image }
658 flavor: { get_param: flavor_small }
663 base: { get_param: vm_base_name }
664 key_name: { get_resource: vm_key }
666 - port: { get_resource: robot_private_port }
667 user_data_format: RAW
671 __nexus_repo__: { get_param: nexus_repo }
672 __nexus_docker_repo__: { get_param: nexus_docker_repo }
673 __nexus_username__: { get_param: nexus_username }
674 __nexus_password__: { get_param: nexus_password }
675 __network_name__: { get_attr: [oam_ecomp, name] }
676 __openstack_username__: { get_param: openstack_username }
677 __openstack_api_key__: { get_param : openstack_api_key }
678 __artifacts_version__: { get_param: artifacts_version }
679 __openstack_region__: { get_param: openstack_region }
680 __dns_ip_addr__: { get_param: dns_ip_addr }
681 __docker_version__: { get_param: docker_version }
682 __gerrit_branch__: { get_param: gerrit_branch }
687 echo 127.0.0.1 $hn >> /etc/hosts
689 # Create configuration files
691 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
692 echo "__nexus_repo__" > /opt/config/nexus_repo.txt
693 echo "__nexus_username__" > /opt/config/nexus_username.txt
694 echo "__nexus_password__" > /opt/config/nexus_password.txt
695 echo "__network_name__" > /opt/config/network.txt
696 echo "__openstack_username__" > /opt/config/openstack_username.txt
697 echo "__openstack_api_key__" > /opt/config/openstack_password.txt
698 echo "__openstack_region__" > /opt/config/region.txt
699 echo "__artifacts_version__" > /opt/config/artifacts_version.txt
700 echo "__docker_version__" > /opt/config/docker_version.txt
702 # Download dependencies
703 add-apt-repository -y ppa:openjdk-r/ppa
705 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
706 echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
708 # Download scripts from Nexus
709 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
710 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_vm_init.sh -o /opt/robot_vm_init.sh
711 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/robot_serv.sh -o /opt/robot_serv.sh
712 chmod +x /opt/robot_vm_init.sh
713 chmod +x /opt/robot_serv.sh
714 mv /opt/robot_serv.sh /etc/init.d
715 update-rc.d robot_serv.sh defaults
717 # Download and install docker-engine and docker-compose
718 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
719 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
720 echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
722 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
723 apt-get install -y docker-engine
727 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
728 chmod +x /opt/docker/docker-compose
730 # Execute RobotETE-specific instructions: create share folder to run as a docker volume
731 mkdir -p /opt/eteshare/logs
732 mkdir -p /opt/eteshare/config
734 # Clone Gerrit repository
736 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/testsuite/properties.git testsuite/properties
738 # Rename network interface
739 sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
740 grub-mkconfig -o /boot/grub/grub.cfg
741 sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
743 # DNS/GW IP address configuration
744 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
747 # Reboot the VM to pick up configuration changes
753 type: OS::Neutron::Port
755 network: { get_resource: oam_ecomp }
756 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: vid_ip_addr }}]
759 type: OS::Neutron::FloatingIP
761 floating_network_id: { get_param: public_net_id }
762 port_id: { get_resource: vid_private_port }
765 type: OS::Nova::Server
767 image: { get_param: ubuntu_1404_image }
768 flavor: { get_param: flavor_medium }
773 base: { get_param: vm_base_name }
774 key_name: { get_resource: vm_key }
776 - port: { get_resource: vid_private_port }
777 user_data_format: RAW
781 __nexus_repo__: { get_param: nexus_repo }
782 __nexus_docker_repo__: { get_param: nexus_docker_repo }
783 __nexus_username__: { get_param: nexus_username }
784 __nexus_password__: { get_param: nexus_password }
785 __artifacts_version__: { get_param: artifacts_version }
786 __dns_ip_addr__: { get_param: dns_ip_addr }
787 __docker_version__: { get_param: docker_version }
788 __gerrit_branch__: { get_param: gerrit_branch }
793 echo 127.0.0.1 $hn >> /etc/hosts
795 # Create configuration files
797 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
798 echo "__nexus_username__" > /opt/config/nexus_username.txt
799 echo "__nexus_password__" > /opt/config/nexus_password.txt
800 echo "__docker_version__" > /opt/config/docker_version.txt
802 # Download dependencies
803 add-apt-repository -y ppa:openjdk-r/ppa
805 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate
807 # Download scripts from Nexus
808 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
809 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_vm_init.sh -o /opt/vid_vm_init.sh
810 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/vid_serv.sh -o /opt/vid_serv.sh
811 chmod +x /opt/vid_vm_init.sh
812 chmod +x /opt/vid_serv.sh
813 mv /opt/vid_serv.sh /etc/init.d
814 update-rc.d vid_serv.sh defaults
816 # Download and install docker-engine and docker-compose
817 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
818 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
819 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
821 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
822 apt-get install -y docker-engine
826 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
827 chmod +x /opt/docker/docker-compose
829 # Clone Gerrit repository
831 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/vid.git
833 # DNS/GW IP address configuration
834 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
837 # Reboot the VM to pick up configuration changes
841 # SDN-C instantiation
843 type: OS::Neutron::Port
845 network: { get_resource: oam_ecomp }
846 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdnc_ip_addr }}]
849 type: OS::Neutron::FloatingIP
851 floating_network_id: { get_param: public_net_id }
852 port_id: { get_resource: sdnc_private_port }
855 type: OS::Nova::Server
857 image: { get_param: ubuntu_1404_image }
858 flavor: { get_param: flavor_large }
863 base: { get_param: vm_base_name }
864 key_name: { get_resource: vm_key }
866 - port: { get_resource: sdnc_private_port }
867 user_data_format: RAW
871 __nexus_repo__: { get_param: nexus_repo }
872 __nexus_docker_repo__: { get_param: nexus_docker_repo }
873 __nexus_username__: { get_param: nexus_username }
874 __nexus_password__: { get_param: nexus_password }
875 __artifacts_version__: { get_param: artifacts_version }
876 __dns_ip_addr__: { get_param: dns_ip_addr }
877 __docker_version__: { get_param: docker_version }
878 __gerrit_branch__: { get_param: gerrit_branch }
883 echo 127.0.0.1 $hn >> /etc/hosts
885 # Create configuration files
887 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
888 echo "__nexus_username__" > /opt/config/nexus_username.txt
889 echo "__nexus_password__" > /opt/config/nexus_password.txt
890 echo "__docker_version__" > /opt/config/docker_version.txt
892 # Download dependencies
893 add-apt-repository -y ppa:openjdk-r/ppa
895 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
897 # Download scripts from Nexus
898 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
899 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_vm_init.sh -o /opt/sdnc_vm_init.sh
900 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/sdnc_serv.sh -o /opt/sdnc_serv.sh
901 chmod +x /opt/sdnc_vm_init.sh
902 chmod +x /opt/sdnc_serv.sh
903 mv /opt/sdnc_serv.sh /etc/init.d
904 update-rc.d sdnc_serv.sh defaults
906 # Download and install docker-engine and docker-compose
907 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
908 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
909 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
911 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
912 apt-get install -y docker-engine
916 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
917 chmod +x /opt/docker/docker-compose
919 # Clone Gerrit repository
921 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/sdnc/oam.git sdnc
923 # DNS/GW IP address configuration
924 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
927 # Reboot the VM to pick up configuration changes
933 type: OS::Neutron::Port
935 network: { get_resource: oam_ecomp }
936 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: sdc_ip_addr }}]
939 type: OS::Neutron::FloatingIP
941 floating_network_id: { get_param: public_net_id }
942 port_id: { get_resource: sdc_private_port }
945 type: OS::Cinder::Volume
950 sdc_volume_attachment:
951 type: OS::Cinder::VolumeAttachment
953 volume_id: { get_resource: sdc_volume_data }
954 instance_uuid: { get_resource: sdc_vm }
958 type: OS::Nova::Server
960 image: { get_param: ubuntu_1604_image }
961 flavor: { get_param: flavor_xlarge }
966 base: { get_param: vm_base_name }
967 key_name: { get_resource: vm_key }
969 - port: { get_resource: sdc_private_port }
970 user_data_format: RAW
974 __nexus_repo__: { get_param: nexus_repo }
975 __nexus_docker_repo__: { get_param: nexus_docker_repo }
976 __nexus_username__: { get_param: nexus_username }
977 __nexus_password__: { get_param: nexus_password }
978 __env_name__: { get_param: dmaap_topic }
979 __artifacts_version__: { get_param: artifacts_version }
980 __dns_ip_addr__: { get_param: dns_ip_addr }
981 __mr_ip_addr__: { get_param: mr_ip_addr }
982 __public_ip__: { get_attr: [sdc_floating_ip, floating_ip_address] }
983 __docker_version__: { get_param: docker_version }
984 __gerrit_branch__: { get_param: gerrit_branch }
989 echo 127.0.0.1 $hn >> /etc/hosts
991 # Create configuration files
993 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
994 echo "__nexus_username__" > /opt/config/nexus_username.txt
995 echo "__nexus_password__" > /opt/config/nexus_password.txt
996 echo "__env_name__" > /opt/config/env_name.txt
997 echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt
998 echo "__public_ip__" > /opt/config/public_ip.txt
999 echo "__docker_version__" > /opt/config/docker_version.txt
1001 # Download dependencies
1002 add-apt-repository -y ppa:openjdk-r/ppa
1004 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
1006 # Download scripts from Nexus
1007 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1008 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_vm_init.sh -o /opt/asdc_vm_init.sh
1009 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_serv.sh -o /opt/asdc_serv.sh
1010 chmod +x /opt/asdc_vm_init.sh
1011 chmod +x /opt/asdc_serv.sh
1012 mv /opt/asdc_serv.sh /etc/init.d
1013 update-rc.d asdc_serv.sh defaults
1015 # Download and install docker-engine and docker-compose
1016 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1017 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1018 echo "deb https://apt.dockerproject.org/repo ubuntu-xenial main" | sudo tee /etc/apt/sources.list.d/docker.list
1020 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1021 apt-get install -y docker-engine
1022 service docker start
1024 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1025 chmod +x /opt/docker/docker-compose
1027 # Create partition and mount the external volume
1028 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/asdc_ext_volume_partitions.txt -o /opt/asdc_ext_volume_partitions.txt
1029 sfdisk /dev/vdb < /opt/asdc_ext_volume_partitions.txt
1030 mkfs -t ext4 /dev/vdb1
1032 mount /dev/vdb1 /data
1033 echo "/dev/vdb1 /data ext4 errors=remount-ro,noatime,barrier=0 0 1" >> /etc/fstab
1035 # Run SDC-specific instructions
1037 mkdir -p /data/environments
1038 mkdir -p /data/scripts
1039 mkdir -p /data/logs/BE
1040 mkdir -p /data/logs/FE
1042 chmod 777 /data/logs/BE
1043 chmod 777 /data/logs/FE
1045 # Clone Gerrit repository
1046 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/sdc.git
1048 cat > /root/.bash_aliases << EOF
1049 alias dcls='/data/scripts/docker_clean.sh \$1'
1050 alias dlog='/data/scripts/docker_login.sh \$1'
1051 alias rund='/data/scripts/docker_run.sh'
1052 alias health='/data/scripts/docker_health.sh'
1055 # Rename network interface
1056 sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub
1057 grub-mkconfig -o /boot/grub/grub.cfg
1058 sed -i "s/ens3/eth0/g" /etc/network/interfaces.d/*.cfg
1060 # DNS/GW IP address configuration
1061 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1064 # Reboot the VM to pick up configuration changes
1068 # PORTAL instantiation
1069 portal_private_port:
1070 type: OS::Neutron::Port
1072 network: { get_resource: oam_ecomp }
1073 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: portal_ip_addr }}]
1076 type: OS::Neutron::FloatingIP
1078 floating_network_id: { get_param: public_net_id }
1079 port_id: { get_resource: portal_private_port }
1082 type: OS::Nova::Server
1084 image: { get_param: ubuntu_1404_image }
1085 flavor: { get_param: flavor_large }
1088 template: base-portal
1090 base: { get_param: vm_base_name }
1091 key_name: { get_resource: vm_key }
1093 - port: { get_resource: portal_private_port }
1094 user_data_format: RAW
1098 __nexus_repo__: { get_param: nexus_repo }
1099 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1100 __nexus_username__: { get_param: nexus_username }
1101 __nexus_password__: { get_param: nexus_password }
1102 __artifacts_version__: { get_param: artifacts_version }
1103 __dns_ip_addr__: { get_param: dns_ip_addr }
1104 __public_ip__: { get_attr: [portal_floating_ip, floating_ip_address] }
1105 __docker_version__: { get_param: docker_version }
1106 __gerrit_branch__: { get_param: gerrit_branch }
1111 echo 127.0.0.1 $hn >> /etc/hosts
1113 # Create configuration files
1114 mkdir -p /opt/config
1115 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1116 echo "__nexus_username__" > /opt/config/nexus_username.txt
1117 echo "__nexus_password__" > /opt/config/nexus_password.txt
1118 echo "__public_ip__" > /opt/config/public_ip.txt
1119 echo "__docker_version__" > /opt/config/docker_version.txt
1121 # Download dependencies
1122 add-apt-repository -y ppa:openjdk-r/ppa
1124 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git unzip mysql-client-core-5.6 ntp ntpdate
1126 # Download scripts from Nexus
1127 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1128 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_vm_init.sh -o /opt/portal_vm_init.sh
1129 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/portal_serv.sh -o /opt/portal_serv.sh
1130 chmod +x /opt/portal_vm_init.sh
1131 chmod +x /opt/portal_serv.sh
1132 mv /opt/portal_serv.sh /etc/init.d
1133 update-rc.d portal_serv.sh defaults
1135 # Download and install docker-engine and docker-compose
1136 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1137 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1138 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1140 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1141 apt-get install -y docker-engine
1142 service docker start
1144 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1145 chmod +x /opt/docker/docker-compose
1147 # Clone Gerrit repository
1148 mkdir -p /PROJECT/OpenSource/UbuntuEP/logs
1150 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/portal.git
1152 # DNS/GW IP address configuration
1153 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1156 # Reboot the VM to pick up configuration changes
1160 # DCAE Controller instantiation
1161 dcae_c_private_port:
1162 type: OS::Neutron::Port
1164 network: { get_resource: oam_ecomp }
1165 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: dcae_ip_addr }}]
1168 type: OS::Neutron::FloatingIP
1170 floating_network_id: { get_param: public_net_id }
1171 port_id: { get_resource: dcae_c_private_port }
1174 type: OS::Nova::Server
1176 image: { get_param: ubuntu_1404_image }
1177 flavor: { get_param: flavor_medium }
1180 template: base-dcae-controller
1182 base: { get_param: vm_base_name }
1183 key_name: { get_resource: vm_key }
1185 - port: { get_resource: dcae_c_private_port }
1186 user_data_format: RAW
1190 __nexus_repo__: { get_param: nexus_repo }
1191 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1192 __nexus_username__: { get_param: nexus_username }
1193 __nexus_password__: { get_param: nexus_password }
1194 __nexus_url_snapshots__: { get_param: nexus_url_snapshot }
1195 __gitlab_branch__: { get_param: gitlab_branch }
1196 __dns_ip_addr__: { get_param: dns_ip_addr }
1197 __dcae_zone__: { get_param: dcae_zone }
1198 __dcae_state__: { get_param: dcae_state }
1199 __artifacts_version__: { get_param: artifacts_version }
1200 __tenant_id__: { get_param: openstack_tenant_id }
1201 __openstack_private_network_name__: { get_attr: [oam_ecomp, name] }
1202 __openstack_user__: { get_param: openstack_username }
1203 __openstack_password__: { get_param: openstack_api_key }
1204 __key_name__: { get_param: key_name }
1205 __rand_str__: { get_resource: random-str }
1206 __pub_key__: { get_param: pub_key }
1207 __nexus_repo_root__: { get_param: nexus_repo_root }
1208 __openstack_region__: { get_param: openstack_region }
1209 __horizon_url__ : { get_param: horizon_url }
1210 __keystone_url__ : { get_param: keystone_url }
1211 __docker_version__: { get_param: docker_version }
1212 __gerrit_branch__: { get_param: gerrit_branch }
1217 echo 127.0.0.1 $hn >> /etc/hosts
1219 # Create configuration files
1220 mkdir -p /opt/config
1221 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1222 echo "__nexus_username__" > /opt/config/nexus_username.txt
1223 echo "__nexus_password__" > /opt/config/nexus_password.txt
1224 echo "__gitlab_branch__" > /opt/config/gitlab_branch.txt
1225 echo "__docker_version__" > /opt/config/docker_version.txt
1227 # Download dependencies
1228 add-apt-repository -y ppa:openjdk-r/ppa
1230 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk make git ntp ntpdate
1232 # Download scripts from Nexus
1233 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1234 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_vm_init.sh -o /opt/dcae_vm_init.sh
1235 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/dcae_serv.sh -o /opt/dcae_serv.sh
1236 chmod +x /opt/dcae_vm_init.sh
1237 chmod +x /opt/dcae_serv.sh
1238 mv /opt/dcae_serv.sh /etc/init.d
1239 update-rc.d dcae_serv.sh defaults
1241 # Download and install docker-engine and docker-compose
1242 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1243 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1244 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1246 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1247 apt-get install -y docker-engine
1248 service docker start
1250 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1251 chmod +x /opt/docker/docker-compose
1253 # Clone Gerrit repository
1255 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/dcae/demo/startup/controller.git dcae-startup-vm-controller
1257 # DCAE Controller specific deployment
1258 cd /opt/dcae-startup-vm-controller
1259 mkdir -p /opt/app/dcae-controller
1260 cat > /opt/app/dcae-controller/config.yaml << EOF_CONFIG
1262 STATE: __dcae_state__
1263 DCAE-VERSION: __artifacts_version__
1264 HORIZON-URL: __horizon_url__/__openstack_user__
1265 KEYSTONE-URL: __keystone_url__
1266 OPENSTACK-TENANT-ID: __tenant_id__
1267 OPENSTACK-TENANT-NAME: OPEN-ECOMP
1268 OPENSTACK-REGION: __openstack_region__
1269 OPENSTACK-PRIVATE-NETWORK: __openstack_private_network_name__
1270 OPENSTACK-USER: __openstack_user__
1271 OPENSTACK-PASSWORD: __openstack_password__
1272 OPENSTACK-KEYNAME: __key_name_____rand_str___dcae
1273 OPENSTACK-PUBKEY: __pub_key__
1275 NEXUS-URL-ROOT: __nexus_repo_root__
1276 NEXUS-USER: __nexus_username__
1277 NEXUS-PASSWORD: __nexus_password__
1278 NEXUS-URL-SNAPSHOTS: __nexus_url_snapshots__
1279 NEXUS-RAWURL: __nexus_repo__
1281 DOCKER-REGISTRY: __nexus_docker_repo__
1283 GIT-MR-REPO: http://gerrit.onap.org/r/dcae/demo/startup/message-router.git
1286 # DNS/GW IP address configuration
1287 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1290 # Reboot the VM to pick up configuration changes
1294 # Policy Engine instantiation
1295 policy_private_port:
1296 type: OS::Neutron::Port
1298 network: { get_resource: oam_ecomp }
1299 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: policy_ip_addr }}]
1302 type: OS::Neutron::FloatingIP
1304 floating_network_id: { get_param: public_net_id }
1305 port_id: { get_resource: policy_private_port }
1308 type: OS::Nova::Server
1310 image: { get_param: ubuntu_1404_image }
1311 flavor: { get_param: flavor_xlarge }
1314 template: base-policy
1316 base: { get_param: vm_base_name }
1317 key_name: { get_resource: vm_key }
1319 - port: { get_resource: policy_private_port }
1320 user_data_format: RAW
1324 __nexus_repo__: { get_param: nexus_repo }
1325 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1326 __nexus_username__: { get_param: nexus_username }
1327 __nexus_password__: { get_param: nexus_password }
1328 __artifacts_version__: { get_param: artifacts_version }
1329 __dns_ip_addr__: { get_param: dns_ip_addr }
1330 __public_ip__: { get_attr: [policy_floating_ip, floating_ip_address] }
1331 __docker_version__: { get_param: docker_version }
1332 __gerrit_branch__: { get_param: gerrit_branch }
1337 echo 127.0.0.1 $hn >> /etc/hosts
1339 # Create configuration files
1340 mkdir -p /opt/config
1341 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1342 echo "__nexus_username__" > /opt/config/nexus_username.txt
1343 echo "__nexus_password__" > /opt/config/nexus_password.txt
1344 echo "__public_ip__" > /opt/config/public_ip.txt
1345 echo "__docker_version__" > /opt/config/docker_version.txt
1347 # Download dependencies
1348 add-apt-repository -y ppa:openjdk-r/ppa
1350 apt-get install -y apt-transport-https ca-certificates wget openjdk-8-jdk git ntp ntpdate
1352 # Download scripts from Nexus
1353 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1354 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_vm_init.sh -o /opt/policy_vm_init.sh
1355 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/policy_serv.sh -o /opt/policy_serv.sh
1356 chmod +x /opt/policy_vm_init.sh
1357 chmod +x /opt/policy_serv.sh
1358 mv /opt/policy_serv.sh /etc/init.d
1359 update-rc.d policy_serv.sh defaults
1361 # Download and install docker-engine and docker-compose
1362 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1363 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1364 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1366 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1367 apt-get install -y docker-engine
1368 service docker start
1370 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1371 chmod +x /opt/docker/docker-compose
1373 # Clone Gerrit repository
1375 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/policy/docker.git policy
1377 # DNS/GW IP address configuration
1378 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1381 # Reboot the VM to pick up configuration changes
1385 # APP-C instantiation
1387 type: OS::Neutron::Port
1389 network: { get_resource: oam_ecomp }
1390 fixed_ips: [{"subnet": { get_resource: oam_ecomp_subnet }, "ip_address": { get_param: appc_ip_addr }}]
1393 type: OS::Neutron::FloatingIP
1395 floating_network_id: { get_param: public_net_id }
1396 port_id: { get_resource: appc_private_port }
1399 type: OS::Nova::Server
1401 image: { get_param: ubuntu_1404_image }
1402 flavor: { get_param: flavor_large }
1407 base: { get_param: vm_base_name }
1408 key_name: { get_resource: vm_key }
1410 - port: { get_resource: appc_private_port }
1411 user_data_format: RAW
1415 __nexus_repo__: { get_param: nexus_repo }
1416 __nexus_docker_repo__: { get_param: nexus_docker_repo }
1417 __nexus_username__: { get_param: nexus_username }
1418 __nexus_password__: { get_param: nexus_password }
1419 __dmaap_topic__: { get_param: dmaap_topic }
1420 __artifacts_version__: { get_param: artifacts_version }
1421 __dns_ip_addr__: { get_param: dns_ip_addr }
1422 __docker_version__: { get_param: docker_version }
1423 __gerrit_branch__: { get_param: gerrit_branch }
1428 echo 127.0.0.1 $hn >> /etc/hosts
1430 # Create configuration files
1431 mkdir -p /opt/config
1432 echo "__nexus_docker_repo__" > /opt/config/nexus_docker_repo.txt
1433 echo "__nexus_username__" > /opt/config/nexus_username.txt
1434 echo "__nexus_password__" > /opt/config/nexus_password.txt
1435 echo "__dmaap_topic__" > /opt/config/dmaap_topic.txt
1436 echo "__docker_version__" > /opt/config/docker_version.txt
1438 # Download dependencies
1439 add-apt-repository -y ppa:openjdk-r/ppa
1441 apt-get install -y apt-transport-https ca-certificates wget openjdk-7-jdk git ntp ntpdate
1443 # Download scripts from Nexus
1444 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/docker_key.txt -o /opt/config/docker_key.txt
1445 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_vm_init.sh -o /opt/appc_vm_init.sh
1446 curl -k __nexus_repo__/org.openecomp.demo/boot/__artifacts_version__/appc_serv.sh -o /opt/appc_serv.sh
1447 chmod +x /opt/appc_vm_init.sh
1448 chmod +x /opt/appc_serv.sh
1449 mv /opt/appc_serv.sh /etc/init.d
1450 update-rc.d appc_serv.sh defaults
1452 # Download and install docker-engine and docker-compose
1453 DOCKER_KEY=$(cat /opt/config/docker_key.txt)
1454 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-keys $DOCKER_KEY
1455 echo "deb https://apt.dockerproject.org/repo ubuntu-trusty main" | sudo tee /etc/apt/sources.list.d/docker.list
1457 apt-get install -y linux-image-extra-$(uname -r) linux-image-extra-virtual
1458 apt-get install -y docker-engine
1459 service docker start
1462 curl -L https://github.com/docker/compose/releases/download/1.9.0/docker-compose-`uname -s`-`uname -m` > /opt/docker/docker-compose
1463 chmod +x /opt/docker/docker-compose
1465 # Clone Gerrit repository
1467 git clone -b __gerrit_branch__ --single-branch http://gerrit.onap.org/r/appc/deployment.git appc
1469 # DNS/GW IP address configuration
1470 echo "nameserver __dns_ip_addr__" >> /etc/resolvconf/resolv.conf.d/head
1473 # Reboot the VM to pick up configuration changes