aboutsummaryrefslogtreecommitdiffstats
path: root/vm
diff options
context:
space:
mode:
authorDmitry Vyukov <dvyukov@google.com>2017-11-19 12:29:00 +0100
committerDmitry Vyukov <dvyukov@google.com>2017-11-19 12:29:00 +0100
commit9badd05327bc3a1a96c828de3c32dc8101be77cc (patch)
treed1fe4812d2c3dd4e3d070efee54e832d5a49bc0f /vm
parent2994ea09810a461d7a6334cdc4867179d46a08e2 (diff)
vm/gce: provide VM console output on boot failures
"can't ssh into the instance" is not a very useful error.
Diffstat (limited to 'vm')
-rw-r--r--vm/gce/gce.go4
1 files changed, 4 insertions, 0 deletions
diff --git a/vm/gce/gce.go b/vm/gce/gce.go
index 165ffe4ce..7d973fe2e 100644
--- a/vm/gce/gce.go
+++ b/vm/gce/gce.go
@@ -15,6 +15,7 @@ import (
"archive/tar"
"bytes"
"compress/gzip"
+ "errors"
"fmt"
"io"
"io/ioutil"
@@ -164,6 +165,9 @@ func (pool *Pool) Create(workdir string, index int) (vmimpl.Instance, error) {
}
Logf(0, "wait instance to boot: %v (%v)", name, ip)
if err := pool.waitInstanceBoot(ip, sshKey, sshUser); err != nil {
+ if output, err := pool.GCE.GetSerialPortOutput(name); err == nil {
+ err = errors.New(err.Error() + "\n\n" + output)
+ }
return nil, err
}
ok = true