Uploaded image for project: 'Data Collection, Analytics, and Events'
  1. Data Collection, Analytics, and Events
  2. DCAEGEN2-205

Missing retries in DCAE2 VM creation

XMLWordPrintable

      During the DCAE bootstrap process, the boot container creates VMs.
      After the creation of the VM it tries to fetch the IP Address via a ssh call.

      In optimal case the ssh daemon in the created VM is ready to open the session and the installation continues.

      Problem:
      In case of a problem and the SSH call fails, the call will never be retried and the boot container gets into an endless wait-loop, see installer-docker.sh-template.

      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
      fi

      In our case the 1st attempt to get the SSH session fails, but when manually trying it, it works.
      {{}}

      Installing Cloudify Manager on 10.222.220.106.
      + echo 'Installing Cloudify Manager on 10.222.220.106.' 
      ++ sed s/PVTIP=// 
      ++ grep PVTIP 
      ++ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ./key600 centos@10.222.220.106 'echo PVTIP=`curl --silent http://169.254.169.254/2009-04-04/meta-data/local-ipv4`' 
      ssh: connect to host 10.222.220.106 port 22: Connection refused 
      + PVTIP= 
      Cannot access specified machine at 10.222.220.106 using supplied credentials 
      + '[' '' = '' ']' 
      + echo Cannot access specified machine at 10.222.220.106 using supplied credentials 
      + true 
      + sleep 300 
       

      Manual execution within boot container:

      ubuntu@onap-dcae-bootstrap:~$ sudo docker exec -it boot /bin/bash 
      installer@dadba842731c:~$ ssh -o UserKnownHostsFile=/dev/null -o StrictHostKeyChecking=no -i ./key600 centos@10.222.220.106 'echo PVTIP=`curl --silent http://169.254.169.254/2009-04-04/meta-data/local-ipv4`' Warning: Permanently added '10.222.220.106' (ECDSA) to the list of known hosts. 
      PVTIP=10.0.0.5 
      installer@dadba842731c:~$ 

       A Solution would be to add a retry of the SSH connection.

            wrider wrider
            andreasgeissler Andreas Geissler
            Votes:
            1 Vote for this issue
            Watchers:
            4 Start watching this issue

              Created:
              Updated:
              Resolved: