RHEL Engineering is moving the tracking of its product development work on RHEL 6 through RHEL 9 to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "RHEL project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs in the statuses "NEW", "ASSIGNED", and "POST" are being migrated throughout September 2023. Bugs of Red Hat partners with an assigned Engineering Partner Manager (EPM) are migrated in late September as per pre-agreed dates. Bugs against components "kernel", "kernel-rt", and "kpatch" are only migrated if still in "NEW" or "ASSIGNED". If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "RHEL project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/RHEL-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 2026812 - [RFE]Add support for copy-mode=write-blocking for non-shared-storage migration
Summary: [RFE]Add support for copy-mode=write-blocking for non-shared-storage migration
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Enterprise Linux 9
Classification: Red Hat
Component: libvirt
Version: 9.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Peter Krempa
QA Contact: Han Han
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2021-11-26 02:08 UTC by Leonardo Bras
Modified: 2022-05-17 13:05 UTC (History)
12 users (show)

Fixed In Version: libvirt-8.0.0-0rc1.1.el9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-05-17 12:45:52 UTC
Type: Feature Request
Target Upstream Version: 8.0.0
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github autotest tp-libvirt pull 4124 0 None Merged migrate_storage: Add case for --copy-storage-synchronous-writes 2022-04-21 02:38:58 UTC
Red Hat Issue Tracker RHELPLAN-104000 0 None None None 2021-11-26 02:08:57 UTC
Red Hat Product Errata RHBA-2022:2390 0 None None None 2022-05-17 12:46:20 UTC

Description Leonardo Bras 2021-11-26 02:08:12 UTC
Description of problem:

'copy-mode=write-blocking'  is a block storage mode introduced in qemu 3.0.0 (commit-id: d06107ade0c).
It's limits guarantees local block storage migration by throttling writes on the source to the rate at which the migration happens.

While it's implemented in qemu, the libvirt code was not done.
It's theoretically simple, and if we have it, then we can stop worrying
about block migration limits (other than NVMe pass through).

Expected results:
Have support for setting this option in libvirt.

Additional info:
More info about this is available in <qemu_src>/qapi/block-core.json:

##
# @MirrorCopyMode:
#
# An enumeration whose values tell the mirror block job when to
# trigger writes to the target.
#
# @background: copy data in background only.
#
# @write-blocking: when data is written to the source, write it
#                  (synchronously) to the target as well.  In
#                  addition, data is copied in background just like in
#                  @background mode.
#
# Since: 3.0
##
{ 'enum': 'MirrorCopyMode',
  'data': ['background', 'write-blocking'] }

Comment 1 Peter Krempa 2021-12-07 09:20:49 UTC
Implemented upstream as:

0f170de28a docs: migration: Add a paragraph about non-shared storage migration
8841302e3d docs: Convert 'migration' doc to RST
f88d0ea2cd qemu: migration: Implement VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES
51d1c08fe9 virDomainMigrate: Introduce VIR_MIGRATE_NON_SHARED_SYNCHRONOUS_WRITES flag
21a9be4412 VIR_REQUIRE_FLAG_(GOTO|RET): Add parens around arguments in expansion
d43513e383 man: virsh: Separate paragraphs describing distinct flags
89dcf6d461 include: virDomainMigrateFlags: Remove "block alignment" whitespace
8f170cd3c5 qemuDomainBlockCopy: Implement VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES
b54c313c33 virDomainBlockCopy: Introduce VIR_DOMAIN_BLOCK_COPY_SYNCHRONOUS_WRITES flag
b1fc1dbd1a include: virDomainBlockCopyFlags: Convert to prefix comments
7d773a77ff qemu: monitor: Add support for 'write-blocking' copy mode for blockdev-mirror

v7.10.0-134-g0f170de28a

Comment 3 Han Han 2021-12-16 06:31:37 UTC
Tested on libvirt-v7.10.0-257-g497e6f5fa6 qemu-kvm-6.2.0-0.1.rc4.fc36.x86_64
1. Migrate with --copy-storage-all --copy-storage-synchronous-writes --postcopy --live. PASS
2. Blockcopy with --synchronous-writes --pivot. PASS
For a VM with high disk IO load(e.g. running iozone), it can help improve storage migration performance:
➜  ~ time virsh migrate rhel9 qemu+ssh://root@hhan-fedora2/system --copy-storage-all --postcopy --live --verbose                                                                             
Migration: [100 %]
virsh migrate rhel9 qemu+ssh://root@hhan-fedora2/system --copy-storage-all     0.22s user 0.47s system 0% cpu 5:41.03 total
➜  ~ time virsh migrate rhel9 qemu+ssh://root@hhan-fedora2/system --copy-storage-all --postcopy --copy-storage-synchronous-writes --live --verbose 
Migration: [100 %]
virsh migrate rhel9 qemu+ssh://root@hhan-fedora2/system --copy-storage-all     0.19s user 0.38s system 0% cpu 4:36.19 total

Comment 4 Peter Krempa 2021-12-16 16:14:01 UTC
In my testing I've used the following setup:

- original disk image on tmpfs or any other super-fast storage
- copy destination on slowest storage you can find (spinning disk/USB drive, etc)
- virtio/virtio-scsi guest frontend for maximum performance
- cache='none'
- start intensive writes to the disk from the guest, I've used multiple 'dd' instances, but anything that can do lots of ideally random I/O writes is ideal

Without --synchronous-writes the job actually didn't even reach 'ready' state in a few minutes I left it running. With --synchronous writes the guest writes were slower as indicated by the 'dd' instances but the copy job always converged very quickly.

The same should work for migration as it in fact does the same thing to copy the disk as virsh-blockcopy, so I've just verified that the 'write-blocking' mode is set properly.

Unfortunately I'm not sure how to automate this. Negative case is impossible to automate as it's equivalent to the halting problem. Positive test case with the conditions above could work, but it's not exactly a 100% deterministic test.

Comment 7 Han Han 2022-01-30 11:55:30 UTC
Tested as comment3 on libvirt-8.0.0-2.el9.x86_64 qemu-kvm-6.2.0-5.el9.x86_64. PASSED

Comment 9 errata-xmlrpc 2022-05-17 12:45:52 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory (new packages: libvirt), and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHBA-2022:2390


Note You need to log in before you can comment on or make changes to this bug.