All of lore.kernel.org
 help / color / mirror / Atom feed
* [linux-lvm] efficiently copying snapshot data.
@ 2010-07-09 23:47 Michael Closson
  2010-07-10  0:38 ` Ray Morris
  0 siblings, 1 reply; 6+ messages in thread
From: Michael Closson @ 2010-07-09 23:47 UTC (permalink / raw)
  To: linux-lvm

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

Say I am using lvm to store VM disks.  I have a logical volume with the
master image and the vms are snapshots created from the master LV.

I want to save this VM, copy the memory and snapshot data to a different
machine with the same master LV, and then restore the VM.

Is it possible?  How can I efficiently copy only the snapshot?

Thanks,
Mike C

[-- Attachment #2: Type: text/html, Size: 451 bytes --]

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

* Re: [linux-lvm] efficiently copying snapshot data.
  2010-07-09 23:47 [linux-lvm] efficiently copying snapshot data Michael Closson
@ 2010-07-10  0:38 ` Ray Morris
  2010-07-10  1:01   ` Stuart D. Gathman
  0 siblings, 1 reply; 6+ messages in thread
From: Ray Morris @ 2010-07-10  0:38 UTC (permalink / raw)
  To: LVM general discussion and development

> How can I efficiently copy only the snapshot?

rsync.  Mount the snapshot, mount the copy of the source LV
on the other machine, and rsync from the snapshot to the copy.
You'll probably need to use "kpartx" to make the partitions
with the LVs visible.
--
Ray Morris
support@bettercgi.com

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php


On 07/09/2010 06:47:12 PM, Michael Closson wrote:
> Say I am using lvm to store VM disks.  I have a logical volume with  
> the
> master image and the vms are snapshots created from the master LV.
> 
> I want to save this VM, copy the memory and snapshot data to a  
> different
> machine with the same master LV, and then restore the VM.
> 
> Is it possible?  How can I efficiently copy only the snapshot?
> 
> Thanks,
> Mike C
> 

------quoted attachment------
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/

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

* Re: [linux-lvm] efficiently copying snapshot data.
  2010-07-10  0:38 ` Ray Morris
@ 2010-07-10  1:01   ` Stuart D. Gathman
  2010-07-10  1:14     ` Ray Morris
  2010-07-10 15:50     ` Alasdair G Kergon
  0 siblings, 2 replies; 6+ messages in thread
From: Stuart D. Gathman @ 2010-07-10  1:01 UTC (permalink / raw)
  To: LVM general discussion and development

On Fri, 9 Jul 2010, Ray Morris wrote:

> >How can I efficiently copy only the snapshot?
> 
> rsync.  Mount the snapshot, mount the copy of the source LV
> on the other machine, and rsync from the snapshot to the copy.
> You'll probably need to use "kpartx" to make the partitions
> with the LVs visible.

That doesn't do what he wants.  He wants to copy only the COW blocks.
He has physical servers with the same master LV for VMs on each,
and he wants to migrate a VM by copying only the blocks that have 
changed from the master LV.

The COW table is an LV, so it is probably doable with dmsetup: needs
to deactivate snapshot, turn COW table into a regular LV, and activate that.
Copy to a regular LV on the target system, and then do some dmsetup 
and metadata magic to turn the LV (which is a copy of a COW table) into a
snapshot of the master LV with the COW already populated.

I don't think such a utility exists.  Sounds like a good bounty project.

However, there are other projects designed to sync LVs remotely by
copying only changed blocks.  I believe that the ZumaStor extension
to LVM does what he wants.  ZumaStor will also make the multiple
snapshots of the master LV more efficient, especially when updating the master.
It keeps one shared COW for all snapshots.  Standard snapshots keep
a COW for each snapshot.

-- 
	      Stuart D. Gathman <stuart@bmsi.com>
    Business Management Systems Inc.  Phone: 703 591-0911 Fax: 703 591-6154
"Confutatis maledictis, flammis acribus addictis" - background song for
a Microsoft sponsored "Where do you want to go from here?" commercial.

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

* Re: [linux-lvm] efficiently copying snapshot data.
  2010-07-10  1:01   ` Stuart D. Gathman
@ 2010-07-10  1:14     ` Ray Morris
  2010-07-10 15:50     ` Alasdair G Kergon
  1 sibling, 0 replies; 6+ messages in thread
From: Ray Morris @ 2010-07-10  1:14 UTC (permalink / raw)
  To: LVM general discussion and development

> > rsync/

> That doesn't do what he wants.  He wants to copy only
> the COW blocks.

   The COW blocks being those that are different between the
master and the snapshot, correct?  Have I been doing it wrong
all of these years, because I was under the distinct impression
that rsync copied only the differences.

    Perhaps the confusion is here is whether he wants the destination
to include nothing but the changed the blocks, but that doesn't
require any new LVM programming.  If you want the destination to be
a snapshot, only the differences, just take a snapshot on the
new machine and rsync from the old snapshot to the new snapshot.
A very few blocks might get duplicated because of file level versus
block level, but in practice that hasn't seemed to be significant.
At least, not for our 160 or so VMs.
--
Ray Morris
support@bettercgi.com

Strongbox - The next generation in site security:
http://www.bettercgi.com/strongbox/

Throttlebox - Intelligent Bandwidth Control
http://www.bettercgi.com/throttlebox/

Strongbox / Throttlebox affiliate program:
http://www.bettercgi.com/affiliates/user/register.php

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

* Re: [linux-lvm] efficiently copying snapshot data.
  2010-07-10  1:01   ` Stuart D. Gathman
  2010-07-10  1:14     ` Ray Morris
@ 2010-07-10 15:50     ` Alasdair G Kergon
  2010-07-12 21:25       ` Michael Closson
  1 sibling, 1 reply; 6+ messages in thread
From: Alasdair G Kergon @ 2010-07-10 15:50 UTC (permalink / raw)
  To: LVM general discussion and development

On Fri, Jul 09, 2010 at 09:01:02PM -0400, Stuart D. Gathman wrote:
> Copy to a regular LV on the target system, and then do some dmsetup 
> and metadata magic to turn the LV (which is a copy of a COW table) into a
> snapshot of the master LV with the COW already populated.

> I don't think such a utility exists.

lvconvert -s  does this, regardless of what the man page might lead you
to believe!

Alasdair

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

* Re: [linux-lvm] efficiently copying snapshot data.
  2010-07-10 15:50     ` Alasdair G Kergon
@ 2010-07-12 21:25       ` Michael Closson
  0 siblings, 0 replies; 6+ messages in thread
From: Michael Closson @ 2010-07-12 21:25 UTC (permalink / raw)
  To: LVM general discussion and development

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

OK but can the two snapshots exist on different physical machines?

On Sat, Jul 10, 2010 at 11:50 AM, Alasdair G Kergon <agk@redhat.com> wrote:

> On Fri, Jul 09, 2010 at 09:01:02PM -0400, Stuart D. Gathman wrote:
> > Copy to a regular LV on the target system, and then do some dmsetup
> > and metadata magic to turn the LV (which is a copy of a COW table) into a
> > snapshot of the master LV with the COW already populated.
>
> > I don't think such a utility exists.
>
> lvconvert -s  does this, regardless of what the man page might lead you
> to believe!
>
> Alasdair
>
> _______________________________________________
> linux-lvm mailing list
> linux-lvm@redhat.com
> https://www.redhat.com/mailman/listinfo/linux-lvm
> read the LVM HOW-TO at http://tldp.org/HOWTO/LVM-HOWTO/
>

[-- Attachment #2: Type: text/html, Size: 1361 bytes --]

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

end of thread, other threads:[~2010-07-12 21:25 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2010-07-09 23:47 [linux-lvm] efficiently copying snapshot data Michael Closson
2010-07-10  0:38 ` Ray Morris
2010-07-10  1:01   ` Stuart D. Gathman
2010-07-10  1:14     ` Ray Morris
2010-07-10 15:50     ` Alasdair G Kergon
2010-07-12 21:25       ` Michael Closson

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.