Added health check after installation before exit 18/9318/1
authorgarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 3 Jul 2020 15:32:05 +0000 (15:32 +0000)
committergarciadeblas <gerardo.garciadeblas@telefonica.com>
Fri, 3 Jul 2020 16:25:09 +0000 (16:25 +0000)
Change-Id: Ib0bd42e412846f4224feeaa8b3124e93e84be437
Signed-off-by: garciadeblas <gerardo.garciadeblas@telefonica.com>
installers/full_install_osm.sh

index af61873..914b7d8 100755 (executable)
@@ -864,7 +864,7 @@ function parse_yaml() {
 function namespace_vol() {
     osm_services="nbi lcm ro pol mon kafka mongo mysql"
     for osm in $osm_services; do
-          $WORKDIR_SUDO  sed -i "s#path: /var/lib/osm#path: $OSM_NAMESPACE_VOL#g" $OSM_K8S_WORK_DIR/$osm.yaml
+        $WORKDIR_SUDO  sed -i "s#path: /var/lib/osm#path: $OSM_NAMESPACE_VOL#g" $OSM_K8S_WORK_DIR/$osm.yaml
     done
 }
 
@@ -1188,6 +1188,20 @@ EOF
 
     [ -z "$INSTALL_NOHOSTCLIENT" ] && install_osmclient
     track osmclient
+    
+    echo -e "Checking OSM health state..."
+    if [ -n "$KUBERNETES" ]; then
+        $OSM_DEVOPS/installers/osm_health.sh -s ${OSM_STACK_NAME} -k || \
+        echo -e "OSM is not healthy, but will probably converge to a healthy state soon." && \
+        echo -e "Check OSM status with: kubectl -n ${OSM_STACK_NAME} get all" && \
+        track osm_unhealthy
+    else
+        $OSM_DEVOPS/installers/osm_health.sh -s ${OSM_STACK_NAME} || \
+        echo -e "OSM is not healthy, but will probably converge to a healthy state soon." && \
+        echo -e "Check OSM status with: docker service ls; docker stack ps ${OSM_STACK_NAME}" && \
+        track osm_unhealthy
+    fi
+    track after_healthcheck
 
     wget -q -O- https://osm-download.etsi.org/ftp/osm-8.0-eight/README2.txt &> /dev/null
     track end