Thanks for your reply. The nova project uses the virDomainBlockRebase API to finish the rebase operation from the old disk to the new disk not using the virDomainBlockCopy API. I am confused of the difference of virDomainBlockRebase and virDomainBlockCopy. Cheers, Boxiang On 11/5/2018 22:07,Peter Krempa<pkrempa@redhat.com> wrote: On Fri, Nov 02, 2018 at 13:42:56 +0800, Boxiang Zhu wrote: Hi. I am using openstack, ceph and libvirt now. The live volume migration will call the libvirt rebase function in openstack nova project. https://github.com/openstack/nova/blob/stable/rocky/nova/virt/libvirt/driver.py#L1497 https://github.com/openstack/nova/blob/stable/rocky/nova/virt/libvirt/guest.py#L802 But I use the ceph as the openstack block backend. And the type of disk is network in xml. <disk type='network' device='disk'> <driver name='qemu' type='raw' cache='writeback' discard='unmap'/> <auth username='cinder'> <secret type='ceph' uuid='86d3922a-b471-4dc1-bb89-b46ab7024e81'/> </auth> <source protocol='rbd' name='volumes002/volume-127f46fc-ef10-4462-af30-c3893cda31f9'> <host name='172.16.140.63' port='6789'/> </source> <target dev='vdb' bus='virtio'/> <serial>127f46fc-ef10-4462-af30-c3893cda31f9</serial> <alias name='virtio-disk1'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x06' function='0x0'/> </disk> Now I found it is not supported to rebase network disk. It is only rebase block or file disk now. https://libvirt.org/html/libvirt-libvirt-domain.html#virDomainBlockRebase My question is that can I rebase network disk by some other ways from libvirt? Whic operation of "rebase" do you mean? Unfortunately we've implemented the virDomainBlockCopy API also using a flag-hack with the rebase api. Are you passing in VIR_DOMAIN_BLOCK_REBASE_COPY? If yes, then you in fact should use virDomainBlockCopy API which takes an XML which allows to specify also a network based disk. The support for block copy to a network destination will be added soon as I'm working on it. Without the VIR_DOMAIN_BLOCK_REBASE_COPY flag it should work as expected right now, since it pulls in changes from backing files.
On Wed, Nov 07, 2018 at 13:22:32 +0800, Boxiang Zhu wrote:> > > Thanks for your reply. The nova project uses the virDomainBlockRebase API to finish the rebase operation from the old disk to the new disk not using the virDomainBlockCopy API. > I am confused of the difference of virDomainBlockRebase and virDomainBlockCopy.virDomainBlockRebase way to do things was introduced to add the functionality without having to add new API. Later we've figured out that the new API is necessary anyways. If you want to copy to a network location you'll need to use virDomainBlockCopy. The old API does not support passing the disk specification for non-local disks. Note that as I've stated previously, the qemu driver does not allow network disks with the new API until I finish integration with qemu's 'blockdev' feature which I'm currently working on.
I see. Thank you for your patient reply. I am very looking forward to the feature which you're currently working on. Cheers, Boxiang On 11/7/2018 16:26,Peter Krempa<pkrempa@redhat.com> wrote: On Wed, Nov 07, 2018 at 13:22:32 +0800, Boxiang Zhu wrote: Thanks for your reply. The nova project uses the virDomainBlockRebase API to finish the rebase operation from the old disk to the new disk not using the virDomainBlockCopy API. I am confused of the difference of virDomainBlockRebase and virDomainBlockCopy. virDomainBlockRebase way to do things was introduced to add the functionality without having to add new API. Later we've figured out that the new API is necessary anyways. If you want to copy to a network location you'll need to use virDomainBlockCopy. The old API does not support passing the disk specification for non-local disks. Note that as I've stated previously, the qemu driver does not allow network disks with the new API until I finish integration with qemu's 'blockdev' feature which I'm currently working on.
Reasonably Related Threads
- Re: How can I rebase network disk?
- How can I rebase network disk?
- Re: How can I rebase network disk?
- Re: error: internal error: unable to execute QEMU command 'blockdev-mirror': Cannot find device= nor node_name=
- Re: blockcopy for libvirt and version compatibility