aboutsummaryrefslogtreecommitdiffstats
path: root/boot
diff options
context:
space:
mode:
authorMarco Platania <platania@research.att.com>2017-04-12 14:40:50 -0400
committerMarco Platania <platania@research.att.com>2017-04-14 17:39:32 +0000
commitb3ee630713d9fd28e0db5c1ada3263b5f318f013 (patch)
tree30f3cc81a43c96b9a39c34dffe9c25dbb3632478 /boot
parent67f8b6279e9fe94a1aec1ea3e8d39fedaf3c1aa8 (diff)
add HC against SDC to AAI
Change-Id: I5df8fbcba3626d7004cfca95723ff93ef38e2a97 Signed-off-by: Marco Platania <platania@research.att.com> (cherry picked from commit bfebee18e7513fd3d42783fabbdff78b3a34c3c1)
Diffstat (limited to 'boot')
-rw-r--r--boot/aai_vm_init.sh17
-rw-r--r--boot/dcae_install.sh2
2 files changed, 18 insertions, 1 deletions
diff --git a/boot/aai_vm_init.sh b/boot/aai_vm_init.sh
index 2c8a75b2..3187c7dd 100644
--- a/boot/aai_vm_init.sh
+++ b/boot/aai_vm_init.sh
@@ -22,5 +22,22 @@ docker run --name=aai-service --net=host -v /etc/ssl/certs/ca-certificates.crt:/
docker pull $NEXUS_DOCKER_REPO/openecomp/model-loader:$DOCKER_IMAGE_VERSION
docker rm -f model-loader-service
+# Start Model Loader container only if SDC is up and running
+# Use the default SDC private IP address if no file exists or the file is empty
+if [[ -s "/opt/config/sdc_ip_addr.txt" ]]
+then
+ SDC_IP_ADDR=$(cat /opt/config/sdc_ip_addr.txt)
+else
+ SDC_IP_ADDR="10.0.3.1"
+fi
+
+# Run Health Check against SDC and verify that all five components are up
+RES=$(curl http://$SDC_IP_ADDR:8181/sdc1/rest/healthCheck | grep -c "OK")
+while [[ $RES -lt 5 ]]
+do
+ RES=$(curl http://$SDC_IP_ADDR:8181/sdc1/rest/healthCheck | grep -c "OK")
+done
+
+# At this point, SDC is healthy and Model Loader container can start
docker run --name=model-loader-service -it -d -e DISTR_CLIENT_ASDC_ADDRESS=c2.vm1.sdc.simpledemo.openecomp.org:8443 -e DISTR_CLIENT_ENVIRONMENT_NAME=$DMAAP_TOPIC -e DISTR_CLIENT_USER=aai -e DISTR_CLIENT_PASSWORD=OBF:1ks51l8d1o3i1pcc1r2r1e211r391kls1pyj1z7u1njf1lx51go21hnj1y0k1mli1sop1k8o1j651vu91mxw1vun1mze1vv11j8x1k5i1sp11mjc1y161hlr1gm41m111nkj1z781pw31kku1r4p1e391r571pbm1o741l4x1ksp -e APP_SERVER_BASE_URL=https://c1.vm1.aai.simpledemo.openecomp.org:8443 -e APP_SERVER_KEYSTORE_PASSWORD=OBF:1i9a1u2a1unz1lr61wn51wn11lss1unz1u301i6o -e APP_SERVER_AUTH_USER=ModelLoader -e APP_SERVER_AUTH_PASSWORD=OBF:1qvu1v2h1sov1sar1wfw1j7j1wg21saj1sov1v1x1qxw $NEXUS_DOCKER_REPO/openecomp/model-loader:$DOCKER_IMAGE_VERSION
diff --git a/boot/dcae_install.sh b/boot/dcae_install.sh
index f69227c6..54d135da 100644
--- a/boot/dcae_install.sh
+++ b/boot/dcae_install.sh
@@ -12,7 +12,7 @@ STATE=$(cat /opt/config/dcae_state.txt)
HORIZON_URL=$(cat /opt/config/horizon_url.txt)
OPENSTACK_USER=$(cat /opt/config/openstack_user.txt)
OPENSTACK_PASSWORD=$(cat /opt/config/openstack_password.txt)
-OPENSTACK_KEYNAME=$(cat /opt/config/key_name.txt)$(cat /opt/config/rand_str.txt)"_dcae"
+OPENSTACK_KEYNAME=$(cat /opt/config/key_name.txt)"_"$(cat /opt/config/rand_str.txt)"_dcae"
OPENSTACK_PUBKEY=$(cat /opt/config/pub_key.txt)
KEYSTONE_URL=$(cat /opt/config/keystone_url.txt)
OPENSTACK_TENANT_ID=$(cat /opt/config/tenant_id.txt)