From owner-freebsd-virtualization@freebsd.org Mon Jan 21 09:08:44 2019 Return-Path: Delivered-To: freebsd-virtualization@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id 86BA4149EDDC; Mon, 21 Jan 2019 09:08:44 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: from mail-ed1-x544.google.com (mail-ed1-x544.google.com [IPv6:2a00:1450:4864:20::544]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (Client CN "smtp.gmail.com", Issuer "Google Internet Authority G3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 6E05D76C36; Mon, 21 Jan 2019 09:08:43 +0000 (UTC) (envelope-from pratiy0100@gmail.com) Received: by mail-ed1-x544.google.com with SMTP id o10so15912971edt.13; Mon, 21 Jan 2019 01:08:43 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=JQuR0889vGsLY0owu3Bq9XypPaRStLwQ2OjoHhxc5l4=; b=QqzK0HAjnDA/3fY9UWePAP01q01791bYU07zGHy+oL+aK5J6Bv/gLEMSlKF2iz6en/ 3/Nf7vFcuReXYGMSPiE7G3W3GFVW/KRD2WBUN7OazHI8VQurnRD5oQ2mzzpluirxoRi9 QX/aPAsD+hYs0bKbpdK+DqtZthIqR/N+bV6SdlKksjZA9kD6nNyjlGDIwB5j31UsPIrg RSSDESMP33Kwue0JJLxBU1WjyaTnsC0wHEnnJTp12bPofCioGGYHOgSe7sgRT9fIMI0T EZ/UdxQhoMXBW5vAyfkLAzuvlrk2Gw6IZ6oPyWy6hNYJk90ylBJex84kKFBmT0DkfwvF /ehg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=JQuR0889vGsLY0owu3Bq9XypPaRStLwQ2OjoHhxc5l4=; b=OMBBW0irogZxI/xdJXSXYx+fqMxKwp67SNTg/gu3s1LuQmQZs1gvq0y0AihkqLO6AH se4PAKXhn/KHqDYO49g1IMpq0gIC25bmqZrkfJfoQjEtp3HiFfUaMd8CO65E834ehU8A vlDMUuBxB8tNQbFgPKqLkgZc1pQzLv2eaSAstHcFIuRB2yaaYiTfUmatP8ikqGj0VgaO z5cNIkGYxDGMkKu4hVSUQpkzuPbl5RqpxLOrjbZUUP3i2JYctLds5wEIMexjCOIebeMP YH5WQLO+V7K0Xi/d3DYarLpAGk4J1oCrHCx148PKkzP1M/fZ//eP+ev7f9/GewByNhlB bUcA== X-Gm-Message-State: AJcUukeXujke1nBxFp0dHJ0EQ3+SXC879R6qQlRG4W3Dw7sOcI6N1CxX y8UkYJZwkxNgOgreR01NBVvD6zGjH2B7syXuumA= X-Google-Smtp-Source: ALg8bN4/FrZa7m6MKaide2MFvsKKGmx5nBNd4Y0Cgk8aYSyRSwJS0K9LLA9lev+JHaUhs3tdhyC0uABz5jrd+6TkjFE= X-Received: by 2002:a05:6402:8d2:: with SMTP id d18mr26562567edz.119.1548061722283; Mon, 21 Jan 2019 01:08:42 -0800 (PST) MIME-Version: 1.0 References: <8eacf0ad-e8e7-c76e-08b8-3b9a4564a291@fastmail.jp> <7a2cebf8-f29c-ec72-52b9-23bdf7489c58@shrew.net> <744cbbfe-a87f-1bae-df4c-f604deece104@fastmail.jp> In-Reply-To: <744cbbfe-a87f-1bae-df4c-f604deece104@fastmail.jp> From: Pratyush Yadav Date: Mon, 21 Jan 2019 14:38:05 +0530 Message-ID: Subject: Re: FreeBSD/Xen suspend/resume To: Uni Gaia Cc: FreeBSD-Xen , freebsd-virtualization@freebsd.org Content-Type: text/plain; charset="UTF-8" X-Rspamd-Queue-Id: 6E05D76C36 X-Spamd-Bar: ---- Authentication-Results: mx1.freebsd.org; dkim=pass header.d=gmail.com header.s=20161025 header.b=QqzK0HAj; dmarc=pass (policy=none) header.from=gmail.com; spf=pass (mx1.freebsd.org: domain of pratiy0100@gmail.com designates 2a00:1450:4864:20::544 as permitted sender) smtp.mailfrom=pratiy0100@gmail.com X-Spamd-Result: default: False [-4.58 / 15.00]; ARC_NA(0.00)[]; NEURAL_HAM_MEDIUM(-1.00)[-1.000,0]; R_DKIM_ALLOW(-0.20)[gmail.com:s=20161025]; FROM_HAS_DN(0.00)[]; RCPT_COUNT_THREE(0.00)[3]; FREEMAIL_FROM(0.00)[gmail.com]; R_SPF_ALLOW(-0.20)[+ip6:2a00:1450:4000::/36]; MIME_GOOD(-0.10)[text/plain]; RCVD_TLS_LAST(0.00)[]; NEURAL_HAM_LONG(-1.00)[-1.000,0]; TO_DN_SOME(0.00)[]; NEURAL_HAM_SHORT(-0.75)[-0.747,0]; TO_MATCH_ENVRCPT_SOME(0.00)[]; DKIM_TRACE(0.00)[gmail.com:+]; DMARC_POLICY_ALLOW(-0.50)[gmail.com,none]; RCVD_IN_DNSWL_NONE(0.00)[4.4.5.0.0.0.0.0.0.0.0.0.0.0.0.0.0.2.0.0.4.6.8.4.0.5.4.1.0.0.a.2.list.dnswl.org : 127.0.5.0]; MX_GOOD(-0.01)[cached: alt3.gmail-smtp-in.l.google.com]; IP_SCORE(-0.83)[ip: (-0.07), ipnet: 2a00:1450::/32(-2.14), asn: 15169(-1.85), country: US(-0.08)]; FREEMAIL_TO(0.00)[fastmail.jp]; FROM_EQ_ENVFROM(0.00)[]; MIME_TRACE(0.00)[0:+]; FREEMAIL_ENVFROM(0.00)[gmail.com]; ASN(0.00)[asn:15169, ipnet:2a00:1450::/32, country:US]; RCVD_COUNT_TWO(0.00)[2]; DWL_DNSWL_NONE(0.00)[gmail.com.dwl.dnswl.org : 127.0.5.0] X-BeenThere: freebsd-virtualization@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: "Discussion of various virtualization techniques FreeBSD supports." List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 21 Jan 2019 09:08:44 -0000 On Mon, 21 Jan 2019 at 12:07, Uni Gaia 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