[Libguestfs] Virt Customize features from python

Richard W.M. Jones rjones at redhat.com
Thu Aug 27 12:36:29 UTC 2020


On Thu, Aug 27, 2020 at 08:32:35AM -0400, Donny Davis wrote:
> Hey Richard,
> 
> I have been playing around with guestfs-python.3 and I am curious if there
> is a method to call virt-customize like functions from python. Specifically
> I need to install a package into the guest image.

There isn't directly, you'd have to either run virt-customize as an
external command, or emulate what virt-customize does using guestfs
python calls:

https://github.com/libguestfs/libguestfs/blob/fce82fe55a2b64a1a7e494858aa272d608e5e54e/customize/customize_run.ml#L70
https://github.com/libguestfs/libguestfs/blob/fce82fe55a2b64a1a7e494858aa272d608e5e54e/customize/customize_run.ml#L272

Rich.

-- 
Richard Jones, Virtualization Group, Red Hat http://people.redhat.com/~rjones
Read my programming and virtualization blog: http://rwmj.wordpress.com
virt-builder quickly builds VMs from scratch
http://libguestfs.org/virt-builder.1.html




More information about the Libguestfs mailing list