From d67b91ef4b1cca4c0c4d6e14b2a006343739cfa9 Mon Sep 17 00:00:00 2001 From: dawn Date: Mon, 22 Jun 2026 19:15:37 +0300 Subject: [PATCH] spindle/microvm: log crashes with Error, and also if microVM fails to start in the first place Signed-off-by: dawn --- spindle/engines/microvm/engine.go | 11 +++++++---- spindle/engines/microvm/qemu.go | 3 +++ 2 files changed, 10 insertions(+), 4 deletions(-) diff --git a/spindle/engines/microvm/engine.go b/spindle/engines/microvm/engine.go index d6c0942a..bff2c1e2 100644 --- a/spindle/engines/microvm/engine.go +++ b/spindle/engines/microvm/engine.go @@ -220,6 +220,9 @@ func (e *Engine) SetupWorkflow(ctx context.Context, wid models.WorkflowId, wf *m if setupDone { return } + if detail := vmCrashLog(state.VM); detail != "" { + l.Error("microVM setup failed", "detail", detail) + } if err := e.cleanupState(context.Background(), wid, state); err != nil { l.Error("failed to cleanup failed setup", "error", err) } @@ -385,10 +388,10 @@ func (e *Engine) classifyStepError(ctx context.Context, wid models.WorkflowId, s } if detail := vmCrashLog(state.VM); detail != "" { fmt.Fprintf(stderr, "%s:\n%s\n", reason, detail) - l.Debug(reason, "oom", oom, "detail", detail) + l.Error(reason, "oom", oom, "detail", detail) } else { fmt.Fprintln(stderr, reason) - l.Debug(reason, "oom", oom) + l.Error(reason, "oom", oom) } return errors.New(reason + "; see workflow logs for serial output") } @@ -403,9 +406,9 @@ func (e *Engine) classifyStepError(ctx context.Context, wid models.WorkflowId, s // will be more helpful. if detail := vmCrashLog(state.VM); detail != "" { fmt.Fprintf(stderr, "step failed (%v):\n%s\n", err, detail) - l.Debug("step failed", "error", err, "detail", detail) + l.Error("step failed", "error", err, "detail", detail) } else { - l.Debug("step failed", "error", err) + l.Error("step failed", "error", err) } return err } diff --git a/spindle/engines/microvm/qemu.go b/spindle/engines/microvm/qemu.go index b8502506..7cf4eccc 100644 --- a/spindle/engines/microvm/qemu.go +++ b/spindle/engines/microvm/qemu.go @@ -137,6 +137,9 @@ func StartQEMU(ctx context.Context, cfg QEMUConfig, logger *slog.Logger) (VMHand var ok bool defer func() { if !ok { + if detail := vmCrashLog(handle); detail != "" { + logger.Error("microVM failed to start", "cid", handle.cid, "detail", detail) + } _ = handle.Close() } }() -- 2.51.2