Repository navigation
Description
Problem Description
devops k8s volume move cannot move a claim of many small files to a ReadWriteMany volume of class longhorn, which Longhorn serves over NFS. Two parts fail:
- The copy of step 5 has a fixed bound,
DEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDS(3600 s,src/devops_cli/config/defaults.py). It does not look at the progress of the copy, so a copy that still moves data stops at the bound. - Before the second try, the move empties
/dstwithfind. On the NFS volume this fails withDirectory not empty, so the move cannot retry and undoes each step.
Evidence, 2026-11-28
The owner approved a Pod Security baseline window on devops, and the move ran from 02:42 to 04:02 UTC:
$ uv run devops k8s volume move devops/roadmap-service-home --storage-class longhorn --access-mode ReadWriteMany --size 10Gi
➔ The copy stopped (`the copy` did not end within 3600 s.). Empty /dst and copy one more time.
...
The move stopped at step 5: `kubectl exec roadmap-service-home-dst` exited 1: find: cannot delete '/dst/.data/roadmap/dan-petty/devops-cli/lanes/stage/openspec/changes/archive': Directory not empty
The claim holds about 3.5 GB in 313,327 entries, most of them in the git clones of the lanes. The undo worked: the old claim, its volume and deployment/roadmap-service are as before. Application devops stays OutOfSync on this claim (dan-petty/homelab#579), so no release of devops-cli reaches the cluster.
Expected Behavior
- The copy has no fixed bound while it makes progress: it stops only when the bytes on
/dstdo not grow for a set time, or the bound is a setting. - The retry starts from an empty volume in a way that works on NFS, for example by deleting and making again the new claim, not by emptying it with
find.
Acceptance Criteria
- A test: a copy that still grows past the old bound goes on, and a copy that does not grow for the stall time stops.
- A test: the retry of a copy to a
ReadWriteManyclaim does not runfind -deleteon it and starts from a new, empty claim. - Pending a person after the release: the move of
devops/roadmap-service-homeends with no difference in step 6.
Related
- dan-petty/homelab#579, feat(k8s): set the size of the new claim in volume move #7484 (
--size), fix(k8s): volume move copy pods fail Pod Security restricted #7449 (Pod Securityrestricted).
Alternatives check of 2026-11-28: in-use.
The repository already uses this tool.
Tool: utkuozdemir/pv-migrate (https://github.com/utkuozdemir/pv-migrate), Apache-2.0, last activity 2026-11-26, maintained.
Reason: Searches surfaced pv-migrate, an actively maintained PVC migration tool that copies claim data with rsync and works to NFS/ReadWriteMany destinations, so it covers the copy itself; it does not cover this issue's in-repo stall-based timeout and NFS-safe retry fix.
Covers:
- Rsync copy between two persistent volume claims
- Mount, SSH and load-balancer migration strategies
- Migration into ReadWriteMany or NFS destination claims
Lacks:
- No progress-stall timeout wired into the move command
- Does not implement the step 5 copy or its retry path
- No step 6 no-difference verification of the move
Proposed design
Problem statement
devops k8s volume move stops the step 5 copy at the fixed bound DEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDS (3600 s). On 2026-11-28 the copy of the devops/roadmap-service-home claim still ran at that bound, with 3.5 GB in 313,327 entries. PR #7518 already replaced the custom copy, its find -delete retry and the step 6 digest compare with a pv-migrate run. Only the fixed bound remains. The change makes that bound the setting k8s.volume_move_copy_timeout_seconds, so an operator raises it for a slow copy with no code change.
Acceptance criteria
Requirement: Copy bound from a setting
The volume move SHALL take the bound of the step 5 copy from the setting k8s.volume_move_copy_timeout_seconds.
Scenario: A raised bound reaches the pv-migrate run
- WHEN a test sets
k8s.volume_move_copy_timeout_secondsto 7200 and runs the move with a stub of_run_pv_migrate - THEN the stub records a timeout of 7200 s
Requirement: Default copy bound
The setting k8s.volume_move_copy_timeout_seconds MUST default to DEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDS.
Scenario: No value in the config
- WHEN a test loads the settings with no value for
k8s.volume_move_copy_timeout_seconds - THEN the setting reads 3600 s
Requirement: The bound must be positive
The settings model MUST refuse a value of zero or less for k8s.volume_move_copy_timeout_seconds.
Scenario: A value of zero
- WHEN a test loads the settings with
k8s.volume_move_copy_timeout_seconds: 0 - THEN the load fails with a validation error that names
k8s.volume_move_copy_timeout_seconds
Requirement: Help names the setting
The help of devops k8s volume move MUST name the setting k8s.volume_move_copy_timeout_seconds.
Scenario: Help of the move command
- WHEN a test renders the help of
devops k8s volume move - THEN the help text holds
k8s.volume_move_copy_timeout_seconds
Requirement: Pending a person after the merge
After the release, the move of devops/roadmap-service-home to a longhorn ReadWriteMany claim MUST end with exit code 0.
Scenario: Live move of the roadmap-service-home claim
- WHEN a person sets
k8s.volume_move_copy_timeout_secondsabove the copy time and runsuv run devops k8s volume move devops/roadmap-service-home --storage-class longhorn --access-mode ReadWriteMany --size 10Gion the released CLI - THEN the command exits 0
Existing Tool Considered
utkuozdemir/pv-migrate (Apache-2.0, last activity 2026-11-26), verdict in-use: the repository already uses it for the step 5 copy. The alternatives check of 2026-11-28 in the issue body records what the tool covers and lacks. The change adds the part that the check records as lacking: it wires the copy bound into the move command as the setting k8s.volume_move_copy_timeout_seconds, so the pv-migrate run gets the bound that the operator sets.
Key questions
- Which bound ends the step 5 copy of the volume move?: The setting
k8s.volume_move_copy_timeout_secondssets the bound, and the move passes it to the pv-migrate run. Its default isDEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDS(3600 s). An operator raises it for a claim of many small files. (best practice) [sources: src/devops_cli/k8s/volume_move.py, src/devops_cli/config/defaults.py:1371, src/devops_cli/config/settings.py, tests/k8s/test_k8s_volume_move.py]- Chosen: A setting for the copy bound. The operator raises the bound with no code change, and the Expected Behavior of the issue accepts this result.
- Rejected: Keep the constant
DEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDS. The copy of 3.5 GB in 313,327 entries still ran at 3600 s on 2026-11-28, so a constant with no setting cannot deliver the move. - Rejected: Watch the size of the destination claim and stop on a stall. PR refactor(k8s): replace the volume move copy with pv-migrate #7518 removed the
/dstcopy pod, so the move has no reader of the destination size, and a new poll pod rebuilds the mechanism that refactor(k8s): replace the volume move copy with pv-migrate #7518 removed.
- Which default does the setting hold?: The setting defaults to
DEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDS, 3600 s. A small claim keeps its current bound, and the operator raises the value for the large claim. (best practice) [sources: src/devops_cli/config/defaults.py:1371]- Chosen: Keep the default at 3600 s. The bound of a small claim does not change, and the operator raises the value for the claim of many small files.
- Rejected: Raise the default to 14400 s. The issue holds no measured copy time for a general default, and a larger default hides a hung copy for longer.
- Does the move keep its own retry of the copy with
find -delete?: No. PR refactor(k8s): replace the volume move copy with pv-migrate #7518 replaced the custom copy, the/dstcopy pod, thefind -deleteretry and the step 6 digest compare with one pv-migrate run. The change adds no retry and no step 6 compare. [sources: src/devops_cli/k8s/volume_move.py] - Where does the copy bound live today?: The constant
DEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDSis atsrc/devops_cli/config/defaults.py:1371.src/devops_cli/k8s/volume_move.pyis its only caller, at the timeout argument of the pv-migrate run. [sources: src/devops_cli/config/defaults.py:1371, src/devops_cli/k8s/volume_move.py] - Does a value of zero or less remove the bound?: No. The settings model refuses a value of zero or less for
k8s.volume_move_copy_timeout_seconds, so a stuck copy always ends at a bound. (best practice) [sources: src/devops_cli/config/settings.py]- Chosen: Refuse a value of zero or less. A bound always exists, so a stuck pv-migrate run ends and the move reports a failure.
- Rejected: Let zero mean no bound. A stuck copy would then run with no end, and no output shows that it is stuck.
Fit
Fits in one pull request.
Suspected block
None.
Dependencies
None.
Activity
dan-petty commentedon Nov 28, 2026
The failure blocks the release of devops-cli to the cluster because the app stays OutOfSync.Both target the volume move copy step, but #7498 replaces the copy with pv-migrate while this candidate fixes the existing copy's timeout and retry logic.devops-cli-service commentedon Nov 28, 2026
Next step: the alternatives check records a verdict. See the section Proposed design of the body.
devops-cli-service commentedon Nov 28, 2026
The result in the alternatives block of the issue body changed. Before this check: no check. A person decides what the new result means for the item.
Searches (10)
Tools considered:
Searches run:
Sources:
devops-cli-service commentedon Nov 28, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
dan-petty commentedon Nov 28, 2026
Cannot build #7532 as written on origin/main (48bac94): commit 2669c9e (PR #7518, #7498, included in v0.232.3 through v0.232.10) already replaced the custom step 5 copy, the /dst copy pod, the find -delete retry, and the step 6 digest compare in src/devops_cli/k8s/volume_move.py with pv-migrate (lines 1239-1276). The refined requirements still target the removed custom copy and retry and reject pv-migrate. Note that src/devops_cli/k8s/volume_move.py:1251 still passes fixed timeout=DEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDS (3600.0 s) to _run_pv_migrate, so please re-test devops/roadmap-service-home on v0.232.3+ and either re-scope #7532 for pv-migrate or close it as not planned.
3 remaining items
dan-petty commentedon Nov 28, 2026
Returning #7532 to refinement: PR #7518 (commit 2669c9e, merged 2026-11-28T03:17:18Z) already replaced the custom copy, retry loop, find -delete cleanup, and step 6 verification in src/devops_cli/k8s/volume_move.py with a single pv-migrate invocation (src/devops_cli/k8s/volume_move.py:1239-1276). The retry path and step 6 check named in the acceptance criteria no longer exist on origin/main; only the fixed timeout=DEFAULT_K8S_VOLUME_MOVE_COPY_TIMEOUT_SECONDS (3600s) on _run_pv_migrate remains if a slow pv-migrate transfer needs a progress/stall bound.
devops-cli-service commentedon Nov 29, 2026
Next step: the stage job writes the plan of the item. See the section Proposed design of the body.
fix(k8s): make volume move copy timeout configurable (#7532)
devops-cli-service commentedon Nov 29, 2026
Released in v0.247.0: https://github.com/dan-petty/devops-cli/releases/tag/v0.247.0
devops-cli-service commentedon Nov 29, 2026
Live since 2026-11-29 16:17 UTC