add wait and retry for ping/ssh

Change-Id: Ib4ba143893edcdc24fa489dd05107abbdea19d2f