@@ -394,18 +394,17 @@ func createInstance(serviceAccount string) (string, error) {
394
394
}
395
395
396
396
then := time .Now ()
397
- err = wait .Poll (10 * time .Second , 5 * time .Minute , func () (bool , error ) {
397
+ err = wait .Poll (15 * time .Second , 5 * time .Minute , func () (bool , error ) {
398
398
glog .V (2 ).Infof ("Waiting for instance %v to come up. %v elapsed" , name , time .Since (then ))
399
399
var instance * compute.Instance
400
400
instance , err = computeService .Instances .Get (* project , * zone , name ).Do ()
401
401
if err != nil {
402
- glog .Error ( err )
402
+ glog .Errorf ( "Failed to get instance %v: %v" , name , err )
403
403
return false , nil
404
404
}
405
405
406
406
if strings .ToUpper (instance .Status ) != "RUNNING" {
407
- err = fmt .Errorf ("instance %s not in state RUNNING, was %s" , name , instance .Status )
408
- glog .Error (err )
407
+ glog .Warningf ("instance %s not in state RUNNING, was %s" , name , instance .Status )
409
408
return false , nil
410
409
}
411
410
@@ -414,9 +413,9 @@ func createInstance(serviceAccount string) (string, error) {
414
413
remote .AddHostnameIP (name , externalIP )
415
414
}
416
415
417
- if sshOut , err := remote .SSHNoSudo (name , "echo" ); err != nil {
416
+ if sshOut , err := remote .SSHCheckAlive (name ); err != nil {
418
417
err = fmt .Errorf ("Instance %v in state RUNNING but not available by SSH: %v" , name , err )
419
- glog .Errorf ("SSH encountered an error: %v, output: %v" , err , sshOut )
418
+ glog .Warningf ("SSH encountered an error: %v, output: %v" , err , sshOut )
420
419
return false , nil
421
420
}
422
421
0 commit comments