From: Michael Weiser Subject: Consistent VM backup via snapshot Date: Thu, 16 Feb 2012 12:38:04 +0100 Message-ID: <20120216113804.GF30806@weiser.dinsnail.net> Mime-Version: 1.0 Content-Type: text/plain; charset=us-ascii To: kvm@vger.kernel.org Return-path: Received: from heinz.dinsnail.net ([87.106.246.128]:41419 "EHLO heinz.dinsnail.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751559Ab2BPMAK (ORCPT ); Thu, 16 Feb 2012 07:00:10 -0500 Received: from heinz.dinsnail.net (localhost [127.0.0.1]) by heinz.dinsnail.net (8.14.5/8.14.5) with ESMTP id q1GBcKwP007177 for ; Thu, 16 Feb 2012 12:38:20 +0100 Received: from eldalonde.UUCP (uucp@localhost) by heinz.dinsnail.net (8.14.5/8.14.5/Submit) with bsmtp id q1GBcKQa007176 for kvm@vger.kernel.org; Thu, 16 Feb 2012 12:38:20 +0100 Received: from eldalonde.weiser.dinsnail.net (localhost [127.0.0.1]) by eldalonde.weiser.dinsnail.net (8.14.5/8.14.5) with ESMTP id q1GBc5d6032229 for ; Thu, 16 Feb 2012 12:38:05 +0100 Received: (from michael@localhost) by eldalonde.weiser.dinsnail.net (8.14.5/8.14.5/Submit) id q1GBc48L032228 for kvm@vger.kernel.org; Thu, 16 Feb 2012 12:38:05 +0100 Content-Disposition: inline Sender: kvm-owner@vger.kernel.org List-ID: Hello, I am trying to backup a KVM VM by creating a snapshot of the running VM and extracting that snapshot from the running VM using qemu-img convert. Sources on the net suggest that I would get an image that contains all the machine state of the snapshot. So when I run the VM it would continue to run just where it was when the snapshot was created. But instead, when I run the VM with the converted image, the guest boots up and does a filesystem recovery just as if it had crashed. So the machine state information seems to go missing when extracting. Should this work or am I missing something? Would it instead be possible to create a snapshot of the running VM and then just rsync the qcow2 image file to the backup location while the VM is still running? This way, the snapshot inside the image with all state information of the running VM would stay intact and could be resumed. I tried this and it worked. I'm just not sure whether it would always work, that is: Is a snapshot guaranteed to stay consistent even when the VM is running on top of it and the image file is copied away from under it? -- Thank you, Micha