<div dir="ltr"><div><div><div><div><div><div><div><div><div><div><div><div><div><div><div>Hi all,<br><br></div>I'm using ZFS on Linux block volumes as my VM storage and want to do live migrations between hypervisors.<br><br></div>If I create ZFS snapshot of used volume on source host, send it do destination host (zfs send/recv) and then run live migration with <span class="gmail-pl-smi">VIR_MIGRATE_NON_SHARED_DISK flag, the migration works OK.<br><br></span></div><span class="gmail-pl-smi">But this procedure copies the whole disk twice which is a huge downside.<br><br></span></div><span class="gmail-pl-smi">The best solution would be, if libvirt could send the incremental data since last snapshot itself but this feature is not there (AFAIK).<br><br></span></div><span class="gmail-pl-smi">So I am thinking about a workaround:<br></span></div><span class="gmail-pl-smi">1. Create snapshot using: "virsh snapshot-create --xmlfile snap.xml --disk-only --no-metadata test-domain" which will start writing snapshot data into temporary qcow2 file<br><br><domainsnapshot><br>  <disks><br>    <disk name='/dev/zstore/test-volume'><br>      <source file='/tmp/test-volume.qcow2'/><br>    </disk><br>  </disks><br></domainsnapshot><br><br><br></span></div><span class="gmail-pl-smi">2. Create snapshot of backing ZFS volume and send it to destination host.<br></span></div><span class="gmail-pl-smi">3. Migrate the domain<br><br></span></div><span class="gmail-pl-smi">Currently, in step 3 I need to create empty qcow snapshot file on the destination host, otherwise the migration fails with: "Operation not supported: pre-creation of storage targets for incremental storage migration is not supported"<br><br></span></div><span class="gmail-pl-smi">My question is: Is it possible to do live migration with blockcommit operation? If not, would it be hard to implement?<br><br></span></div><span class="gmail-pl-smi">I imagine it like I would start migration with some special parameter (e.g. </span><br><span class="gmail-pl-smi">VIR_MIGRATE_NON_SHARED_INC_COMMIT) which would only migrate data from qcow snapshot to destination storage.<br><br></span></div><span class="gmail-pl-smi">This would ensure the disk consistency and avoid useless whole disk copy.<br><br></span></div><span class="gmail-pl-smi">Or do you have any other idea how to solve this?<br><br></span></div><span class="gmail-pl-smi">BR.<br></span></div><span class="gmail-pl-smi">Daniel Kucera.<br></span></div>