Skip to content

WorkloadsReady reports all workloads operational for a vm-disk whose PVC never binds #4139

Open

Description

A VMDisk whose PVC never binds reports WorkloadsReady=True with the message "All workloads are operational". The condition is not merely uninformative here, it states the opposite of what is happening, and it stays that way for as long as the disk sits unbound.

internal/controller/workloadmonitor_controller.go derives the aggregate from ready pods counted against minReplicas. A vm-disk release declares no pods, so the comparison is 0 against 0 and comes out satisfied. The Workload object that the unbound PVC produces already carries operational: false, and the aggregation drops it rather than folding it in, so the one signal that knows the truth is the one that does not reach the condition.

The obvious repair does not work. Adding "an unbound PVC means not operational" would report every unattached blank disk as broken, because a WaitForFirstConsumer volume is legitimately unbound until a VM attaches to it, which is the normal state for a disk created ahead of the VM that will use it. So the fix has to distinguish "unbound and waiting for a consumer that has not arrived" from "unbound and never going to bind", and the controller as written has no input that separates them.

The same 0/0 shape exists for bucket, so whatever lands here should be checked against that one rather than written for disks alone.

Found while looking at #2908, where a cross-StorageClass clone leaves a disk unbound indefinitely. That issue is about the failure being invisible; this is about the status actively asserting health while it happens, which is the part that survives even after the clone case itself is addressed.

Activity

  1. added
    kind/bugCategorizes issue or PR as related to a bug
    area/apiIssues or PRs related to the cozystack-api aggregated API server
    on Sep 7, 2026
  2. lexfrei commented on Sep 23, 2026

    @lexfrei
    ContributorAuthor

    The vm-disk half of this is fixed by #4380 once it merges. Paths below are at its head b0ff186. The monitor now reads the DataVolume phase and reports not operational while CDI is still working on the disk (internal/controller/workloadmonitor_controller.go:103-131, applied at :866-868). That phase is the input this issue said the controller was missing.

    At CDI v1.66.1 an unbound target PVC on the populator path goes to PendingPopulation only when the class is WaitForFirstConsumer, no node is selected yet and immediate binding was not requested (shouldBeMarkedPendingPopulation in pkg/controller/datavolume/controller-base.go). Otherwise the DataVolume takes a populator phase such as CloneScheduled, CSICloneInProgress or PrepClaimInProgress, and #4380 counts every one of them as in flight. So a disk waiting for its first VM stays green, and a clone that never binds, as in #2908, turns WorkloadsReady False. The phase table in TestReconcile_DataVolumePhaseDecidesOperational pins both sides (internal/controller/workloadmonitor_controller_test.go:1234).

    I'm narrowing this issue to what #4380 leaves open. The aggregate still ignores the per-object Workload.Status.Operational (workloadmonitor_controller.go:862-865), so a bucket monitor with minReplicas: 0 reports operational whatever its BucketClaims say. That is the 0/0 shape from the description, and it is untouched.

    There is also a smaller vm-disk gap. On a StorageClass without a CSI driver CDI does not use populators, and a pending PVC on a WaitForFirstConsumer class reads WaitForFirstConsumer even when immediate binding was requested (updateStatusPVCPending in the same CDI file). #4380 counts that phase as settled, so a disk stuck there stays green. I don't know of a cozystack default class that takes this path.

  3. added
    area/storageIssues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor)
    triage/acceptedIndicates an issue is ready to be actively worked on
    priority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to complete
    and removed
    triage/needs-triageIndicates an issue needs triage by a maintainer
    on Sep 23, 2026
  4. lexfrei commented on Sep 24, 2026

    @lexfrei
    ContributorAuthor

    The disagreement also goes the other way for a disk that waits for its first VM. With bindImmediately: false on a WaitForFirstConsumer class, the DataVolume rests in PendingPopulation or WaitForFirstConsumer, which #4380 counts as settled, so WorkloadsReady is True. The PVC is still Pending and isPVCReady checks bind state only, so the pvc-<name> Workload of the same monitor reads not operational. #4380 aligns that Workload with its DataVolume only when the DataVolume is not ready, so this direction stays. Reading a PVC controlled by a settled DataVolume as operational would close it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    area/apiIssues or PRs related to the cozystack-api aggregated API serverarea/storageIssues or PRs related to storage (linstor, seaweedfs, bucket, velero, harbor)kind/bugCategorizes issue or PR as related to a bugpriority/important-longtermImportant over the long term, but may not be staffed and/or may need multiple releases to completetriage/acceptedIndicates an issue is ready to be actively worked on

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions