<div dir="ltr">Hi Eric,<div><br></div><div>Please see the blew:<br><div class="gmail_extra"><br><div class="gmail_quote">On Wed, Feb 11, 2015 at 3:12 PM, Eric Blake <span dir="ltr"><<a href="mailto:eblake@redhat.com" target="_blank">eblake@redhat.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><span class="">On 02/11/2015 02:07 PM, Edward Young wrote:<br>
>>> What if this vm has a number of disk-only external snapshots? In the<br>
>>> current version, how can live migrate this vm?<br>
>><br>
>> Are the snapshots based on shared storage, or local-only storage?<br>
>><br>
><br>
> Yes, I'm talking about the local-only storage.<br>
<br>
</span>Okay, glad I guessed as much, then.<br>
<span class=""><br>
><br>
> Yes, I agree with you. In this case, we need to migrate the entire disk<br>
> state. In this case, there is no snapshot involved. we just perform the<br>
> regular migration with 'virsh migrate....'. Is this correct?<br>
<br>
</span>Using 'virsh migrate --copy-storage-all' would indeed migrate the entire<br>
disk, if you can't supply shared storage.<br>
<span class=""><br>
>>> Or is it possible to iteratively transfer all the snapshots to the<br>
>>> destination and later live migrate only the latest new data?<br>
>>><br>
>><br>
>> Yes, that works too, and is probably faster, especially if you have<br>
>> out-of-band means for sharing read-only state between source and<br>
>> destination.<br>
>><br>
><br>
> My question is here. If we do not have any shared storage resource between<br>
> source and destination (eg. long distance VM migration), how can we migrate<br>
> the latest new data to the destination? we can copy the base, mid to<br>
> destination manually, then how can we migrate the active snapshot( new data<br>
> goes in)? I learned that drive_mirror in qemu is built to finish this, but<br>
> do not understand clearly. Could you elaborate for me, or provide an<br>
> example?<br>
<br>
</span>Use 'virsh migrate --copy-storage-inc' to migrate only the incremental<br>
changes, which assumes that the destination can already see the same<br>
read-only backing data that the source sees. </blockquote><div><br></div><div>I perform a simple test, but failed. </div><div><br></div><div>In the source, I create:   base <- mid <- active (2 snapshots, the active one is the current one)</div><div>In order to migrate this vm to the destination, I manually copy both base and mid to the destination, and put them in the sam e directory /var/lib/libvirt/images/</div><div>Then I call the following commands:</div><div>'sudo virsh migrate --live --unsafe --verbose --copy-storage-inc vm1 qemu+ssh://<a href="http://192.168.1.3/system">192.168.1.3/system</a> tcp://<a href="http://192.168.1.3">192.168.1.3</a>'</div><div><br></div><div>The error I got is:</div><div>error: Requested operation is not valid: cannot migrate domain with 2 snapshots.</div><div><br></div><div>I do not know the reason for this.</div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"> In fact, modern<br>
libvirt/qemu does this for you by setting up an NBD server on the<br>
destination, doing a data mirror from the source into the destination<br>
(so that you DO have shared storage, at least for the duration of the<br>
migration), then doing the live migration, then tearing down the NBD<br>
mirroring link.<br></blockquote><div> </div><div>Sounds interesting! Can you provide me an example or point me to a link about how to use this function?</div><div><br></div><div>Sorry to take you so much time to answer my questions. I appreciate it deeply. After I solve this issue, I will write a blog and share these knowledge with other people. </div><div><br></div><div>Best,</div><div>Ed</div><div><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class=""><div class="h5"><br>
--<br>
Eric Blake   eblake redhat com    <a href="tel:%2B1-919-301-3266" value="+19193013266">+1-919-301-3266</a><br>
Libvirt virtualization library <a href="http://libvirt.org" target="_blank">http://libvirt.org</a><br>
<br>
</div></div></blockquote></div><br></div></div></div>