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 905125 - libvirt should support a "mirror writes to a remote NBD server" block-device job
Summary: libvirt should support a "mirror writes to a remote NBD server" block-device job
Keywords:
Status: CLOSED INSUFFICIENT_DATA
Alias: None
Product: Red Hat Enterprise Linux 7
Classification: Red Hat
Component: libvirt
Version: 7.0
Hardware: Unspecified
OS: Unspecified
medium
medium
Target Milestone: rc
: ---
Assignee: Eric Blake
QA Contact: Han Han
URL:
Whiteboard:
: 956577 (view as bug list)
Depends On:
Blocks: 1888670 955734 1273812 1293440 1434362 1888672 1888674
TreeView+ depends on / blocked
 
Reported: 2013-01-28 16:25 UTC by Paolo Bonzini
Modified: 2020-10-15 13:25 UTC (History)
16 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2017-07-14 13:06:14 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)

Description Paolo Bonzini 2013-01-28 16:25:10 UTC
QEMU is going to use NBD as "the" protocol for external applications to snoop I/O happening in the VM.  From the QEMU monitor PoV, libvirt will simply to use drive-mirror (usually, but not always, with sync:'none') with an NBD socket as a destination.

This should be exposed as a new kind of block-device job.

Comment 3 Eric Blake 2013-03-06 23:05:08 UTC
If I'm understanding the request right, we need a new virDomainBlockCopy API that exposes the full power of qemu's drive-mirror (the existing virDomainBlockRebase with the VIR_DOMAIN_BLOCK_REBASE_COPY flag was a limited-use-case hack for one specific case of drive-mirror).  Will persistent bitmaps be completed in time to design the API with that in mind?

Comment 4 Paolo Bonzini 2013-03-07 07:57:37 UTC
This is for programs who wants to snoop the I/O of a VM, for example anti-viruses.  The program provides an NBD server on a TCP or Unix socket and the VM sends I/O there via the normal drive-mirror job.

I don't know if a new API is needed.  A URI can represent the location of the NBD server.  I think for simplicity a new kind of block job should be added, because block-job-complete does not really make sense in this case.

Persistent bitmaps are not needed for this application, it is just for online operations.

Comment 5 Eric Blake 2013-06-06 02:52:24 UTC
qemu is still debating the best approach; possibly through options of the new block-backup series.  I'm fairly certain that the best way to expose this in libvirt is via a new API, although it might be possible to cram it in via new flags to existing API if rebase considerations get in the way.

Comment 6 Eric Blake 2013-06-06 02:59:36 UTC
*** Bug 956577 has been marked as a duplicate of this bug. ***

Comment 7 Paolo Bonzini 2013-06-20 11:29:39 UTC
Eric, this is not fleecing.  It wouldn't be for a point-in-time backup, it would be for drive-mirror.  I think bug 956577 has to be reopened.

Comment 8 Dave Allan 2013-07-10 20:58:35 UTC
*** Bug 956577 has been marked as a duplicate of this bug. ***

Comment 9 Eric Blake 2013-07-10 21:25:45 UTC
I'm still thinking that whether libvirt uses drive-mirror or drive-backup under the hood, that both mirroring to a remote NBD server and point-in-time fleecing are sufficiently related as to be covered by a single libvirt API virDomainBlockCopy.  Our existing use of drive-mirror is a very limited use case shoe-horned on top of virDomainBlockRebase, but that API is inadequate to express the full power of drive-mirror; and once you add enough knobs for the full power, it is just one more knob to state whether the copying is done as a point in time or as a continuous job.  At any rate, I hope to post an API to the libvirt list soon proposing how everything relates, and will make sure that both points are covered.

For now, I'm fine if 956577 remains closed dup, but we can reopen it if it makes it easier for QE to test both functions even if the testing uses a single API.  Just because qemu needs two separate BZ to expose two different QMP commands doesn't mean libvirt needs two BZ for exposing a fundamental feature (copying disk contents) with knobs (point-in-time vs. continuous).

Comment 10 Paolo Bonzini 2013-07-15 15:28:23 UTC
I am not sure how this would indeed be implemented as the same API.  For this case, the NBD server is provided by the client.  For fleecing, the NBD server is provided by QEMU.

It is indeed possible to use the QEMU NBD server without point-in-time snapshot, but this is not what this bug is about.  This bug is about having an external program that snoops guest I/O as it happens, and QEMU sending this I/O actively to the external program.

Comment 14 Eric Blake 2015-07-28 15:15:58 UTC
RHEL 7.2 picks up virDomainBlockCopy() (since libvirt 1.2.8 upstream) via rebase, which allows targetting nbd or any other network destination of drive-mirror.

Comment 17 Yang Yang 2015-09-24 08:24:25 UTC
(In reply to Eric Blake from comment #14)
> RHEL 7.2 picks up virDomainBlockCopy() (since libvirt 1.2.8 upstream) via
> rebase, which allows targetting nbd or any other network destination of
> drive-mirror.

I did a blockcopy and specified a gluster based file as destination, but failed due to non-file destination not supported yet. Could you please hint me how to verify it. 

Thanks 
Yang

libvirt-1.2.17-10.el7.x86_64
qemu-kvm-rhev-2.3.0-25.el7.x86_64

#  virsh blockcopy virt-tests-vm1 vda --xml copy.xml --wait --verbose 
error: argument unsupported: non-file destination not supported yet

# cat copy.xml 
<disk type='network' device='disk'>
      <driver name='qemu' type='raw'/>
      <source protocol='gluster' name='gluster-vol1/copy'>
        <host name='10.66.4.164' port='24007'/>
      </source>
      <target dev='vda' bus='virtio'/>
    </disk>

Comment 18 Eric Blake 2015-10-20 14:24:01 UTC
Ouch - we still haven't wired it up in libvirt :(  From qemu/qemu_domain.c:

/* bandwidth in bytes/s.  Caller must lock vm beforehand, and not
 * access mirror afterwards.  */
static int
qemuDomainBlockCopyCommon(virDomainObjPtr vm,
...
    /* Prepare the destination file.  */
    /* XXX Allow non-file mirror destinations */
    if (!virStorageSourceIsLocalStorage(mirror)) {
        virReportError(VIR_ERR_ARGUMENT_UNSUPPORTED, "%s",
                       _("non-file destination not supported yet"));
        goto endjob;
    }

I'll have to defer this; I think that in order for this feature to work, we need qemu's blockdev-add to work for all destinations, and libvirt to drive that.

Comment 21 Paolo Bonzini 2016-11-01 20:42:10 UTC
> we need qemu's blockdev-add to work for all destinations, and libvirt
> to drive that.

Why?  drive-mirror supports gluster and NBD URIs for example.

Comment 22 Eric Blake 2016-12-14 19:24:19 UTC
(In reply to Paolo Bonzini from comment #21)
> > we need qemu's blockdev-add to work for all destinations, and libvirt
> > to drive that.
> 
> Why?  drive-mirror supports gluster and NBD URIs for example.

drive-mirror supports a single 'target' destination, which is only good for local files or URI-encoded names.  Better is the 'node-name' destination which supports _any_ BDS destination - except that you create BDS destinations by 'blockdev-add'.  And 'blockdev-add' isn't complete yet (closer in qemu 2.8, and shooting for qemu 2.9 - but the libvirt still has to use it)


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