From mboxrd@z Thu Jan 1 00:00:00 1970 From: Kevin Wolf Subject: Re: Swap virtio images Date: Wed, 06 Jun 2012 16:27:27 +0200 Message-ID: <4FCF68CF.3060008@redhat.com> References: Mime-Version: 1.0 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit Cc: kvm@vger.kernel.org To: "Iain J. Watson" Return-path: Received: from mx1.redhat.com ([209.132.183.28]:46708 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751981Ab2FFO1b (ORCPT ); Wed, 6 Jun 2012 10:27:31 -0400 In-Reply-To: Sender: kvm-owner@vger.kernel.org List-ID: Am 06.06.2012 15:35, schrieb Iain J. Watson: > Hello, > > I am trying to find a way to use backing files to make snapshots of > running VMs. The idea is I pause the VM, use qemu-img to create a new > disk file with the currently used file as a backing file, swap the > images then unpause the VM. > > Commands would be something like: > > ---------- > (qemu) stop > (qemu) drive_del virtio0 > > $ qemu-img create -f qcow2 -b os-disk-0.qcow2 os-disk-1.qcow2 > > (qemu) drive_add 0 file=os-disk-1.qcow2 # I'm not 100% sure on the > drive_add syntax > (qemu) c > ---------- > > If I try and do this just now I get the error "Can't hot-add drive to > type 7" when running the drive_add command. > > Is there another way to achieve this? Is this something that could > potentially be added or would architecture not support what I'm trying > to do? You're looking for the 'snapshot_blkdev' monitor command: (qemu) snapshot_blkdev virtio0 os-disk1.qcow2 qcow2 Kevin