FreeBSD/Xen suspend/resume

Pratyush Yadav pratiy0100 at gmail.com
Mon Jan 21 09:08:44 UTC 2019


On Mon, 21 Jan 2019 at 12:07, Uni Gaia <unigaia at fastmail.jp> wrote:
>
> On 1/20/19 11:21 AM, Pratyush Yadav wrote:
> > Hey Uni,
> >
> > On 1/19/2019 4:59 AM, Uni Gaia wrote:
> >> Does anyone know if suspend/resume works for a FreeBSD/Xen dom0 ? domU?
> >
> > I'm guessing by suspend/resume you mean xl save and xl restore. They
> > work for FreeBSD domU (with Linux dom0), tested on 13-CURRENT r342020.
> > I have not tested for FreeBSD as dom0 because I do not have it set up.
>
> I am sorry, perhaps it wasn't clear enough.
>
> I mean the domU successfully restoring (and obviously, suspending
> properly in the first place) upon a dom0 suspend/resume cycle.
>
> For instance, with QubesOS, which is Linux/Xen based, all virtual
> machines resume working normally after suspending and resuming the machine.
>
> I am considering FreeBSD for a home project, and it requires
> virtualization (jails not enough).
>
> Because it makes no sense to keep the machine on 24/7 in this scenario,
> and because it would be cumbersome to shutdown the machine every night,
> I am looking for the possibility of suspending/resuming.
>
> I know this works with a Linux dom0 and at least Linux domUs.
>
> My preference is FreeBSD dom0 and domUs.
>
> But if FreeBSD dom0 fails to suspend/resume and domUs work, I might
> consider (reluctantly) Linux for the dom0 role.

AFAIK, FreeBSD does not support suspend/resume to disk at all [0], let
alone FreeBSD with Xen (someone correct me if I'm wrong). There is
support for suspending to RAM, but that is shaky from what I can
gather [1].

But you can look into Xen's save and restore features (xl save and xl
restore). They save/restore a domU to/from disk. So if in your setup
you can shut down your dom0, and saving states of domUs is enough, you
can set up a script to save your domUs to a file before shutdown and
get them running back up on boot.

Otherwise, you can look into bhyve, FreeBSD's virtualization solution.
I don't know if bhyve supports suspend and resuming of VMs, but you
can ask the folks at the freebsd-virtualization@ mailing list.



[0] https://wiki.freebsd.org/IdeasPage#Suspend_to_disk
[1] https://wiki.freebsd.org/SuspendResume

Regards,
Pratyush Yadav


More information about the freebsd-xen mailing list