Repository navigation
fix(cloudhypervisor): a Windows clone or restore resumes from the snapshot's clock - #341
Draft
zili-simular wants to merge 1 commit into
Draft
zili-simular wants to merge 1 commit into
zili-simular wants to merge 1 commit into
Conversation
…pshot's clock Cloud Hypervisor advances the guest clock by the snapshot's age on restore, which moves a Windows guest's uptime forward by the same amount. When that jump is 2^31 to 2^32 ms (24.9 to 49.7 days), the guest can resume with its TCP retransmission timers stopped (cocoonstack/cloud-hypervisor#9). Send clock_catchup=false with vm.restore for a Windows clone and restore. The guest's date is then behind by the snapshot's age until something sets it in the guest. A migration receive still catches up, and a Cloud Hypervisor without the option ignores the field.
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
A Windows guest restored from a snapshot that is 24.9 to 49.7 days old can resume with its TCP retransmission timers stopped, because the restore moves its uptime forward by the snapshot's age (cocoonstack/cloud-hypervisor#9). This sends
clock_catchup=falsefor Windows guests, the option added in cocoonstack/cloud-hypervisor#10.vm migrate receivekeeps the catch-up: the gap is the seconds of the handoff, and catching up keeps the guest's date right.Evidence
One Windows 10 base snapshot, 28 days old, cloned with
--restore-mode copyon an AMD EPYC 7443P host. The probe counts the SYNs the guest sends to a blackholed address in 5.5 s; a healthy Windows guest sends three.After (this change, same Cloud Hypervisor): guest uptime 162 s, the date is the snapshot's, 3 SYNs at 0 s, 1 s and 3 s. 4 of 4 clones, two on each of two builds of that branch. After
Set-Datein the guest the date is correct and the probe still sees 3 SYNs.2ca4cb08, which does not know the field: the clone succeeds, uptime 28.02 days, 1 SYN. The field is ignored.TestRestoreAndResumeCloneKeepsAWindowsGuestClockchecks thevm.restorebody for a Linux clone, a Windows clone and a Windows migration receive.make fmt-check lintandgo vetfor linux and darwin are clean, andgo test -race ./hypervisor/...passes.The clones above ran this change applied to v0.7.1, the version on our hosts, not to master. Not run:
cocoon vm restoreon a real guest, and the full test suite.Merge Danger
Door: two-way
Blast Radius: Windows guests
Every Windows clone and restore then resumes with the snapshot's date, until something in the guest sets it. Our control plane sets the date over SSH after every clone and wake, so this is what we want. A deployment that relies on the restore for the date gets a guest that is days behind, and TLS fails there.
Open question for review: should this be opt-in (a flag on
vm cloneandvm restore), or should cocoon set the date through cocoon-agent before it re-attaches the NICs?