question about live migration with storage
Hi,
I want to live migrate a vm with storage, with regard to the migration of storage, should I use drive_mirror or traditional mechanism implemented in block-migration.c ? Any advices?
Thanks,
Zhang Haoyu
Quoted 4 lines · Zhang Haoyu
Hi,
I want to live migrate a vm with storage, with regard to the migration of storage, should I use
drive_mirroror traditional mechanism implemented inblock-migration.c?
Because I don't use libvirtd to manage vm,
if I want to use drive_mirror to perform live migration with storage, how to organize the flow via script?
Quoted 4 lines
Any advices?
Thanks,
Zhang Haoyu
Quoted 6 lines · Zhang Haoyu
Quoted 2 lines
I want to live migrate a vm with storage, with regard to the migration of storage, should I use
drive_mirroror traditional mechanism implemented inblock-migration.c?Because I don't use libvirtd to manage vm,
if I want to usedrive_mirrorto perform live migration with storage, how to organize the flow via script?
The same as libvirt does.
Paolo
Quoted 11 lines · Paolo Bonzini
Quoted 6 lines · Zhang Haoyu
Quoted 2 lines
I want to live migrate a vm with storage, with regard to the migration of storage, should I use
drive_mirroror traditional mechanism implemented inblock-migration.c?Because I don't use libvirtd to manage vm,
if I want to usedrive_mirrorto perform live migration with storage, how to organize the flow via script?The same as libvirt does.
Hi, Paolo,
what's advantages of drive_mirror over traditional mechanism implemented in block-migration.c ? Why libvirt use drive_mirror instead of traditional iterative mechanism as the default way of live migration with non-shared storage?
Thanks,
Zhang Haoyu
Quoted 1 line
Paolo
Quoted 4 lines · Zhang Haoyu
Hi, Paolo,
what's advantages ofdrive_mirrorover traditional mechanism implemented inblock-migration.c? Why libvirt usedrive_mirrorinstead of traditional iterative mechanism as the default way of live migration with non-shared storage?
1) Being able to choose which block devices are migrated, and whether they are migrated incrementally or not.
2) Finer-grain control the parameters of block migration (dirty bitmap granularity).
3) Block and RAM migration do not share the same socket and thus can more easily be parallelized.
Note that 1-2 are not yet supported by libvirt as far as I remember.
Paolo
Quoted 10 lines · Paolo Bonzini
Quoted 4 lines · Zhang Haoyu
Hi, Paolo,
what's advantages ofdrive_mirrorover traditional mechanism implemented inblock-migration.c? Why libvirt usedrive_mirrorinstead of traditional iterative mechanism as the default way of live migration with non-shared storage?1) Being able to choose which block devices are migrated, and whether they are migrated incrementally or not.
Yes.
Quoted 6 lines
2) Finer-grain control the parameters of block migration (dirty bitmap granularity).
3) Block and RAM migration do not share the same socket and thus can more easily be parallelized.
But, because of the parallelization, how to calculate the progress?
BTW, the traditional iterative mechanism is buggy-implemented? e.g., some bugs which are very difficult to fixed, or something?
Thanks,
Zhang Haoyu
Quoted 3 lines
Note that 1-2 are not yet supported by libvirt as far as I remember.
Paolo
Quoted 7 lines · Zhang Haoyu
Quoted 6 lines
2) Finer-grain control the parameters of block migration (dirty bitmap granularity).
3) Block and RAM migration do not share the same socket and thus can more easily be parallelized.
But, because of the parallelization, how to calculate the progress?
You can use "query-block-jobs".
Quoted 2 lines
BTW, the traditional iterative mechanism is buggy-implemented? e.g., some bugs which are very difficult to fixed, or something?
There are no bugs that corrupt data. It's simply less flexible.
Regarding parallelization, the problems happen especially if you disable migration bandwidth limits. Then you'll see large chunks of RAM and large chunks of block device data being sent. This is a problem for convergence in some workloads. Instead, with NBD-based storage migration everything happens in parallel, and TCP makes sure that bandwidth is split between the sockets.
If you have a migration bandwidth limit, NBD-based storage migration will use a separate bandwidth limit for each disk and for RAM. Thus network usage is less predictable than with block-migration.c. On the other hand, storage migration uses a lot of network so it's usually more likely that you do not have migration bandwidth limits.
Paolo
Quoted 8 lines
Thanks,
Zhang HaoyuQuoted 3 lines
Note that 1-2 are not yet supported by libvirt as far as I remember.
Paolo
Quoted 9 lines · Paolo Bonzini
Quoted 6 lines · Zhang Haoyu
Quoted 6 lines
2) Finer-grain control the parameters of block migration (dirty bitmap granularity).
3) Block and RAM migration do not share the same socket and thus can more easily be parallelized.
drive_mirror job is done in main-thread,
then how to accept the qmp_migrate request while drive_mirror is performing? If need to wait for the completion of drive_mirror,
how to implement the parallelization between block and ram migration?
Thanks,
Zhang Haoyu
Quoted 29 lines
Quoted 1 line
But, because of the parallelization, how to calculate the progress?
You can use "query-block-jobs".
Quoted 2 lines
BTW, the traditional iterative mechanism is buggy-implemented? e.g., some bugs which are very difficult to fixed, or something?
There are no bugs that corrupt data. It's simply less flexible.
Regarding parallelization, the problems happen especially if you disable migration bandwidth limits. Then you'll see large chunks of RAM and large chunks of block device data being sent. This is a problem for convergence in some workloads. Instead, with NBD-based storage migration everything happens in parallel, and TCP makes sure that bandwidth is split between the sockets.
If you have a migration bandwidth limit, NBD-based storage migration will use a separate bandwidth limit for each disk and for RAM. Thus network usage is less predictable than with
block-migration.c. On the other hand, storage migration uses a lot of network so it's usually more likely that you do not have migration bandwidth limits.Paolo
Quoted 5 lines
Thanks,
Zhang HaoyuQuoted 3 lines
Note that 1-2 are not yet supported by libvirt as far as I remember.
Paolo
Quoted 10 lines · Zhang Haoyu
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
2) Finer-grain control the parameters of block migration (dirty bitmap granularity).
3) Block and RAM migration do not share the same socket and thus can more easily be parallelized.
drive_mirrorjob is done in main-thread,
then how to accept theqmp_migraterequest whiledrive_mirroris performing? If need to wait for the completion ofdrive_mirror,
how to implement the parallelization between block and ram migration?
drive_mirror runs in the background, using coroutines.
Paolo
Quoted 8 lines · Paolo Bonzini
Quoted 6 lines · Zhang Haoyu
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
2) Finer-grain control the parameters of block migration (dirty bitmap granularity).
3) Block and RAM migration do not share the same socket and thus can more easily be parallelized.
Quoted 7 lines
Quoted 4 lines
drive_mirrorjob is done in main-thread,
then how to accept theqmp_migraterequest whiledrive_mirroris performing? If need to wait for the completion ofdrive_mirror,
how to implement the parallelization between block and ram migration?
drive_mirrorruns in the background, using coroutines.
I see, when waiting the completion of drive_mirror IO, the coroutine will be switched back to main-thread to poll and process other events, like qmp request, then after the IO completed, coroutine will be switched back in main-loop process, right?
Another question:
while starting to migrate storage, will the unused sector be allocated and transferred? regarding the thin-provisioning qcow2 disk, will extra large IO requests be performed, and more data be transferred for the unallocated clusters?
Thanks,
Zhang Haoyu
Quoted 1 line
Paolo
Quoted 8 lines · Zhang Haoyu
I see, when waiting the completion of
drive_mirrorIO, the coroutine will be switched back to main-thread to poll and process other events, like qmp request, then after the IO completed, coroutine will be switched back in main-loop process, right?Another question:
while starting to migrate storage, will the unused sector be allocated and transferred? regarding the thin-provisioning qcow2 disk, will extra large IO requests be performed, and more data be transferred for the unallocated clusters?
No.
Paolo
Quoted 6 lines · Paolo Bonzini
Quoted 4 lines · Zhang Haoyu
I see, when waiting the completion of
drive_mirrorIO, the coroutine will be switched back to main-thread to poll and process other events, like qmp request, then after the IO completed, coroutine will be switched back in main-loop process, right?
Quoted 7 lines
Quoted 4 lines
Another question:
while starting to migrate storage, will the unused sector be allocated and transferred? regarding the thin-provisioning qcow2 disk, will extra large IO requests be performed, and more data be transferred for the unallocated clusters?No.
My test results show that
when using thin-provisioning qcow2 image(created by qemu-img create -f qcow2 preallocation=metadata), even the unallocated sectors will be transferred to destination, so much data is transferred, so the qcow2 image in destination is full allocated.
Thanks,
Zhang Haoyu
Quoted 1 line
Paolo
Quoted 5 lines · Zhang Haoyu
My test results show that when using thin-provisioning qcow2 image(created by qemu-img create -f qcow2 preallocation=metadata), even the unallocated sectors will be transferred to destination, so much data is transferred, so the qcow2 image in destination is full allocated.
Yes, metadata preallocation actually allocates all sectors. Only, the qcow2 image is sparse so the sectors do not consume space on the source.
I think you can avoid the problem by passing file.detect-zeroes=unmap in the -drive option of the destination QEMU. Kevin/Peter, can you confirm this should work?
Paolo