[libvirt-users] How can I rebase network disk?

Boxiang Zhu bxzhu_5355 at 163.com
Wed Nov 7 05:22:32 UTC 2018



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 at 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.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/libvirt-users/attachments/20181107/a408e312/attachment.htm>


More information about the libvirt-users mailing list