summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorLusheng Ji <lji@research.att.com>2017-11-20 14:06:52 -0500
committerLusheng Ji <lji@research.att.com>2017-11-27 13:29:17 -0500
commit021bae9ecbb5c6838424f79907bde5df1ec83922 (patch)
tree56fc3831b8675f064edbb04943c0a47b3bd516d7
parentaa8ed202ba4a89f5a0332001964292bb8b0a9cde (diff)
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 <lji@research.att.com>
-rw-r--r--.gitreview1
-rwxr-xr-xbootstrap/installer-docker.sh-template19
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