1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-11-09 19:56:48 +00:00

fix(instances): a quiesced snapshot or live clone stops early on a silent guest agent

A quiesced snapshot and a live clone freeze the guest's file systems
through libvirt, which asks the agent without a timeout: with the agent
hung, the job waited, holding the VM, with no end.

The agent must now first answer a guest-ping within 10 s; a frozen or
dead agent fails the job in seconds, before anything is frozen. The
freeze itself stays libvirt's, without a timeout: a timed freeze was
tried and left the guest frozen, since the freeze still ran in the
guest when the agent came back, after its thaw had failed.
This commit is contained in:
catborise 2026-10-25 16:35:51 +03:00
parent 9c86e75c36
commit 37422d81b3
3 changed files with 40 additions and 3 deletions

View file

@ -1668,6 +1668,7 @@ class wvmInstance(wvmConnect):
if not memory:
flags |= VIR_DOMAIN_SNAPSHOT_CREATE_DISK_ONLY
if quiesce:
self.ping_agent()
flags |= VIR_DOMAIN_SNAPSHOT_CREATE_QUIESCE
self._snapshotCreateXML(xml, flags)
self._refresh_pools_after_snapshot()
@ -2259,7 +2260,15 @@ class wvmInstance(wvmConnect):
def abort_backup(self):
self.instance.abortJob()
def ping_agent(self):
"""A frozen or dead agent fails here in AGENT_TIMEOUT seconds. The
freeze that follows is libvirt's, without a timeout: a timed freeze
could still end in the guest after its thaw failed, leaving the guest
frozen."""
agent_command(self.instance, "guest-ping")
def fs_freeze(self):
self.ping_agent()
self.instance.fsFreeze(None, 0)
def fs_thaw(self):