Safa Rekik
2014-Mar-20 14:25 UTC
[Libguestfs] Python bindings : 'GuestFS' object has no attribute 'disk_create'
Hello, I tried to create a disk image using the python-guestfs documentatoin<http://libguestfs.org/guestfs-python.3.html#description>but when i come across "g.disk_create (output, "raw", 512 * 1024 * 1024)" i get an error saying that this function does not exist ! Besides, i tried a ctr+F over the guestfs.py and don't seem to find it. Am i missing something ? Regards,
Pino Toscano
2014-Mar-20 14:30 UTC
Re: [Libguestfs] Python bindings : 'GuestFS' object has no attribute 'disk_create'
Hello, On Thursday 20 March 2014 15:25:48 Safa Rekik wrote:> I tried to create a disk image using the python-guestfs > documentatoin<http://libguestfs.org/guestfs-python.3.html#description> > but when i come across "g.disk_create (output, "raw", 512 * 1024 * > 1024)" i get an error saying that this function does not exist !The disk-create API has been added quite recently in the development serie 1.25, and to be precise it is available in >= 1.25.30. So if you are running a stable serie of libguestfs (say 1.24, 1.22, etc) you do not have that API available. -- Pino Toscano
Richard W.M. Jones
2014-Mar-20 14:53 UTC
Re: [Libguestfs] Python bindings : 'GuestFS' object has no attribute 'disk_create'
On Thu, Mar 20, 2014 at 03:25:48PM +0100, Safa Rekik wrote:> Hello, > > I tried to create a disk image using the python-guestfs > documentatoin<http://libguestfs.org/guestfs-python.3.html#description>but > when i come across "g.disk_create (output, "raw", 512 * 1024 * 1024)" > i get an error saying that this function does not exist ! > > Besides, i tried a ctr+F over the guestfs.py and don't seem to find it. > > Am i missing something ?As Pino says, you need a newer version of libguestfs. Version 1.26 should be out by the end of the month and it includes this API. You can run 'qemu-img create' manually to create disk images. g.disk_create (output, "raw", 512*1024*1024) is roughly the equivalent of running: qemu-img create -f raw $output 512M BTW the online manual pages always document the latest version, and so may use newer APIs than you have available on your machine. Your distro should be packaging the manual pages, and if you read those it will have documentation that relates to the version you have installed. Rich. -- Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones Read my programming blog: http://rwmj.wordpress.com Fedora now supports 80 OCaml packages (the OPEN alternative to F#)