Fix health check issues with vLBMS 89/37589/1
authorMarco Platania <platania@research.att.com>
Wed, 21 Mar 2018 21:44:27 +0000 (17:44 -0400)
committerMarco Platania <platania@research.att.com>
Wed, 21 Mar 2018 21:44:27 +0000 (17:44 -0400)
- Allow vLB to run health check only against active vDNS instances
- Change the path to status file
- Make run_health scripts executable

Change-Id: I6909d8507cafee5f9e93fcceb868db5d4f224045
Issue-ID: INT-433
Signed-off-by: Marco Platania <platania@research.att.com>
vnfs/vLBMS/apis/health-vnf-onap-plugin/health-vnf-onap-plugin-impl/src/main/java/org/onap/vnf/health/read/ElementStateCustomizer.java
vnfs/vLBMS/scripts/properties.conf
vnfs/vLBMS/scripts/run_streams_dns.sh [moved from vnfs/vLBMS/scripts/run_streams.sh with 100% similarity]
vnfs/vLBMS/scripts/v_dns_install.sh
vnfs/vLBMS/scripts/v_lb_install.sh
vnfs/vLBMS/scripts/v_packetgen_install.sh

index 15d0c22..b83ccef 100644 (file)
@@ -168,9 +168,12 @@ public final class ElementStateCustomizer implements InitializingReaderCustomize
                // check all the vDNS instances
                Map<String, VdnsInstance> activeVdnsInstances = dnsInstanceManager.getDnsInstancesAsMap();
                Iterator<String> iter = activeVdnsInstances.keySet().iterator();
-               while(iter.hasNext()){
-                       if(!getRemoteVnfcHealthStatus(activeVdnsInstances.get(iter.next()).getOamIpAddr())) {
-                               healthStatus = "unhealthy";
+               while(iter.hasNext()) {
+                       VdnsInstance vdns = activeVdnsInstances.get(iter.next());
+                       if(vdns.isEnabled()) {
+                               if(!getRemoteVnfcHealthStatus(vdns.getOamIpAddr())) {
+                                       healthStatus = "unhealthy";
+                               }
                        }
                }
        }
index 03c5469..140c0b8 100644 (file)
@@ -1,4 +1,4 @@
 script=/opt/run_health.sh
-output=status.txt
+output=/opt/status.txt
 vnfc=vLB
 primary=true
index 38860e8..7a30c0f 100644 (file)
@@ -64,13 +64,14 @@ sed -i 's/vnfc=.*/vnfc=vDNS/g' /opt/config/properties.conf
 
 mvn org.apache.maven.plugins:maven-dependency-plugin:2.10:get -DremoteRepositories=https://nexus.onap.org/content/repositories/snapshots -Dartifact=org.onap.demo.vnf.vlb:vlb-vnf-onap-distribution:$DEMO_ARTIFACTS_VERSION-SNAPSHOT:tar.gz:hc -Dtransitive=false -Ddest=.
 tar -zmxvf vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT-hc.tar.gz
-rm vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT.tar.gz
+rm vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT-hc.tar.gz
 sed -i 's/"restconf-binding-address": "127.0.0.1",/"restconf-binding-address": "0.0.0.0",/g' vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT/config/honeycomb.json
 sed -i 's/"netconf-tcp-binding-address": "127.0.0.1",/"netconf-tcp-binding-address": "0.0.0.0",/g' vlb-vnf-onap-distribution-$DEMO_ARTIFACTS_VERSION-SNAPSHOT/config/honeycomb.json
 
 chmod +x v_dns_init.sh
 chmod +x vdns.sh
 chmod +x set_gre_tunnel.sh
+chmod +x run_health.sh
 
 # Download Bind config files
 cd /opt/config
index afcb081..7d46918 100644 (file)
@@ -89,6 +89,7 @@ chmod +x vlb.sh
 chmod +x /opt/VES/evel/evel-library/code/VESreporting/go-client.sh
 chmod +x add_dns.sh
 chmod +x remove_dns.sh
+chmod +x run_health.sh
 
 echo "vpp" > config/service.txt
 
index 2f13fef..abfa1f4 100644 (file)
@@ -75,6 +75,7 @@ rm *.tar.gz
 chmod +x v_packetgen_init.sh
 chmod +x vpacketgen.sh
 chmod +x run_streams_dns.sh
+chmod +x run_health.sh
 
 echo "vpp" > config/service.txt