time ABI: extend maximum snapshot downtime to one year
Maintainers usually reply within 1 day
Nobody has claimed this yet.
Assessment
- Difficulty
- 5/5
- Estimated time
- Over a week
- Newbie friendliness
- 25/100
- Issue type
- Feature
- Clarity
- Clearly specified
- Activity status
- Active
- Domain
- backend, infrastructure
Research direction
Start with vmm_core/virt/src/time_abi/downtime.rs and guest/common/nvx-time.c, then review the boundary cases in scripts/test_guest_time.py and the compatibility decision for older snapshots. Read the time ABI and snapshot design documents before changing the contract. Done means the 365-day boundary, D + Q behavior, and hook-based restore qualification are covered, with the required documentation updated.
Written by the indexing model from the issue text.
Description
Problem
NVX time ABI v1 currently accepts snapshot downtime D only when 0 <= D <= 30 days. A restore after that boundary fails before any guest vCPU runs with E_DOWNTIME_EXCESSIVE.
This is also an artifact-retention limit: restores always measure from the original capture anchor, repeated restores do not renew it, and OpenVMM does not allow a restored microVM to capture a replacement snapshot. An artifact that crosses the boundary is therefore permanently unusable.
The 30-day value is a policy bound, not a demonstrated clock-repair or representation limit. We should extend it for longer-lived snapshot artifacts.
Proposed direction
Increase the maximum accepted downtime to exactly 365 days:
31,536,000seconds31,536,000,000,000,000nanoseconds- retain the inclusive boundary and
E_DOWNTIME_EXCESSIVEfor values above it - define this as a fixed duration, not a calendar-year anniversary
Do not remove the upper bound entirely. An unbounded policy would expose several unrelated implicit limits whose effective boundary depends on the snapshot's TSC frequency and timestamp:
u64downtime in nanoseconds: about 584 years- signed Linux
ktime_t: about 292 years - at the maximum accepted 10 GHz TSC rate, half-counter ambiguity begins around 29 years and the TSC wraps around 58 years
- restore UTC must fit the guest packet's signed-nanosecond checks
A fixed one-year limit has wide headroom below all of these.
Feasibility findings
One year fits the existing representations and checked arithmetic with substantial margin:
- restore packet downtime: about 0.171% of
u64 - TSC advance at 10 GHz: about 1.71% of
u64 - LAPIC ticks at 1 GHz: about 0.171% of
u64 - VM time in 100 ns units: about 0.00171% of
u64 - RTC millisecond advance: negligible relative to
i64
The host paths already use u128 or checked arithmetic for TSC, LAPIC, and RTC advancement. Linux 6.18 timekeeping consumes large clocksource deltas logarithmically, updates missed jiffies arithmetically, and advances the timer wheel by pending buckets rather than iterating over every elapsed tick. The NVX guest uses HZ=100; its timer wheel's ordinary range is already about 15 days, so the current 30-day contract already exercises the overdue-timer path.
One remaining qualification gap is scheduler accounting: sched_clock uses the raw TSC, so a simulated one-year restore must prove that process runtime, scheduler statistics, and cgroup CPU accounting do not incorrectly charge frozen workload tasks for the downtime.
Required changes
OpenVMM
- Raise
vmm_core/virt/src/time_abi/downtime.rs::MAX_DOWNTIME_NSto 365 days. - Preserve negative-downtime and target-overflow checks.
- Update boundary and LAPIC arithmetic tests.
- Update
Guide/src/user_guide/openvmm/snapshots.md. - Account for the VM-time cut work being promoted by #491: both anchor downtime
Dand combined VM-time downtimeD + Qmust remain bounded, with the exact boundary semantics documented.
NVX guest and integration
- Raise
guest/common/nvx-time.c::DOWNTIME_LIMIT_NSand update its diagnostic. - Update
scripts/test_guest_time.pypacket-boundary cases. - Update
doc/design/time-abi.md,doc/design/snapshot-and-restore.md, and CI documentation. - Update the excessive-downtime test hook case from
2592001seconds to the new boundary plus one. - Add a hook-based one-year restore qualification; do not wait one year in real time.
Compatibility
Changing only OpenVMM is insufficient: a snapshot containing the old guest still rejects a restore packet above 30 days with G_REPAIR_PACKET.
The one-year guarantee should therefore apply only to snapshots captured with both the updated guest and updated OpenVMM. Before implementation, decide and document whether this requires a time-ABI version/capability change or whether release-level compatibility metadata is sufficient. Do not claim that existing artifacts acquire the longer retention period automatically.
Acceptance criteria
- Exactly 365 days is accepted by both OpenVMM and the guest; 365 days plus one nanosecond (or the narrowest testable increment) is rejected with the expected stable code.
- A simulated 365-day restore succeeds on KVM, MSHV, and WHP at 1 and 8 vCPUs.
- Normal and expedited RCU configurations pass, including the debug kernel's stall, soft-lockup, and hung-task detectors.
- Guest monotonic/boottime advances by the simulated downtime and realtime converges to host UTC.
- Warp probes and time ABI restore checks pass after the jump.
- Expired kernel timers are handled without an unbounded restore/readiness delay.
- Process CPU time, scheduler runtime/statistics, and cgroup CPU accounting do not charge frozen workloads for the downtime.
- Same-boot monotonic-source and simulated cross-boot/cross-host UTC-source restores both pass.
- The
D + Qboundary from #491 is covered, including exact-boundary and overflow cases. - Documentation states that the limit is a fixed 365-day duration and explains compatibility with older snapshots.
Out of scope
Removing the upper bound entirely. That should not be considered without a separate contract and qualification effort covering all implicit TSC, kernel-time, UTC, and serialization limits.
- Dominant language
- Python
- Stars
- 380
- Forks
- 24
- Avg merge
- 12h 2m
- Merged PRs (30d)
- 291
Getting set up
This project ships no dev container, Dockerfile or contributing guide, so setting up is up to you: start from its README, and see our first-contribution guide for the general steps.
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from microsoft/nvx
-
bug-hunt confirmed
Difficulty 2/5 1-3 hours Newbie friendliness 76/100
Maintainers usually reply within 1 day
-
Track host telemetry bugs: Azure metadata trickles bypass timeoutPossibly taken @jay23606 claimed this 1 day ago. Openbug-hunt confirmed
Difficulty 3/5 1-2 days Newbie friendliness 66/100
Maintainers usually reply within 1 day
-
bug-hunt confirmed
Difficulty 4/5 3-5 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
-
bug-hunt confirmed
Difficulty 4/5 3-5 days Newbie friendliness 48/100
Maintainers usually reply within 1 day
-
bug-hunt confirmed
Difficulty 3/5 1-2 days Newbie friendliness 55/100
Maintainers usually reply within 1 day
Similar issues
-
Difficulty 2/5 1-3 hours Newbie friendliness 82/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 70/100
onyx-dot-app/onyx#16016 ·
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 1 day
-
black --check exits 0 and prints All done when a multi file run is interruptedPossibly taken @jiteshgulati claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
Maintainers usually reply within 2 days
-
Non-positive worker counts wait for results without starting workersPossibly taken @IlyaKhalafi claimed this today. Open
Difficulty 2/5 1-3 hours Newbie friendliness 85/100
Maintainers usually reply within 1 day