Skip to content

pillar: diagnose stuck EVE-k app bring-up (CDI + readiness gate) - #6200

Merged
rene merged 2 commits into
lf-edge:masterfrom
eriknordmark:cdi-teardown-diag
Jul 23, 2026
Merged

pillar: diagnose stuck EVE-k app bring-up (CDI + readiness gate)#6200
rene merged 2 commits into
lf-edge:masterfrom
eriknordmark:cdi-teardown-diag

Conversation

@eriknordmark

@eriknordmark eriknordmark commented Jul 22, 2026

Copy link
Copy Markdown
Contributor

Description

EVE-k app bring-up after a volume-create can stall in two spots that leave no clear signal in the device's own logs. This adds diagnostics for both; no behavior change. This is useful for troubleshooting issues in the field and also when running regression and stress tests.

  1. CDI upload-pod teardown wedge (RolloutDiskToPVC, follow-up to volumemgr,kubeapi: defer+retry app volumes until EVE-k cluster storage is ready #6121). When the CDI upload pod reaches Ready and is then torn down — the data PVC shows pod.phase=Failed / ContainerStatusUnknown and its local-path scratch PVC is left stuck Terminating under the pvc-protection finalizer — the upload never completes and the volume stays CREATING_VOLUME. The existing failure walk inspects only the data PVC/PV/engine and misses this, so log the upload-pod phase, the CDI teardown annotations on the data PVC, and the scratch PVC's phase / deletion-pending / storage class / finalizers.

  2. WaitForKubernetes readiness gate. The boot-time gate polls node-Ready, KubeVirt-CR-Available, and (optionally) Longhorn; on the 20-minute timeout it returned only "timed out waiting for the condition", and domainmgr then logged a hardcoded "kubevirt not ready" regardless of which check actually failed. That mislabels a stuck node/Longhorn check as a kubevirt problem and leaves an app wedged at INSTALLED undiagnosable from the log alone. Now the returned error names the last unmet sub-check (node / kubevirt / longhorn) and domainmgr logs it verbatim.

Related: #6197 (kubelet mount-wedge detector) covers a distinct wedge — a Pending pod whose Longhorn volume is attached but never NodeStaged.

How to test and validate this PR

EVE-k only, and diagnostic-only (readiness gating and volume-create success/failure are unchanged; only log content differs). On an EVE-k device:

  • Drive an app-volume CDI import that wedges until RolloutDiskToPVC exhausts its retries → volumemgr logs the upload-pod / scratch-PVC teardown state in /persist/newlog.
  • Stall the readiness gate (e.g. kubevirt never reaches Available) → domainmgr logs WaitForKubernetes not satisfied: … (last unmet condition: kubevirt not ready: …).

Not covered by an automated test (log output only).

Changelog notes

No user-facing changes.

PR Backports

Part of this extends the #6121 diagnostic block, which is not on the current LTS branches.

-17.0: Yes

  • 16.0-stable: No.
  • 14.5-stable: No.
  • 13.4-stable: No.

Checklist

  • I've provided a proper description
  • I've added the proper documentation — N/A (diagnostic logging, no doc change)
  • I've tested my PR on amd64 device — builds cleanly (gofmt, go vet -tags k) and ships in the resize-allprs-stress soak build; not independently device-verified as a standalone at open time
  • I've tested my PR on arm64 device — no
  • I've written the test verification instructions
  • I've set the proper labels to this PR

🤖 Generated with Claude Code

When RolloutDiskToPVC exhausts its upload retries the app volume stays in
CREATING_VOLUME, and the existing failure diagnosis walks only the data PVC,
its PV, and the Longhorn engine. That path does not surface the case where
the CDI upload pod reaches Ready but is then torn down — the data PVC's CDI
annotations show pod.phase Failed / ContainerStatusUnknown — while its
local-path scratch PVC is left stuck Terminating under the pvc-protection
finalizer, so the upload never completes and the volume never leaves
CREATING_VOLUME.

Log the upload pod phase, the CDI teardown annotations on the data PVC, and
the scratch PVC's phase / deletion-pending / storage class / finalizers
before the existing checks, so this wedge is diagnosable from the device's
own logs. Diagnostic only; no behavior change.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
On EVE-k the boot-time WaitForKubernetes poll gates on node-Ready,
KubeVirt-CR-Available, and (optionally) Longhorn. On the 20-minute
timeout it returned only "timed out waiting for the condition", and
domainmgr then logged a hardcoded "kubevirt not ready" regardless of
which check was actually failing — so an app wedged at INSTALLED while
the node or Longhorn (not kubevirt) was the laggard was mislabeled and
undiagnosable from the log alone. Record the last unmet sub-check and
attach it to the returned error, and drop domainmgr's fixed label for a
neutral "not satisfied", so the specific gate rides in the logged error.
Diagnostic only: gating and retry behavior are unchanged, and all
callers (volumemgr, domainmgr, zedkube) only log the error.

Signed-off-by: eriknordmark <erik@zededa.com>
Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
@eriknordmark eriknordmark changed the title kubeapi: log CDI upload-pod teardown state on rollout failure pillar: diagnose stuck EVE-k app bring-up (CDI + readiness gate) Jul 22, 2026
@codecov

codecov Bot commented Jul 22, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 0% with 23 lines in your changes missing coverage. Please review.
✅ Project coverage is 23.12%. Comparing base (7cad850) to head (c5901fe).
⚠️ Report is 6 commits behind head on master.

Files with missing lines Patch % Lines
pkg/pillar/kubeapi/vitoapiserver.go 0.00% 15 Missing ⚠️
pkg/pillar/kubeapi/kubeapi.go 0.00% 7 Missing ⚠️
pkg/pillar/cmd/domainmgr/domainmgr.go 0.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #6200      +/-   ##
==========================================
+ Coverage   22.75%   23.12%   +0.36%     
==========================================
  Files         509      519      +10     
  Lines       93285    95023    +1738     
==========================================
+ Hits        21231    21977     +746     
- Misses      70324    71132     +808     
- Partials     1730     1914     +184     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@eriknordmark
eriknordmark marked this pull request as ready for review July 22, 2026 23:38
@eriknordmark eriknordmark added stable Should be backported to stable release(s) next-17.0.x-rc PR must be present in the next 17.0.x-lts release labels Jul 22, 2026
@rene
rene merged commit 068aacf into lf-edge:master Jul 23, 2026
51 of 52 checks passed
@eriknordmark
eriknordmark deleted the cdi-teardown-diag branch August 4, 2026 11:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

next-17.0.x-rc PR must be present in the next 17.0.x-lts release stable Should be backported to stable release(s)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants