qemu-discuss
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Exporting qcow2 images as raw data from ova file with qemu-nbd


From: Richard W.M. Jones
Subject: Re: Exporting qcow2 images as raw data from ova file with qemu-nbd
Date: Tue, 23 Jun 2020 11:47:20 +0100
User-agent: Mutt/1.5.21 (2010-09-15)

On Tue, Jun 23, 2020 at 01:14:43PM +0300, Nir Soffer wrote:
> On Tue, Jun 23, 2020 at 12:47 PM Richard W.M. Jones <rjones@redhat.com> wrote:
> > Here you go:
> >
> > https://github.com/libguestfs/nbdkit/commit/2d15e79f65764d9b0c68bea28ed6afbcbcc63467
> 
> Nice!
> 
> But using qemu-nbd directly is much simpler and will perform better.

Not sure about simpler, and you might want to verify the "perform
better" claim (it is likely to be true because writing a plugin in
Python causes requests to be serialized, but it may not matter if
you're reading linearly from a file).  The tar plugin could be
rewritten in C if performance was really a problem.

> Regardless, nbdit tar plugin is awesome. Is it possible to expose
> all the disks from a tar file so they are accessible using the
> export name?

In theory yes, but it would require exposing the export name
(nbdkit_export_name() -> nbdkit.export_name()) to Python plugins,
which we don't do at the moment.  See plugins/python/python.c:
NbdkitMethods[].  That would also mean the plugin would require the
latest nbdkit so you'd have to wait for patches to get backported to
RHEL 8.

You would also have to be cautious with security because the export
name is supplied by the untrusted client.

> For example:
> 
> $ nbdkit tar file=vm.ova
> 
> $ qemu-nbd --list
> exports available: 2
>  export: 'disk1.qcow2'
>   size:  910848
>   flags: 0x48f ( readonly flush fua df cache )
>   min block: 512
>   opt block: 4096
>   max block: 33554432
>   available meta contexts: 1
>    base:allocation
>  export: 'disk2.qcow2'
>   size:  910848
>   flags: 0x48f ( readonly flush fua df cache )
>   min block: 512
>   opt block: 4096
>   max block: 33554432
>   available meta contexts: 1
>    base:allocation
> 
> $  qemu-img convert -f qcow2 -O raw nbb://localhost/disk1.qcow2 disk1.raw
> 
> $  qemu-img convert -f qcow2 -O raw nbb://localhost/disk2.qcow2 disk2.raw

Yup, it'd be nice ...

Also nbdkit doesn't support the extension for listing export names,
and that's a bunch more work.

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-p2v converts physical machines to virtual machines.  Boot with a
live CD or over the network (PXE) and turn machines into KVM guests.
http://libguestfs.org/virt-v2v




reply via email to

[Prev in Thread] Current Thread [Next in Thread]