public inbox for kvm@vger.kernel.org
 help / color / mirror / Atom feed
* making snapshots with raw devices? and some general snapshot thoughts
@ 2009-02-25 13:20 Tomasz Chmielewski
  2009-02-25 14:10 ` Javier Guerra
  2009-02-25 15:44 ` Anthony Liguori
  0 siblings, 2 replies; 6+ messages in thread
From: Tomasz Chmielewski @ 2009-02-25 13:20 UTC (permalink / raw)
  To: kvm@vger.kernel.org

Is it possible to make snapshots when using raw devices (i.e. disk, 
partition, LVM volume) as guest's disk image?

According to documentation[1] (and some tests I made) it is only 
possible with qcow2 images. Which makes it very inflexible:

- one is forced to use a potentially slower file access
- one can't use the benefits of i.e. iSCSI disk access, SAN etc.


Also, according to the documentation, "VM snapshots are snapshots of the 
complete virtual machine including CPU state, RAM, device state and the 
content of all the writable disks".

Which leads to another observation: in some situations what one really 
needs is to "pause" execution of guest from within the host (i.e. 
because you want to shutdown or reboot the host due to a kernel or 
hardware upgrade).
After all changes on host are done, "guest" should be resumed without 
even knowing it was paused (most likely it will loose network connections).

This is how it's done with Xen or other virtualization solutions - they 
only save RAM, CPU, device state to a separate file; they don't save the 
content of all disks, because it's normally not needed for "pausing" guests.

Is it possible to do it with KVM?



[1] http://bellard.org/qemu/qemu-doc.html#SEC18


-- 
Tomasz Chmielewski
http://wpkg.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: making snapshots with raw devices? and some general snapshot thoughts
  2009-02-25 13:20 making snapshots with raw devices? and some general snapshot thoughts Tomasz Chmielewski
@ 2009-02-25 14:10 ` Javier Guerra
  2009-02-25 14:31   ` Tomasz Chmielewski
  2009-02-25 15:44 ` Anthony Liguori
  1 sibling, 1 reply; 6+ messages in thread
From: Javier Guerra @ 2009-02-25 14:10 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: kvm@vger.kernel.org

On Wed, Feb 25, 2009 at 8:20 AM, Tomasz Chmielewski <mangoo@wpkg.org> wrote:
> Is it possible to make snapshots when using raw devices (i.e. disk,
> partition, LVM volume) as guest's disk image?
>
> According to documentation[1] (and some tests I made) it is only possible
> with qcow2 images. Which makes it very inflexible:
>
> - one is forced to use a potentially slower file access
> - one can't use the benefits of i.e. iSCSI disk access, SAN etc.

what about using 'good' block devices, and add one small, mostly empty
qcow2? could it be used to store the snapshot for all?  of course it
would degrade performance while it's active, but should revert after
'commiting' it to the 'real' block device(s)



-- 
Javier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: making snapshots with raw devices? and some general snapshot thoughts
  2009-02-25 14:10 ` Javier Guerra
@ 2009-02-25 14:31   ` Tomasz Chmielewski
  2009-02-25 14:33     ` Javier Guerra
  0 siblings, 1 reply; 6+ messages in thread
From: Tomasz Chmielewski @ 2009-02-25 14:31 UTC (permalink / raw)
  To: Javier Guerra; +Cc: kvm@vger.kernel.org

Javier Guerra schrieb:
> On Wed, Feb 25, 2009 at 8:20 AM, Tomasz Chmielewski <mangoo@wpkg.org> wrote:
>> Is it possible to make snapshots when using raw devices (i.e. disk,
>> partition, LVM volume) as guest's disk image?
>>
>> According to documentation[1] (and some tests I made) it is only possible
>> with qcow2 images. Which makes it very inflexible:
>>
>> - one is forced to use a potentially slower file access
>> - one can't use the benefits of i.e. iSCSI disk access, SAN etc.
> 
> what about using 'good' block devices, and add one small, mostly empty
> qcow2? could it be used to store the snapshot for all?  of course it
> would degrade performance while it's active, but should revert after
> 'commiting' it to the 'real' block device(s)

It doesn't work for me - I get:

qm> savevm 1
Error while creating snapshot on 'virtio0'

Where "virtio0" is my "real" block device. I guess it still wants to 
write a snapshot there, as outlined in the documentation:

    "The VM state info is stored in the first qcow2 non removable and
     writable block device. The disk image snapshots are stored in every
     disk image."

Or, am I making a mistake here?

Besides:
- guest will see this second device - not needed
- still, we save the state of disks, but we don't need it for tasks like 
"pausing guest, upgrading kernel on host, rebooting host, resuming guest"


-- 
Tomasz Chmielewski
http://wpkg.org


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: making snapshots with raw devices? and some general snapshot thoughts
  2009-02-25 14:31   ` Tomasz Chmielewski
@ 2009-02-25 14:33     ` Javier Guerra
  0 siblings, 0 replies; 6+ messages in thread
From: Javier Guerra @ 2009-02-25 14:33 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: kvm@vger.kernel.org

On Wed, Feb 25, 2009 at 9:31 AM, Tomasz Chmielewski <mangoo@wpkg.org> wrote:
>   "The VM state info is stored in the first qcow2 non removable and
>    writable block device. The disk image snapshots are stored in every
>    disk image."
>
> Or, am I making a mistake here?

ah, i misremembered that.


-- 
Javier

^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: making snapshots with raw devices? and some general snapshot thoughts
  2009-02-25 13:20 making snapshots with raw devices? and some general snapshot thoughts Tomasz Chmielewski
  2009-02-25 14:10 ` Javier Guerra
@ 2009-02-25 15:44 ` Anthony Liguori
  2009-02-25 16:11   ` Tomasz Chmielewski
  1 sibling, 1 reply; 6+ messages in thread
From: Anthony Liguori @ 2009-02-25 15:44 UTC (permalink / raw)
  To: Tomasz Chmielewski; +Cc: kvm@vger.kernel.org

Tomasz Chmielewski wrote:
> Is it possible to make snapshots when using raw devices (i.e. disk, 
> partition, LVM volume) as guest's disk image?
>
> According to documentation[1] (and some tests I made) it is only 
> possible with qcow2 images. Which makes it very inflexible:
>
> - one is forced to use a potentially slower file access
> - one can't use the benefits of i.e. iSCSI disk access, SAN etc.
>
>
> Also, according to the documentation, "VM snapshots are snapshots of 
> the complete virtual machine including CPU state, RAM, device state 
> and the content of all the writable disks".
>
> Which leads to another observation: in some situations what one really 
> needs is to "pause" execution of guest from within the host (i.e. 
> because you want to shutdown or reboot the host due to a kernel or 
> hardware upgrade).
> After all changes on host are done, "guest" should be resumed without 
> even knowing it was paused (most likely it will loose network 
> connections).
>
> This is how it's done with Xen or other virtualization solutions - 
> they only save RAM, CPU, device state to a separate file; they don't 
> save the content of all disks, because it's normally not needed for 
> "pausing" guests.
>
> Is it possible to do it with KVM?

In monitor:

(qemu) stop
(qemu) migrate exec:dd of=state.img

reboot machine

qemu -incoming exec:dd if=state.img -other -options

Regards,

Anthony Liguori
>
>
> [1] http://bellard.org/qemu/qemu-doc.html#SEC18
>
>


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: making snapshots with raw devices? and some general snapshot thoughts
  2009-02-25 15:44 ` Anthony Liguori
@ 2009-02-25 16:11   ` Tomasz Chmielewski
  0 siblings, 0 replies; 6+ messages in thread
From: Tomasz Chmielewski @ 2009-02-25 16:11 UTC (permalink / raw)
  To: Anthony Liguori; +Cc: kvm@vger.kernel.org

Anthony Liguori schrieb:

>> Is it possible to do it with KVM?
> 
> In monitor:

Works great - thanks!

Small corrections below.


> (qemu) stop
> (qemu) migrate exec:dd of=state.img

Gives me:

qm> migrate exec:dd of=state.img
migrate: extraneous characters at the end of line

Should be:
qm> migrate "exec:dd of=state.img"

> reboot machine
> 
> qemu -incoming exec:dd if=state.img -other -options

Should be:

qemu -incoming "exec:dd if=state.img" -other -options


-- 
Tomasz Chmielewski
http://wpkg.org

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2009-02-25 16:10 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-02-25 13:20 making snapshots with raw devices? and some general snapshot thoughts Tomasz Chmielewski
2009-02-25 14:10 ` Javier Guerra
2009-02-25 14:31   ` Tomasz Chmielewski
2009-02-25 14:33     ` Javier Guerra
2009-02-25 15:44 ` Anthony Liguori
2009-02-25 16:11   ` Tomasz Chmielewski

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox