diff options
-rw-r--r-- | boot/sdc_vm_init.sh | 8 | ||||
-rwxr-xr-x | boot/uui_vm_init.sh | 4 | ||||
-rw-r--r-- | heat/ONAP/onap_openstack.yaml | 4 | ||||
-rw-r--r-- | vnfs/vCPE/scripts/v_brgemu_init.sh | 4 | ||||
-rwxr-xr-x | vnfs/vCPE/scripts/v_brgemu_install.sh | 30 | ||||
-rwxr-xr-x | vnfs/vLB/scripts/run_streams_dns.sh | 50 | ||||
-rw-r--r-- | vnfs/vLB/scripts/v_packetgen_install.sh | 5 |
7 files changed, 81 insertions, 24 deletions
diff --git a/boot/sdc_vm_init.sh b/boot/sdc_vm_init.sh index 42be1ffa..9626a2ee 100644 --- a/boot/sdc_vm_init.sh +++ b/boot/sdc_vm_init.sh @@ -3,7 +3,6 @@ NEXUS_USERNAME=$(cat /opt/config/nexus_username.txt) NEXUS_PASSWD=$(cat /opt/config/nexus_password.txt) NEXUS_DOCKER_REPO=$(cat /opt/config/nexus_docker_repo.txt) -NEXUS_DOCKER_PORT=$(echo $NEXUS_DOCKER_REPO | cut -d':' -f2) ENV_NAME=$(cat /opt/config/env_name.txt) MR_IP_ADDR=$(cat /opt/config/mr_ip_addr.txt) RELEASE=$(cat /opt/config/docker_version.txt) @@ -18,12 +17,7 @@ cp sdc/sdc-os-chef/scripts/docker_health.sh /data/scripts chmod +x /data/scripts/docker_run.sh chmod +x /data/scripts/docker_health.sh -if [ -e /opt/config/public_ip.txt ] -then - IP_ADDRESS=$(cat /opt/config/public_ip.txt) -else - IP_ADDRESS=$(ifconfig eth0 | grep "inet addr" | tr -s ' ' | cut -d' ' -f3 | cut -d':' -f2) -fi +IP_ADDRESS=$(cat /opt/config/private_ip.txt) cat /data/environments/Template.json | sed "s/yyy/"$IP_ADDRESS"/g" > /data/environments/$ENV_NAME.json sed -i "s/xxx/"$ENV_NAME"/g" /data/environments/$ENV_NAME.json diff --git a/boot/uui_vm_init.sh b/boot/uui_vm_init.sh index cc2a1d83..01cee5f5 100755 --- a/boot/uui_vm_init.sh +++ b/boot/uui_vm_init.sh @@ -17,5 +17,5 @@ docker rm -f uui_ui docker rm -f uui_server # Insert docker run instructions here -docker run -i -t -d --name uui_ui -p 8080:8080 -e MSB_ADDR=$OPENO_IP:80 -e MR_ADDR=$MR_IP:3904 $NEXUS_DOCKER_REPO/onap/usecase-ui:$DOCKER_IMAGE_VERSION -docker run -i -t -d --name uui_server -p 8082:8082 -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/usecase-ui/usecase-ui-server:$DOCKER_IMAGE_VERSION
\ No newline at end of file +docker run -i -t -d --name uui_ui -p 8080:8080 -e MSB_ADDR=$OPENO_IP:80 $NEXUS_DOCKER_REPO/onap/usecase-ui:$DOCKER_IMAGE_VERSION +docker run -i -t -d --name uui_server -p 8082:8082 -e MSB_ADDR=$OPENO_IP:80 -e MR_ADDR=$MR_IP:3904 $NEXUS_DOCKER_REPO/onap/usecase-ui/usecase-ui-server:$DOCKER_IMAGE_VERSION
\ No newline at end of file diff --git a/heat/ONAP/onap_openstack.yaml b/heat/ONAP/onap_openstack.yaml index 3201e7b9..e916b5dd 100644 --- a/heat/ONAP/onap_openstack.yaml +++ b/heat/ONAP/onap_openstack.yaml @@ -1126,7 +1126,7 @@ resources: __artifacts_version__: { get_param: artifacts_version } __dns_ip_addr__: { get_param: dns_ip_addr } __mr_ip_addr__: { get_param: mr_ip_addr } - __public_ip__: { get_attr: [sdc_floating_ip, floating_ip_address] } + __private_ip__: { get_param: sdc_ip_addr } __docker_version__: { get_param: sdc_docker } __gerrit_branch__: { get_param: sdc_branch } __cloud_env__: { get_param: cloud_env } @@ -1143,7 +1143,7 @@ resources: echo "__nexus_password__" > /opt/config/nexus_password.txt echo "__env_name__" > /opt/config/env_name.txt echo "__mr_ip_addr__" > /opt/config/mr_ip_addr.txt - echo "__public_ip__" > /opt/config/public_ip.txt + echo "__private_ip__" > /opt/config/private_ip.txt echo "__artifacts_version__" > /opt/config/artifacts_version.txt echo "__dns_ip_addr__" > /opt/config/dns_ip_addr.txt echo "__docker_version__" > /opt/config/docker_version.txt diff --git a/vnfs/vCPE/scripts/v_brgemu_init.sh b/vnfs/vCPE/scripts/v_brgemu_init.sh index fdeb4395..e9697992 100644 --- a/vnfs/vCPE/scripts/v_brgemu_init.sh +++ b/vnfs/vCPE/scripts/v_brgemu_init.sh @@ -2,6 +2,4 @@ systemctl start vpp systemctl start honeycomb - -/opt/bind_nic.sh -/opt/set_nat.sh +systemctl start nat diff --git a/vnfs/vCPE/scripts/v_brgemu_install.sh b/vnfs/vCPE/scripts/v_brgemu_install.sh index 0f2b06f5..f8824f97 100755 --- a/vnfs/vCPE/scripts/v_brgemu_install.sh +++ b/vnfs/vCPE/scripts/v_brgemu_install.sh @@ -197,7 +197,6 @@ EOF NICS=$(get_nic_pci_list) NICS=`echo ${NICS} | sed 's/[0]\+\([0-9]\)/\1/g' | sed 's/[.:]/\//g'` - echo $NICS BRG_BNG_NIC=GigabitEthernet`echo ${NICS} | cut -d " " -f 2` # second interface in list echo $BRG_BNG_NIC > /opt/config/brg_nic.txt @@ -330,6 +329,17 @@ EOF chmod +x /opt/set_nat.sh fi # endif BUILD_STATE != "build" +#Create script to run bind_nic.sh and set_nat.sh + cat > /opt/nat_service.sh << 'EOF' +#! /bin/bash + +sleep 15 +/opt/bind_nic.sh +/opt/set_nat.sh + +EOF + chmod +x /opt/nat_service.sh + if [[ $BUILD_STATE != "done" ]] then @@ -484,6 +494,24 @@ WantedBy=multi-user.target EOF systemctl enable /etc/systemd/system/honeycomb.service + + # Create systemctl service for nat script + cat > /etc/systemd/system/nat.service << EOF +[Unit] +Description=Runs vbrg scripts for nat configuration +Requires=vpp.service +After=vpp.service + +[Service] +RemainAfterExit=True +ExecStart=/opt/nat_service.sh +Restart=always + +[Install] +WantedBy=multi-user.target +EOF + systemctl enable /etc/systemd/system/nat.service + # Download DHCP config files cd /opt wget $REPO_URL_BLOB/org.onap.demo/vnfs/vcpe/$INSTALL_SCRIPT_VERSION/v_brgemu_init.sh diff --git a/vnfs/vLB/scripts/run_streams_dns.sh b/vnfs/vLB/scripts/run_streams_dns.sh index cf95fa53..b73c9ee7 100755 --- a/vnfs/vLB/scripts/run_streams_dns.sh +++ b/vnfs/vLB/scripts/run_streams_dns.sh @@ -1,9 +1,51 @@ #!/bin/bash +#Disable all the running streams vppctl packet-gen disable + +#Initial configuration: run only two streams vppctl packet-gen enable-stream dns1 vppctl packet-gen enable-stream dns2 -sleep 100 -vppctl packet-gen enable-stream dns3 -vppctl packet-gen enable-stream dns4 -vppctl packet-gen enable-stream dns5 + +sleep 180 + +#Rehash port numbers and re-run five streams every minute +while true; do + vppctl packet-gen disable + vppctl pac del dns1 + vppctl pac del dns2 + vppctl pac del dns3 + vppctl pac del dns4 + vppctl pac del dns5 + + #Update destination (vLB) IP + VLB_IPADDR=$(cat /opt/config/vlb_ipaddr.txt) + IPADDR1=$(cat /opt/config/local_private_ipaddr.txt) + sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns1 + sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns2 + sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns3 + sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns4 + sed -i -e "0,/UDP/ s/UDP:.*/UDP: "$IPADDR1" -> "$VLB_IPADDR"/" /opt/dns_streams/stream_dns5 + + #Update source ports (make them random) + sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns1 + sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns2 + sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns3 + sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns4 + sed -i -e "s/.*-> 53.*/ UDP: $RANDOM -> 53/" /opt/dns_streams/stream_dns5 + + vppctl exec /opt/dns_streams/stream_dns1 + vppctl exec /opt/dns_streams/stream_dns2 + vppctl exec /opt/dns_streams/stream_dns3 + vppctl exec /opt/dns_streams/stream_dns4 + vppctl exec /opt/dns_streams/stream_dns5 + + #Resume stream execution + vppctl packet-gen enable-stream dns1 + vppctl packet-gen enable-stream dns2 + vppctl packet-gen enable-stream dns3 + vppctl packet-gen enable-stream dns4 + vppctl packet-gen enable-stream dns5 + + sleep 60 +done
\ No newline at end of file diff --git a/vnfs/vLB/scripts/v_packetgen_install.sh b/vnfs/vLB/scripts/v_packetgen_install.sh index ca2957a7..6dce05ec 100644 --- a/vnfs/vLB/scripts/v_packetgen_install.sh +++ b/vnfs/vLB/scripts/v_packetgen_install.sh @@ -56,7 +56,6 @@ cd /opt wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlb/$INSTALL_SCRIPT_VERSION/v_packetgen_init.sh wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlb/$INSTALL_SCRIPT_VERSION/vpacketgen.sh wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlb/$INSTALL_SCRIPT_VERSION/run_streams_dns.sh -wget $REPO_URL_BLOB/org.onap.demo/vnfs/vlb/$INSTALL_SCRIPT_VERSION/vdnspacketgen_change_streams_ports.sh wget $REPO_URL_ARTIFACTS/org/onap/demo/vnf/vlb/vlb_dns_streams/$DEMO_ARTIFACTS_VERSION/vlb_dns_streams-$DEMO_ARTIFACTS_VERSION-demo.tar.gz tar -zmxvf vlb_dns_streams-$DEMO_ARTIFACTS_VERSION-demo.tar.gz @@ -65,7 +64,6 @@ rm *.tar.gz chmod +x v_packetgen_init.sh chmod +x vpacketgen.sh chmod +x run_streams_dns.sh -chmod +x vdnspacketgen_change_streams_ports.sh # Install VPP export UBUNTU="xenial" @@ -93,7 +91,4 @@ then reboot fi -# Install a cron job that restart streams every minute. This allows to map streams to different vDNSs when we scale out the VNF -echo "* * * * * /opt/vdnspacketgen_change_streams_ports.sh" | crontab - ./v_packetgen_init.sh |