|
From: | Eric Blake |
Subject: | Re: [Qemu-block] [ovirt-users] Libvirt ERROR cannot access backing file after importing VM from OpenStack |
Date: | Wed, 30 May 2018 08:44:40 -0500 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.8.0 |
On 05/29/2018 04:18 PM, Nir Soffer wrote:
You CAN get a logically collapsed view of storage (that is, what the guest would see), by using an NBD export of volume V. Reading from that volume will then pull sectors from whichever portion of the chain you need. You can use either qemu-nbd (if no guest is writing to the chain), or within a running qemu, you can use nbd-server-start and nbd-server-add (over QMP) to get such an NBD server running.NBD expose the guest data, but we want the qcow2 stream - without creating a new image.
NBD can do both. You choose whether it exposes the guest data or the qcow2 data, by whether the client or the server is interpreting qcow2 data. Visually, if everything is local, qemu normally needs only two block layer entries:
qcow2 format layer => file protocol layerBut you can also make qemu use four block layer entries, since the raw layer is a normally passthrough layer (unless you are also using it for it's ability to support an offset within a larger file, such as reading from a tar file):
raw format layer => qcow2 format layer => raw format layer => file protocol layer
Then when you introduce NBD into the picture, you have the choice of WHERE in the four-layer system. The usual choice is:
NBD server using -f qcow2, client using -f raw:raw format => NBD client protocol => (raw bytes) => NBD server => qcow2 format => raw format => file protocol
(simplified toraw format => NBD client protocol => (raw bytes) => NBD server => qcow2 format => file protocol)
But an alternative choice is: NBD server using -f raw, client using -f qcow2:raw format => qcow2 format => NBD client protocol => (qcow2 bytes) => NBD server => raw format => file protocol
(simplified toqcow2 format => NBD client protocol => (qcow2 bytes) => NBD server => raw format => file protocol)
-- Eric Blake, Principal Software Engineer Red Hat, Inc. +1-919-301-3266 Virtualization: qemu.org | libvirt.org
[Prev in Thread] | Current Thread | [Next in Thread] |