Bug 289848 - Enable by default BHYVE_SNAPSHOT
Summary: Enable by default BHYVE_SNAPSHOT
Status: New
Alias: None
Product: Base System
Classification: Unclassified
Component: bhyve (show other bugs)
Version: 16.0-CURRENT
Hardware: Any Any
: --- Affects Many People
Assignee: freebsd-virtualization (Nobody)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-09-26 00:00 UTC by Vladimir Druzenko
Modified: 2025-11-14 02:30 UTC (History)
7 users (show)

See Also:
vvd: mfc-stable15?


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Vladimir Druzenko freebsd_committer freebsd_triage 2025-09-26 00:00:00 UTC
Ideally, this change would be included in the 15.0 release.
Comment 1 Ed Maste freebsd_committer freebsd_triage 2025-10-22 16:32:54 UTC
Have you been able to use it? See Roman's post on freebsd-virtualization: https://lists.freebsd.org/archives/freebsd-virtualization/2025-October/003191.html
Comment 2 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-22 16:45:36 UTC
I can't check this until it's in the base. At least that's the case for now. :-(
Comment 3 Ed Maste freebsd_committer freebsd_triage 2025-10-22 17:15:13 UTC
From jhb's commit that imported it (483d953a86a2507355f8287c5107dc827a0ff516):

    While the current implementation is useful for several uses cases, it
    has a few limitations.  The file format for saving the guest state is
    tied to the ABI of internal bhyve structures and is not
    self-describing (in that it does not communicate the set of device
    models present in the system).  In addition, the state saved for some
    device models closely matches the internal data structures which might
    prove a challenge for compatibility of snapshot files across a range
    of bhyve versions.  The file format also does not currently support
    versioning of individual chunks of state.  As a result, the current
    file format is not a fixed binary format and future revisions to save
    and restore will break binary compatiblity of snapshot files.  The
    goal is to move to a more flexible format that adds versioning,
    etc. and at that point to commit to providing a reasonable level of
    compatibility.  As a result, the current implementation is not enabled
    by default.  It can be enabled via the WITH_BHYVE_SNAPSHOT=yes option
    for userland builds, and the kernel option BHYVE_SHAPSHOT.

It is intentionally not enabled by default at present, and it's unclear if it currently works, so it definitely won't be enabled by default in 15.0.
Comment 4 Vladimir Druzenko freebsd_committer freebsd_triage 2025-10-22 17:56:24 UTC
(In reply to Ed Maste from comment #3)
It doesn't matter. The VirtualBox I've been using on FreeBSD for about 15 years now also doesn't guarantee snapshot compatibility even between minor versions. For example, yesterday's release of 7.2.4 doesn't support saved states from 7.2.2.
But when I need to reboot the host system or perform a live migration, I don't need to shutdown the virtual machines. Without this feature, at least for me, bhyve is useless. :-(
I've been waiting for this since the release of FreeBSD 10.0…
Comment 5 Michael Osipov freebsd_committer freebsd_triage 2025-11-13 06:17:46 UTC
(In reply to Vladimir Druzenko from comment #4)

Fair argument.
Comment 6 Koichiro Iwao freebsd_committer freebsd_triage 2025-11-13 08:13:43 UTC
(In reply to Ed Maste from comment #3)

> it's unclear if it currently works, so it definitely won't be enabled by default in 15.0.

It basically works very well. 

With my vm-bhyve maintainer hat, I'm adding suspend/resume feature to the tool. I've also been testing bhyve snapshots a lot, as I'm working on adding suspend/resume support to vm-bhyve.


(In reply to Vladimir Druzenko from comment #4)
That sounds fair to me, too.
Comment 7 Roman Bogorodskiy freebsd_committer freebsd_triage 2025-11-13 17:15:17 UTC
(In reply to Koichiro Iwao from comment #6)

For me, resume doesn't work: https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=290735

If you got if working, I would appreciate a second pair of eyes to check if I'm doing something obviously wrong.
Comment 8 Aleksandr Fedorov freebsd_committer freebsd_triage 2025-11-13 17:46:46 UTC
We have it running in production on versions 13 and 14.

I think it's too late to enable BHYVE_SNAPSHOT for release 15.0. But it's possible to enable it for CURRENT with experimental status. Otherwise, if we don't enable this option by default, no one will test it.
Comment 9 Vladimir Druzenko freebsd_committer freebsd_triage 2025-11-13 18:09:50 UTC
(In reply to Aleksandr Fedorov from comment #8)
> if we don't enable this option by default, no one will test it.
Exactly!!!
Comment 10 Koichiro Iwao freebsd_committer freebsd_triage 2025-11-14 02:30:33 UTC
(In reply to Roman Bogorodskiy from comment #7)
Really? I'll test it further and get back to you at bug 290735.