<div class="gmail_quote">On Fri, Jun 8, 2012 at 10:56 AM, Benjamin S. Scarlet <span dir="ltr"><<a href="mailto:scarlet@alum.mit.edu" target="_blank">scarlet@alum.mit.edu</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">

Is there or could there be support for writing to a snapshot<br>
copy-on-write device from userspace? Are the bits contained therein<br>
portable between two snapshot instances with the same sizes of origin<br>
and copy-on-write devices?<br>
<br>
I tried a simple experiment and caused Very Bad Things to happen (a<br>
kernel error claiming "BUG: Bad page state in process ..."), but I may<br>
have done something bogus. Before I proceeded with further experiments,<br>
I thought I'd ask what, if anything, ought to work.<br>
<br>
My ultimate goal is to reduce downtime while migrating a virtual guest<br>
with its storage from one host to another. To that end what I'd like to<br>
do is:<br>
*) take a snapshot<br>
*) transfer the frozen view of the snapshot while the guest continues to<br>
run<br>
*) stop the guest on the original host<br>
*) transfer the deltas that have been written since the snapshot<br>
*) start the guest on the new host<br>
*) merge the deltas (assuming they weren't already merged during the<br>
transfer, depending on how that was done)<br>
<br>
So please consider the following experiment, expressed mostly in terms<br>
of lvm tools rather than dmsetup, just because this way I think I'm<br>
giving myself fewer chances to mess up:<br>
<br>
1) create an LVM volume A to play the role of the original volume. Fill<br>
it up with some data.<br>
2) create an LVM snapshot of A, A-snap.<br>
3) create an LVM volume B to play the role of the destination volume,<br>
the same size as A.<br>
4) copy (e.g. dd) from A into B, and simultaneously write some changes<br>
into A-snap.<br>
5) create an LVM snapshot of B, B-snap.<br>
5.5) cross your fingers 'cause here I'm heading into the unknown (for<br>
me)<br>
6) dmsetup suspend something (if any variant would work, could someone<br>
tell me what?)<br>
7) copy bits from A-snap-cow to B-snap-cow<br>
8) dmsetup resume<br>
9) diff A-snap and B-snap and observe they're the same! (or so I would<br>
like)<br>
10) proceed to use lvm to merge B-snap into B<br></blockquote><div><br></div><div>Would mirroring A to B work for this?</div><div><br></div><div>       --Fred </div></div><br>