On Wed, Jun 15, 2011 at 11:46 AM, Philipp Hahn <h...@univention.de> wrote: > On Tuesday 14 June 2011 20:18:18 Stefan Hajnoczi wrote: >> This patch series adds image streaming support for QED image files. Other >> image formats can also be supported in the future. >> >> Image streaming populates the file in the background while the guest is >> running. This makes it possible to start the guest before its image file >> has been fully provisioned. > ... >> When image streaming is enabled, the unallocated regions of the image file >> are populated with the data from the backing file. This occurs in the >> background and the guest can perform regular I/O in the meantime. Once the >> entire backing file has been streamed, the image no longer requires a >> backing file and will drop its reference. > > Does this also work for intermediate images, that is > - master image on a NFS share, > - local copy on a local drive using CoR-streaming from master, > - local instance based on local copy using CoW. > > We normally have mostly independent servers without a shared storage, expect a > global NFS share for the master images. Currently we have to copy the master > image to the local server first, before we than can create lots of instances > from then, which have few changed relative to the master, so we don't want > the copying to happen there.
No, unfortunately adding another level of backing files prevents use of streaming today. The reason is because backing files are opened read-only. This ensures that multiple VMs running concurrently will not change the backing file. Image formats are typically not safe for concurrent updates from multiple applications just like regular file systems cannot be accessed from multiple hosts simultaneously. You'd need a cluster file system for that, and similarly we need multiple writers support for image formats or some other solution. We'd need a solution that makes it possible to update the local copy of the master image while multiple VMs are running. For example qemu-nbd serving the local copy of the master image and each VM image using the backing file over NBD. That way all accesses to the local copy of the master image go through qemu-nbd and streaming can be performed safely. I haven't tested this approach, it might require some improvements to qemu-nbd and I expect the performance would need work too. Thanks for raising this use case, I think it's an interesting one because you are saving disk space by keeping a local master copy. Stefan