Richard W.M. Jones
2020-May-19 15:51 UTC
[Libguestfs] [PATCH virt-v2v v2] v2v: -o libvirt: Remove cache=none.
Traditionally if you did live migration (KVM to KVM), you had to ensure that cache=none was set on all disks of the guest up front. This was because of quirks in how NFS works (I think the close-to-open consistency and the fact that during live migration both qemus have the file open), and we had to assume the worst case that a guest might be backed by NFS. Because of this when virt-v2v converts a guest to run on KVM using libvirt it sets cache=none. This is not necessary with modern qemu. If qemu supports the drop-cache property of the file block driver, which libvirt will automatically detect for us, then libvirt live migration is able to tell qemu to drop cached data at the right time even if the backing is NFS. It also had a significant performance impact. In some synthetic benchmarks it could show 2 or 3 times slower performance. Thanks: Ming Xie, Peter Krempa. --- tests/test-v2v-cdrom.expected | 2 +- tests/test-v2v-floppy.expected | 2 +- tests/test-v2v-i-ova.xml | 2 +- v2v/create_libvirt_xml.ml | 1 - 4 files changed, 3 insertions(+), 4 deletions(-) diff --git a/tests/test-v2v-cdrom.expected b/tests/test-v2v-cdrom.expected index e18ea6f28b..34d2bf5961 100644 --- a/tests/test-v2v-cdrom.expected +++ b/tests/test-v2v-cdrom.expected @@ -1,5 +1,5 @@ <disk type='file' device='disk'> - <driver name='qemu' type='raw' cache='none'/> + <driver name='qemu' type='raw'/> <target dev='vda' bus='virtio'/> </disk> <disk device='cdrom' type='file'> diff --git a/tests/test-v2v-floppy.expected b/tests/test-v2v-floppy.expected index dd74ed94ad..a718c21f94 100644 --- a/tests/test-v2v-floppy.expected +++ b/tests/test-v2v-floppy.expected @@ -1,5 +1,5 @@ <disk type='file' device='disk'> - <driver name='qemu' type='raw' cache='none'/> + <driver name='qemu' type='raw'/> <target dev='vda' bus='virtio'/> </disk> <disk device='floppy' type='file'> diff --git a/tests/test-v2v-i-ova.xml b/tests/test-v2v-i-ova.xml index 7c19828316..e26f4f8330 100644 --- a/tests/test-v2v-i-ova.xml +++ b/tests/test-v2v-i-ova.xml @@ -22,7 +22,7 @@ <on_crash>restart</on_crash> <devices> <disk type='file' device='disk'> - <driver name='qemu' type='raw' cache='none'/> + <driver name='qemu' type='raw'/> <source file='TestOva-sda'/> <target dev='vda' bus='virtio'/> </disk> diff --git a/v2v/create_libvirt_xml.ml b/v2v/create_libvirt_xml.ml index 05553c4f7d..5a1fba0fd6 100644 --- a/v2v/create_libvirt_xml.ml +++ b/v2v/create_libvirt_xml.ml @@ -336,7 +336,6 @@ let create_libvirt_xml ?pool source targets target_buses guestcaps e "driver" [ "name", "qemu"; "type", t.target_format; - "cache", "none" ] []; (match pool with | None -> -- 2.26.2
Pino Toscano
2020-May-26 12:33 UTC
Re: [Libguestfs] [PATCH virt-v2v v2] v2v: -o libvirt: Remove cache=none.
On Tuesday, 19 May 2020 17:51:40 CEST Richard W.M. Jones wrote:> Traditionally if you did live migration (KVM to KVM), you had to > ensure that cache=none was set on all disks of the guest up front. > This was because of quirks in how NFS works (I think the close-to-open > consistency and the fact that during live migration both qemus have > the file open), and we had to assume the worst case that a guest might > be backed by NFS. > > Because of this when virt-v2v converts a guest to run on KVM using > libvirt it sets cache=none. > > This is not necessary with modern qemu. If qemu supports the > drop-cache property of the file block driver, which libvirt will > automatically detect for us, then libvirt live migration is able to > tell qemu to drop cached data at the right time even if the backing is > NFS. > > It also had a significant performance impact. In some synthetic > benchmarks it could show 2 or 3 times slower performance. > > Thanks: Ming Xie, Peter Krempa. > ---There is one additional occurrence of it in virt-v2v-output-local.pod. With that fixed, LGTM. Thanks, -- Pino Toscano
Apparently Analagous Threads
- [PATCH virt-v2v] v2v: -o libvirt: Remove cache=none.
- [PATCH v2] v2v: Add support for libosinfo metadata
- [PATCH] v2v: -o libvirt: Get the <features/> right in the output XML (RHBZ#1159258).
- Re: [PATCH] v2v: Preserve VM Generation ID (RHBZ#1598350).
- [PATCH 4/4] v2v: Pass CPU vendor, model and topology from source to target.