From 93465218ae4db89ff61e63a3ab62bec65828c89a Mon Sep 17 00:00:00 2001 From: Marco Platania Date: Thu, 10 Aug 2017 13:29:12 -0400 Subject: Add vCPE use case heat/install scripts Change-Id: I5ec26dc5bdfa647c15b2db88829b75ed713caf42 Signed-off-by: Marco Platania --- vnfs/vCPE/kea-sdnc-notify-mod/README.md | 4 +-- vnfs/vCPE/kea-sdnc-notify-mod/pom.xml | 2 +- vnfs/vCPE/scripts/v_dhcp_install.sh | 49 ++++++++++++++++----------------- 3 files changed, 26 insertions(+), 29 deletions(-) (limited to 'vnfs/vCPE') diff --git a/vnfs/vCPE/kea-sdnc-notify-mod/README.md b/vnfs/vCPE/kea-sdnc-notify-mod/README.md index cee91073..e596c26e 100644 --- a/vnfs/vCPE/kea-sdnc-notify-mod/README.md +++ b/vnfs/vCPE/kea-sdnc-notify-mod/README.md @@ -3,7 +3,7 @@ Kea module utilizing hooks api to notify SDNC of macaddr, yiaddr, dhcp-msg-name via HTTP POST request. -# ONAP installation of vDHCP will intall and configure on the vDHCP VM +# ONAP installation of vDHCP will install and configure on the vDHCP VM # # for local development/testing follow these steps. # @@ -47,7 +47,7 @@ apt-get install g++ libcurl4-gnutls-dev libboost-dev kea-dev ./build.sh -## Intallation in ONAP +## Installation in ONAP The vdhcp install scripts for ONAP will do the build on the vDHCP VM from these source files and copy the resulting library into /usr/local/lib and the configuration files into /etc/kea ## Testing locally diff --git a/vnfs/vCPE/kea-sdnc-notify-mod/pom.xml b/vnfs/vCPE/kea-sdnc-notify-mod/pom.xml index 737da797..f2f62792 100644 --- a/vnfs/vCPE/kea-sdnc-notify-mod/pom.xml +++ b/vnfs/vCPE/kea-sdnc-notify-mod/pom.xml @@ -33,7 +33,7 @@ 4.0.0 - org.onap.demo.vnf.vCPE + org.onap.demo.vnf.vcpe kea-sdnc-notify-mod diff --git a/vnfs/vCPE/scripts/v_dhcp_install.sh b/vnfs/vCPE/scripts/v_dhcp_install.sh index d3c73058..bf5b0981 100644 --- a/vnfs/vCPE/scripts/v_dhcp_install.sh +++ b/vnfs/vCPE/scripts/v_dhcp_install.sh @@ -25,8 +25,8 @@ then MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1) - IP=$(cat /opt/config/local_private_ipaddr.txt) - BITS=$(cat /opt/config/vdhcp_private_net_cidr.txt | cut -d"/" -f2) + IP=$(cat /opt/config/cpe_signal_ipaddr.txt) + BITS=$(cat /opt/config/cpe_signal_net_cidr.txt | cut -d"/" -f2) NETMASK=$(cdr2mask $BITS) echo "auto eth1" >> /etc/network/interfaces echo "iface eth1 inet static" >> /etc/network/interfaces @@ -34,8 +34,8 @@ then echo " netmask $NETMASK" >> /etc/network/interfaces echo " mtu $MTU" >> /etc/network/interfaces - IP=$(cat /opt/config/oam_private_ipaddr.txt) - BITS=$(cat /opt/config/onap_private_net_cidr.txt | cut -d"/" -f2) + IP=$(cat /opt/config/oam_ipaddr.txt) + BITS=$(cat /opt/config/oam_cidr.txt | cut -d"/" -f2) NETMASK=$(cdr2mask $BITS) echo "auto eth2" >> /etc/network/interfaces echo "iface eth2 inet static" >> /etc/network/interfaces @@ -53,31 +53,21 @@ apt-get update apt-get install -y wget openjdk-8-jdk apt-transport-https ca-certificates kea-dhcp4-server g++ libcurl4-gnutls-dev libboost-dev kea-dev sleep 1 -# download the kea hook +# download the kea hook cd /opt -wget $REPO_URL_ARTIFACTS/org/onap/demo/vnf/vcpe/vdhcp/$DEMO_ARTIFACTS_VERSION/kea-sdnc-notify-mod.tar.gz -tar -zxvf kea-sdnc-notify-mod.tar.gz -mv kea-sdnc-notify-mod VDHCP +wget $REPO_URL_ARTIFACTS/org/onap/demo/vnf/vcpe/$DEMO_ARTIFACTS_VERSION/kea-sdnc-notify-mod.tar.gz +tar -zxvf kea-sdnc-notify-mod.tar.gz +mv kea-sdnc-notify-mod VDHCP rm *.tar.gz cd VDHCP # build.sh takes a minute or two to run ./build.sh mv kea-sdnc-notify.so /usr/local/lib - -# Download vDHCP demo code for DHCP Server -#cd /opt - -#wget $REPO_URL_BLOB/org.onap.demo/vnfs/vCPE/$INSTALL_SCRIPT_VERSION/v_dhcp_init.sh -#wget $REPO_URL_BLOB/org.onap.demo/vnfs/vCPE/$INSTALL_SCRIPT_VERSION/vdhcp.sh - -#chmod +x v_dhcp_init.sh -#chmod +x vdhcp.sh - # Download DHCP config files -cd /opt/config -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vCPE/$INSTALL_SCRIPT_VERSION/kea-dhcp4.conf -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vCPE/$INSTALL_SCRIPT_VERSION/kea-sdnc-notify.conf +cd /opt +wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/kea-dhcp4.conf +wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/kea-sdnc-notify.conf # Configure DHCP mv kea-dhcp4.conf /etc/kea/kea-dhcp4.conf @@ -94,8 +84,15 @@ sleep 1 #rc5.d/S03kea-dhcp4-server #rc6.d/K01kea-dhcp4-server ###################################################################################### -# Run instantiation script -#cd /opt -#mv vdhcp.sh /etc/init.d -#update-rc.d vdhcp.sh defaults -#./v_dhcp_init.sh + +# Rename network interface in openstack Ubuntu 16.04 images. Then, reboot the VM to pick up changes +if [[ $CLOUD_ENV != "rackspace" ]] +then + sed -i "s/GRUB_CMDLINE_LINUX=.*/GRUB_CMDLINE_LINUX=\"net.ifnames=0 biosdevname=0\"/g" /etc/default/grub + grub-mkconfig -o /boot/grub/grub.cfg + sed -i "s/ens[0-9]*/eth0/g" /etc/network/interfaces.d/*.cfg + sed -i "s/ens[0-9]*/eth0/g" /etc/udev/rules.d/70-persistent-net.rules + echo 'network: {config: disabled}' >> /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg + echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic + reboot +fi -- cgit 1.2.3-korg