qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: Eric Blake <eblake@redhat.com>
To: Paolo Bonzini <pbonzini@redhat.com>,
	"Prof. Dr. Michael Schefczyk" <michael@schefczyk.net>,
	qemu-devel <qemu-devel@nongnu.org>
Subject: Re: [Qemu-devel] "File too large" error from "qemu-img snapshot" (was Re: AW: Bug Repoting Directions Request)
Date: Wed, 19 Nov 2014 08:43:49 -0700	[thread overview]
Message-ID: <546CBAB5.8050202@redhat.com> (raw)
In-Reply-To: <546CAF2F.4090103@redhat.com>

[-- Attachment #1: Type: text/plain, Size: 2450 bytes --]

On 11/19/2014 07:54 AM, Paolo Bonzini wrote:
> On 19/11/2014 13:07, Prof. Dr. Michael Schefczyk wrote:
>> Yes! My level of knowledge is that one uses the qcow2 format in order
>> to be able to create live snapshots/backups. Otherwise one would tend
>> to use the more efficient raw format. Is this not correct and did I
>> apply the backup mechanism in the wrong way?
> 
> That's correct, but you still have to create live snapshots from within
> QEMU.

You absolutely CANNOT modify a qcow2 file via qemu-img or any other
external means while qemu is using the file in read-write mode, or you
risk file corruption (which appears to be what happened to you).
Monitor commands to the qemu process are the only supported means for
taking a live snapshot/backup of an in-use disk.

> 
> This is done with a QMP (QEMU Management Protocol) command like
> 
> { "execute": "blockdev-snapshot-internal-sync",
>                 "arguments": { "device": "ide-hd0",
>                                "name": "snapshot0" }
>    }
> 
> QMP is accessed through normal sockets, or via libvirt.
> 
> However, I'm not sure if running "qemu-img convert" on the resulting
> snapshot is possible though, and there is no equivalent of "qemu-img
> snapshot -d".

qemu-img snapshot -d can be achieved via the QMP monitor command
'human-monitor-command' forwarding to the HMP 'delvm' command.  But you
are correct that I don't know of any way to reproduce qemu-img convert
on a read-write image.

> 
> You can instead use QEMU's support for backup, which will do what you
> wanted directly while the VM is running.  For example:
> 
> { "execute": "drive-backup", "arguments": { "device": "ide-hd0",
>                                      "sync": "full", "format": "qcow2",
>                                      "target": "backup.img" } }
> 
> This does not even require qcow2 for the image.  The downside is that
> you must not turn off the VM until the job has completed.

Another option is to create a live snapshot (so that your file under
interest is now read-only with a temporary qcow2 overlay as the
read-write file), then you can do whatever you want with the file (such
as qemu-img convert), and finally do an active commit to get rid of the
temporary qcow2 overlay and back to just the main live image.

-- 
Eric Blake   eblake redhat com    +1-919-301-3266
Libvirt virtualization library http://libvirt.org


[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 539 bytes --]

  reply	other threads:[~2014-11-19 15:44 UTC|newest]

Thread overview: 14+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <2A6E6B95B6E5C146ACE8440760E58185BDC31A5E@EXCHANGESERVER.schefczyk.local>
     [not found] ` <546C782E.9070803@redhat.com>
     [not found]   ` <2A6E6B95B6E5C146ACE8440760E58185BDC31C30@EXCHANGESERVER.schefczyk.local>
2014-11-19 11:41     ` [Qemu-devel] "File too large" error from "qemu-img snapshot" (was Re: AW: Bug Repoting Directions Request) Paolo Bonzini
2014-11-19 11:48       ` Prof. Dr. Michael Schefczyk
2014-11-19 11:53         ` Paolo Bonzini
2014-11-19 12:07           ` Prof. Dr. Michael Schefczyk
2014-11-19 14:54             ` Paolo Bonzini
2014-11-19 15:43               ` Eric Blake [this message]
2014-11-19 17:32                 ` Prof. Dr. Michael Schefczyk
2014-11-19 18:13                   ` Eric Blake
2014-11-22 17:02                     ` Prof. Dr. Michael Schefczyk
2014-11-24 11:52                       ` Paolo Bonzini
2014-11-25 11:34                       ` Kevin Wolf
2014-11-25 11:49                         ` Prof. Dr. Michael Schefczyk
2014-11-24 10:32                     ` Kashyap Chamarthy
2014-11-19 14:05       ` Max Reitz

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=546CBAB5.8050202@redhat.com \
    --to=eblake@redhat.com \
    --cc=michael@schefczyk.net \
    --cc=pbonzini@redhat.com \
    --cc=qemu-devel@nongnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).