From owner-freebsd-fs@FreeBSD.ORG Mon Dec 8 18:08:50 2014 Return-Path: Delivered-To: fs@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [8.8.178.115]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 70369685; Mon, 8 Dec 2014 18:08:50 +0000 (UTC) Received: from elvis.mu.org (elvis.mu.org [IPv6:2001:470:1f05:b76::196]) by mx1.freebsd.org (Postfix) with ESMTP id 5E732AD1; Mon, 8 Dec 2014 18:08:50 +0000 (UTC) Received: from [10.0.1.20] (c-76-21-10-192.hsd1.ca.comcast.net [76.21.10.192]) by elvis.mu.org (Postfix) with ESMTPSA id 346FB341F872; Mon, 8 Dec 2014 10:08:50 -0800 (PST) Subject: Re: backups of bhyve images Mime-Version: 1.0 (Apple Message framework v1283) Content-Type: text/plain; charset=us-ascii From: Alfred Perlstein In-Reply-To: <20141208163358.GA52969@potato.growveg.org> Date: Mon, 8 Dec 2014 10:08:52 -0800 Content-Transfer-Encoding: quoted-printable Message-Id: <33053EB5-91C5-4036-8CC2-34103E33A0FA@mu.org> References: <20141208163358.GA52969@potato.growveg.org> To: John X-Mailer: Apple Mail (2.1283) Cc: fs@freebsd.org, freebsd-virtualization@freebsd.org X-BeenThere: freebsd-fs@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Filesystems List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 08 Dec 2014 18:08:50 -0000 On Dec 8, 2014, at 8:33 AM, John wrote: > Hello list, >=20 > I have a few questions about creating backups to be stored offsite. >=20 > If a guest is running, can I compress the image without it becoming=20 > inconsistent? If not, can it be copied without it becoming = inconsistent? =20 > By inconsistent, I mean will I see weird effects and broken files if = the=20 > backup is restored? Previously I've shut the VM down to avoid this,=20 > before archiving. >=20 > I have each image on its own (external to the image) ZFS filesystem. =20= > Internally the image is using ufs if freebsd, ext3fs if linux. Would=20= > using some ZFS method of duplication be better? In this case, would = the=20 > image become inconsistent? >=20 > Basically, what I want to do is to run accurate backups without = shutting=20 > down and restarting the VM. Is this possible? If it isn't, I think the=20= > only alternative is to make a script that shuts the vm down, copies = it,=20 > restarts the vm then runs its compression and backup-over-ssh routine. [[ adding fs@freebsd.org in case I'm wrong ]] If you are using UFS internally to the VMs then you'll need to send a = snapshot that is consistent. If you are just copying the files out from under a running vm you are = going to get spaghettios for a filesystem if you try to recover as you = need a true point in time snapshot. I think a few better options would be: 1) Inside the VM create a UFS snapshot then dump that externally using = tools. 2) Create the UFS snapshot, then make sure that the file/vzol is = snapshotted using zfs. 3) Just snapshot the underlying zvol you've made the UFS image on and = send that (you'll get a dirty FS on restore, but it *should* be = recoverable with a simple fsck) =20 4) Use zfs internally to the vm and send/receive the internal zfs. option 3 is the least safe imo as you can wind up with filesystem = "angry". in case 1 and 2 you'll have UFS snapshots that should be "OK" to restore = from. in case 4 you are also doing snapshot, but you switch to ZFS. -Alfred