Fix issues in MSB and Multi-VIM installation 51/14651/1
authorMarco Platania <platania@research.att.com>
Fri, 22 Sep 2017 15:15:17 +0000 (11:15 -0400)
committerMarco Platania <platania@research.att.com>
Fri, 22 Sep 2017 15:15:17 +0000 (11:15 -0400)
- Add delay before curl operations in MSB
- Use detached mode (-d) in Multi-VIM

Change-Id: Id9f022b163312286ea370ebd40d1f75084631759
Issue-ID: INT-213
Signed-off-by: Marco Platania <platania@research.att.com>
boot/msb_vm_init.sh
boot/mvim_vm_init.sh
boot/vnfsdk_vm_init.sh

index f02032d..cbce060 100644 (file)
@@ -24,126 +24,60 @@ DISCOVERY_IP=`sudo docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAd
 
 docker run -d -p 80:80 -e CONSUL_IP=$CONSUL_IP -e SDCLIENT_IP=$DISCOVERY_IP -e "ROUTE_LABELS=visualRange:0|1" --name msb_apigateway $NEXUS_DOCKER_REPO/onap/msb/msb_apigateway:$DOCKER_IMAGE_VERSION
 
+# Allow the MSB container to come up before registering services
+sleep 20
+
 # register ONAP services to MSB
 #aai
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-cloudInfrastructure", "version": "v11", "url": "/aai/v11/cloud-infrastructure","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-cloudInfrastructure-deprecated", "version": "v11", "url": "/aai/v11/cloud-infrastructure","path": "/aai/v11/cloud-infrastructure","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-business", "version": "v11", "url": "/aai/v11/business","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-business-deprecated", "version": "v11", "url": "/aai/v11/business","path": "/aai/v11/business","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-search", "version": "v11", "url": "/aai/v11/search","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-search-deprecated", "version": "v11", "url": "/aai/v11/search","path": "/aai/v11/search","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-actions", "version": "v11", "url": "/aai/v11/actions","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-actions-deprecated", "version": "v11", "url": "/aai/v11/actions","path": "/aai/v11/actions","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-service-design-and-creation", "version": "v11", "url": "/aai/v11/service-design-and-creation","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-service-design-and-creation-deprecated", "version": "v11", "url": "/aai/v11/service-design-and-creation","path": "/aai/v11/service-design-and-creation","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-network", "version": "v11", "url": "/aai/v11/network","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
-
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "aai-network-deprecated", "version": "v11", "url": "/aai/v11/network","path": "/aai/v11/network","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-cloudInfrastructure", "version": "v11", "url": "/aai/v11/cloud-infrastructure","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-cloudInfrastructure-deprecated", "version": "v11", "url": "/aai/v11/cloud-infrastructure","path": "/aai/v11/cloud-infrastructure","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-business", "version": "v11", "url": "/aai/v11/business","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-business-deprecated", "version": "v11", "url": "/aai/v11/business","path": "/aai/v11/business","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-search", "version": "v11", "url": "/aai/v11/search","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-search-deprecated", "version": "v11", "url": "/aai/v11/search","path": "/aai/v11/search","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-actions", "version": "v11", "url": "/aai/v11/actions","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-actions-deprecated", "version": "v11", "url": "/aai/v11/actions","path": "/aai/v11/actions","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-service-design-and-creation", "version": "v11", "url": "/aai/v11/service-design-and-creation","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-service-design-and-creation-deprecated", "version": "v11", "url": "/aai/v11/service-design-and-creation","path": "/aai/v11/service-design-and-creation","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-network", "version": "v11", "url": "/aai/v11/network","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
+
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "aai-network-deprecated", "version": "v11", "url": "/aai/v11/network","path": "/aai/v11/network","protocol": "REST",  "nodes": [ {"ip": "'$AAI_IP1'","port": "8443"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
 #so
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "so", "version": "v1", "url": "/ecomp/mso/infra","protocol": "REST",  "nodes": [ {"ip": "'$SO_IP'","port": "8080"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "so", "version": "v1", "url": "/ecomp/mso/infra","protocol": "REST",  "nodes": [ {"ip": "'$SO_IP'","port": "8080"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "so-deprecated", "version": "v1", "url": "/ecomp/mso/infra","path": "/ecomp/mso/infra","protocol": "REST",  "nodes": [ {"ip": "'$SO_IP'","port": "8080"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "so-deprecated", "version": "v1", "url": "/ecomp/mso/infra","path": "/ecomp/mso/infra","protocol": "REST",  "nodes": [ {"ip": "'$SO_IP'","port": "8080"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
 #Dmaap message router
-#curl -X POST \
-#  -H "Content-Type: application/json" \
-#  -d '{"serviceName": "message-router", "version": "v1", "url": "/","protocol": "REST",  "nodes": [ {"ip": "'$DMAAP_IP'","port": "3904"}]}' \
-#  "http://127.0.0.1:10081/api/microservices/v1/services”
+#curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "message-router", "version": "v1", "url": "/","protocol": "REST",  "nodes": [ {"ip": "'$DMAAP_IP'","port": "3904"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
 #policy
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "policy-pdp", "version": "v1", "url": "/pdp","protocol": "REST",  "nodes": [ {"ip": "'$POLICY_IP'","port": "8081"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "policy-pdp", "version": "v1", "url": "/pdp","protocol": "REST",  "nodes": [ {"ip": "'$POLICY_IP'","port": "8081"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "policy-pdp-deprecated", "version": "v1", "url": "/pdp","path": "/pdp","protocol": "REST",  "nodes": [ {"ip": "'$POLICY_IP'","port": "8081"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "policy-pdp-deprecated", "version": "v1", "url": "/pdp","path": "/pdp","protocol": "REST",  "nodes": [ {"ip": "'$POLICY_IP'","port": "8081"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
 #portal
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "portal", "version": "v2", "url": "/","protocol": "REST",  "nodes": [ {"ip": "'$PORTAL_IP'","port": "8989"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "portal", "version": "v2", "url": "/","protocol": "REST",  "nodes": [ {"ip": "'$PORTAL_IP'","port": "8989"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
 #sdc
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "sdc", "version": "v1", "url": "/sdc/v1","protocol": "REST",  "nodes": [ {"ip": "'$SDC_IP'","port": "8080"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "sdc", "version": "v1", "url": "/sdc/v1","protocol": "REST",  "nodes": [ {"ip": "'$SDC_IP'","port": "8080"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "sdc-deprecated", "version": "v1", "url": "/sdc/v1","path": "/sdc/v1","protocol": "REST",  "nodes": [ {"ip": "'$SDC_IP'","port": "8080"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "sdc-deprecated", "version": "v1", "url": "/sdc/v1","path": "/sdc/v1","protocol": "REST",  "nodes": [ {"ip": "'$SDC_IP'","port": "8080"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
 #sdnc
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "sdnc", "version": "v1", "url": "/","protocol": "REST",  "nodes": [ {"ip": "'$SDNC_IP'","port": "8282"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "sdnc", "version": "v1", "url": "/","protocol": "REST",  "nodes": [ {"ip": "'$SDNC_IP'","port": "8282"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "sdnc", "version": "v1", "url": "/restconf","path": "/restconf","protocol": "REST",  "nodes": [ {"ip": "'$SDNC_IP'","port": "8282"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "sdnc", "version": "v1", "url": "/restconf","path": "/restconf","protocol": "REST",  "nodes": [ {"ip": "'$SDNC_IP'","port": "8282"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
 
 #multi-vim
-curl -X POST \
-  -H "Content-Type: application/json" \
-  -d '{"serviceName": "multicloud-titanium_cloud", "version": "v0", "url": "/api/multicloud-titanium_cloud/v0","protocol": "REST",  "nodes": [ {"ip": "'$OPENO_IP'","port": "9005"}]}' \
-  "http://127.0.0.1:10081/api/microservices/v1/services”
\ No newline at end of file
+curl -X POST -H "Content-Type: application/json" -d '{"serviceName": "multicloud-titanium_cloud", "version": "v0", "url": "/api/multicloud-titanium_cloud/v0","protocol": "REST",  "nodes": [ {"ip": "'$OPENO_IP'","port": "9005"}]}' "http://$OPENO_IP:10081/api/microservices/v1/services"
\ No newline at end of file
index bd62a77..f8776bd 100755 (executable)
@@ -20,7 +20,7 @@ docker rm -f multicloud-vio
 docker rm -f multicloud-ocata
 docker rm -f multicloud-windriver
 
-docker run -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9001:9001 --name multicloud-broker $NEXUS_DOCKER_REPO/onap/multicloud/framework:$DOCKER_IMAGE_VERSION
-docker run -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9004:9004 --name multicloud-vio $NEXUS_DOCKER_REPO/onap/multicloud/vio:$DOCKER_IMAGE_VERSION
-docker run -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9006:9006 --name multicloud-ocata $NEXUS_DOCKER_REPO/onap/multicloud/openstack-ocata:$DOCKER_IMAGE_VERSION
-docker run -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9005:9005 --name multicloud-windriver $NEXUS_DOCKER_REPO/onap/multicloud/openstack-windriver:$DOCKER_IMAGE_VERSION
\ No newline at end of file
+docker run -d -t -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9001:9001 --name multicloud-broker $NEXUS_DOCKER_REPO/onap/multicloud/framework:$DOCKER_IMAGE_VERSION
+docker run -d -t -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9004:9004 --name multicloud-vio $NEXUS_DOCKER_REPO/onap/multicloud/vio:$DOCKER_IMAGE_VERSION
+docker run -d -t -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9006:9006 --name multicloud-ocata $NEXUS_DOCKER_REPO/onap/multicloud/openstack-ocata:$DOCKER_IMAGE_VERSION
+docker run -d -t -e MSB_ADDR=$OPENO_IP -e AAI_ADDR=$AAI_IP1 -p 9005:9005 --name multicloud-windriver $NEXUS_DOCKER_REPO/onap/multicloud/openstack-windriver:$DOCKER_IMAGE_VERSION
\ No newline at end of file
index a505668..fa28285 100755 (executable)
@@ -10,7 +10,7 @@ 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)
 export MTU=$(/sbin/ifconfig | grep MTU | sed 's/.*MTU://' | sed 's/ .*//' | sort -n | head -1)
-#DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) --> don't needed at the moment
+#DOCKER_IMAGE_VERSION=$(cat /opt/config/docker_version.txt) --> not needed at the moment
 
 # Refresh configuration and scripts
 cd /opt/refrepo