Merge "Update portal_vm_init.sh to move logback.xml"
authorMarco Platania <platania@research.att.com>
Tue, 15 Aug 2017 17:55:23 +0000 (17:55 +0000)
committerGerrit Code Review <gerrit@onap.org>
Tue, 15 Aug 2017 17:55:23 +0000 (17:55 +0000)
17 files changed:
heat/vCPE/infra/base_vcpe_infra_rackspace.yaml
heat/vCPE/vbrgemu/base_vcpe_vbrgemu_rackspace.env
heat/vCPE/vbrgemu/base_vcpe_vbrgemu_rackspace.yaml
heat/vCPE/vgw/base_vcpe_vgw_rackspace.env
heat/vCPE/vgw/base_vcpe_vgw_rackspace.yaml
vnfs/vCPE/kea-sdnc-notify-mod/etc/kea-dhcp4.conf.example
vnfs/vCPE/scripts/kea-dhcp4.conf
vnfs/vCPE/scripts/v_aaa_install.sh
vnfs/vCPE/scripts/v_bng_install.sh
vnfs/vCPE/scripts/v_brgemu_install.sh
vnfs/vCPE/scripts/v_dhcp.sh [new file with mode: 0644]
vnfs/vCPE/scripts/v_dhcp_init.sh [new file with mode: 0644]
vnfs/vCPE/scripts/v_dhcp_install.sh
vnfs/vCPE/scripts/v_dns_install.sh
vnfs/vCPE/scripts/v_gmux_install.sh
vnfs/vCPE/scripts/v_gw_install.sh
vnfs/vCPE/scripts/v_web_install.sh

index 374669f..6b9160b 100644 (file)
@@ -454,7 +454,7 @@ resources:
             echo "__cloud_env__" > /opt/config/cloud_env.txt
 
             # Download and run install script
-            curl -k __repo_url_blob__/org.onap.demo/vnfs/vcpe/__install_script_version__/v_vweb_install.sh -o /opt/v_vweb_install.sh
+            curl -k __repo_url_blob__/org.onap.demo/vnfs/vcpe/__install_script_version__/v_web_install.sh -o /opt/v_web_install.sh
             cd /opt
-            chmod +x v_vweb_install.sh
-            ./v_vweb_install.sh
+            chmod +x v_web_install.sh
+            ./v_web_install.sh
index f512bcd..0d4d894 100644 (file)
@@ -6,6 +6,7 @@
   vbrgemu_private_net_id: zdfw1vbrgemu01_private
   vbrgemu_bng_private_net_cidr: 10.3.0.0/24
   vbrgemu_private_net_cidr: 192.168.1.0/24
+  vbrgemu_private_ip_0: 10.3.0.2
   vbrgemu_private_ip_1: 192.168.1.1\r
   vbrgemu_name_0: zdcpe11cpe01brgemu01
   vnf_id: vCPE_Infrastructure_BGREMU_demo_app
index c99da2a..6f926eb 100644 (file)
@@ -63,10 +63,14 @@ parameters:
     type: string
     label: vBRGEMU Home private network CIDR
     description: The CIDR of the input side of vBRGEMU Home private network
-  vbrgemu_private_ip_1:
+  vbrgemu_private_ip_0:
     type: string
-    label: vGW IN private IP address
+    label: vGW private IP address
     description: Private IP address towards the BRGEMU-BNG network
+  vbrgemu_private_ip_1:
+    type: string
+    label: vGW private IP address
+    description: Private IP address towards the BRGEMU private network
   vbrgemu_name_0:
     type: string
     label: vGW  name
@@ -146,11 +150,12 @@ resources:
       cidr: { get_param: vbrgemu_private_net_cidr }
 
   # Virtual BRG Emulator Instantiation
-  # 0_port should get IP address from DHCP discover through vBNG
+  # 0_port should get IP address from DHCP discover through vBNG once the VNF is running
   vbrgemu_private_0_port:
     type: OS::Neutron::Port
     properties:
       network: { get_param: vbrgemu_bng_private_net_id }
+      fixed_ips: [{"subnet": { get_param: vbrgemu_bng_private_net_id }, "ip_address": { get_param: vbrgemu_private_ip_0 }}]
 
   vbrgemu_private_1_port:
     type: OS::Neutron::Port
index 3842fc0..33da8d7 100644 (file)
@@ -11,6 +11,7 @@
   onap_private_net_cidr: 10.0.0.0/16
   vgw_private_ip_0: 10.5.0.21
   vgw_private_ip_1: 10.0.101.30
+  vgw_private_ip_2: 10.2.0.2
   vgw_name_0: zdcpe11cpe01gw01
   vnf_id: vCPE_Infrastructure_GW_demo_app
   vf_module_id: vCPE_Customer_GW
index 8fe5e59..0621556 100644 (file)
@@ -81,6 +81,10 @@ parameters:
     type: string
     label: vGW private IP address towards the ONAP management network
     description: Private IP address that is assigned to the vGW to communicate with ONAP components
+  vgw_private_ip_2:
+    type: string
+    label: vGW private IP address towards the vCPE public network
+    description: Private IP address that is assigned to the vGW to communicate with vCPE public network
   vgw_name_0:
     type: string
     label: vGW  name
@@ -174,6 +178,7 @@ resources:
     type: OS::Neutron::Port
     properties:
       network: { get_param: cpe_public_net_id}
+      fixed_ips: [{"subnet": { get_param: cpe_public_net_id }, "ip_address": { get_param: vgw_private_ip_2 }}]
 
   vgw_0:
     type: OS::Nova::Server
index b3149af..fa53f3c 100644 (file)
@@ -3,7 +3,7 @@
   {
 # For testing, you can use veth pair as described in README.md
   "interfaces-config": {
-    "interfaces": ["veth0" ]
+    "interfaces": ["eth0" ]
   },
 
 # How to load the hook library.
index b3149af..fa53f3c 100644 (file)
@@ -3,7 +3,7 @@
   {
 # For testing, you can use veth pair as described in README.md
   "interfaces-config": {
-    "interfaces": ["veth0" ]
+    "interfaces": ["eth0" ]
   },
 
 # How to load the hook library.
index 0ce24d8..a4a34ac 100644 (file)
@@ -74,5 +74,4 @@ then
        reboot
 fi
 
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./v_aaa_init.sh
\ No newline at end of file
index 516a730..dad8b2f 100644 (file)
@@ -94,5 +94,4 @@ then
        reboot
 fi
 
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./v_bng_init.sh
\ No newline at end of file
index 367009a..10976da 100644 (file)
@@ -64,5 +64,4 @@ then
        reboot
 fi
 
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./v_brgemu_init.sh
\ No newline at end of file
diff --git a/vnfs/vCPE/scripts/v_dhcp.sh b/vnfs/vCPE/scripts/v_dhcp.sh
new file mode 100644 (file)
index 0000000..7799bea
--- /dev/null
@@ -0,0 +1,98 @@
+#!/bin/sh
+### BEGIN INIT INFO
+# Provides:
+# Required-Start:    $remote_fs $syslog
+# Required-Stop:     $remote_fs $syslog
+# Default-Start:     2 3 4 5
+# Default-Stop:      0 1 6
+# Short-Description: Start daemon at boot time
+# Description:       Enable service provided by daemon.
+### END INIT INFO
+
+dir="/opt"
+cmd="./v_dhcp_init.sh"
+user="root"
+
+name=`basename $0`
+pid_file="/var/run/$name.pid"
+stdout_log="/var/log/$name.log"
+stderr_log="/var/log/$name.err"
+
+get_pid() {
+    cat "$pid_file"
+}
+
+is_running() {
+    [ -f "$pid_file" ] && ps `get_pid` > /dev/null 2>&1
+}
+
+case "$1" in
+    start)
+    if is_running; then
+        echo "Already started"
+    else
+        echo "Starting $name"
+        cd "$dir"
+        if [ -z "$user" ]; then
+            sudo $cmd >> "$stdout_log" 2>> "$stderr_log" &
+        else
+            sudo -u "$user" $cmd >> "$stdout_log" 2>> "$stderr_log" &
+        fi
+        echo $! > "$pid_file"
+        if ! is_running; then
+            echo "Unable to start, see $stdout_log and $stderr_log"
+            exit 1
+        fi
+    fi
+    ;;
+    stop)
+    if is_running; then
+        echo -n "Stopping $name.."
+        kill `get_pid`
+        for i in {1..10}
+        do
+            if ! is_running; then
+                break
+            fi
+
+            echo -n "."
+            sleep 1
+        done
+        echo
+
+        if is_running; then
+            echo "Not stopped; may still be shutting down or shutdown may have failed"
+            exit 1
+        else
+            echo "Stopped"
+            if [ -f "$pid_file" ]; then
+                rm "$pid_file"
+            fi
+        fi
+    else
+        echo "Not running"
+    fi
+    ;;
+    restart)
+    $0 stop
+    if is_running; then
+        echo "Unable to stop, will not attempt to start"
+        exit 1
+    fi
+    $0 start
+    ;;
+    status)
+    if is_running; then
+        echo "Running"
+    else
+        echo "Stopped"
+        exit 1
+    fi
+    ;;
+    *)
+    echo "Usage: $0 {start|stop|restart|status}"
+    exit 1
+    ;;
+esac
+
+exit 0
diff --git a/vnfs/vCPE/scripts/v_dhcp_init.sh b/vnfs/vCPE/scripts/v_dhcp_init.sh
new file mode 100644 (file)
index 0000000..aa32b79
--- /dev/null
@@ -0,0 +1,3 @@
+#!/bin/bash
+
+service kea-dhcp4-server start
\ No newline at end of file
index 025b198..d88ed50 100644 (file)
@@ -56,20 +56,27 @@ sleep 1
 #  download the kea hook
 cd /opt
 wget $REPO_URL_ARTIFACTS/org/onap/demo/vnf/vcpe/kea-sdnc-notify-mod/$DEMO_ARTIFACTS_VERSION/kea-sdnc-notify-mod-$DEMO_ARTIFACTS_VERSION-demo.tar.gz
-tar -zxvf kea-sdnc-notify-mod.tar.gz
-mv kea-sdnc-notify-mod VDHCP
+tar -zxvf kea-sdnc-notify-mod-$DEMO_ARTIFACTS_VERSION-demo.tar.gz
+mv kea-sdnc-notify-mod-$DEMO_ARTIFACTS_VERSION 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
+mv build/kea-sdnc-notify.so /usr/local/lib
 
 # Download DHCP config files
 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
+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/v_dhcp.sh
+chmod +x v_dhcp_init.sh
+chmod +x v_dhcp.sh
+mv v_dhcp.sh /etc/init.d
+update-rc.d v_dhcp.sh defaults
 
 # Configure DHCP
+cp kea-dhcp4.conf /etc/kea-dhcp4-server.conf
 mv kea-dhcp4.conf /etc/kea/kea-dhcp4.conf
 mv kea-sdnc-notify.conf /etc/kea/kea-sdnc-notify.conf
 sleep 1
@@ -96,3 +103,5 @@ then
        echo "APT::Periodic::Unattended-Upgrade \"0\";" >> /etc/apt/apt.conf.d/10periodic
        reboot
 fi
+
+./v_dhcp_init.sh
\ No newline at end of file
index c07b700..02ab69b 100644 (file)
@@ -74,5 +74,4 @@ then
        reboot
 fi
 
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./v_dns_init.sh
\ No newline at end of file
index b301016..b43cf7b 100644 (file)
@@ -84,5 +84,4 @@ then
        reboot
 fi
 
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./v_gmux_init.sh
\ No newline at end of file
index 856d0ec..cafb204 100644 (file)
@@ -74,5 +74,4 @@ then
        reboot
 fi
 
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./v_gw_init.sh
\ No newline at end of file
index 3e47ed2..94d3ebd 100644 (file)
@@ -74,5 +74,4 @@ then
        reboot
 fi
 
-# Run docker containers. For openstack Ubuntu 16.04 images this will run as a service after the VM has restarted
 ./v_web_init.sh
\ No newline at end of file