From 021bae9ecbb5c6838424f79907bde5df1ec83922 Mon Sep 17 00:00:00 2001 From: Lusheng Ji Date: Mon, 20 Nov 2017 14:06:52 -0500 Subject: Fix for sshd taking too long problem Under certain conditions, it takes longer than 10 seconds on the cloudify manager VM from the time its IP stack becoming ready (echoing to ICMP) to the time its sshd becoming ready. This causes the ssh-into-cloudify-manager-VM command to fail. The implemented solution is to replace the ping test-wait loop with a TCP port 22 open test-wait loop. Issue-ID: DCAEGEN2-201 Change-Id: I9b734a9ff58ec9e97dc0102dc2ba86756e50f135 Signed-off-by: Lusheng Ji --- .gitreview | 1 + bootstrap/installer-docker.sh-template | 19 ++++--------------- 2 files changed, 5 insertions(+), 15 deletions(-) diff --git a/.gitreview b/.gitreview index a35a0ea..1a24ea1 100644 --- a/.gitreview +++ b/.gitreview @@ -2,3 +2,4 @@ host=gerrit.onap.org port=29418 project=dcaegen2/deployments.git +defaultbranch=amsterdam diff --git a/bootstrap/installer-docker.sh-template b/bootstrap/installer-docker.sh-template index 2a26763..b056ca1 100755 --- a/bootstrap/installer-docker.sh-template +++ b/bootstrap/installer-docker.sh-template @@ -132,27 +132,16 @@ cfy local init --install-plugins -p ./blueprints/centos_vm.yaml -i /tmp/local_in cfy local execute -w install --task-retries=10 PUBIP=$(cfy local outputs | grep -Po '"public_ip": "\K.*?(?=")') - -## It's probably not completely ready when the installation finish, so wait -#sleep 180 -while [ $( ping -c 1 $PUBIP 2> /dev/null | grep icmp* | wc -l ) -eq 0 ]; -do - sleep 5 - echo "." -done +# wait till the cloudify manager's sshd ready +while ! nc -z -v -w5 ${PUBIP} 22; do echo "."; done sleep 10 echo "Installing Cloudify Manager on ${PUBIP}." - PVTIP=$(ssh $SSHOPTS -i "$PVTKEY" "$SSHUSER"@"$PUBIP" 'echo PVTIP=`curl --silent http://169.254.169.254/2009-04-04/meta-data/local-ipv4`' | grep PVTIP | sed 's/PVTIP=//') if [ "$PVTIP" = "" ] then - echo Cannot access specified machine at $PUBIP using supplied credentials - # Don't exit--keep the container up so we can uninstall the VM and supporting entities - while true - do - sleep 300 - done + echo Cannot access specified machine at $PUBIP using supplied credentials + exit fi -- cgit 1.2.3-korg