[virt-manager question] Advice on using libvirt with better default arguments

Cameron Showalter cameronsplaze222 at gmail.com
Sun Apr 24 23:11:32 UTC 2022


Hi Cole, thanks for the info!

I hooked up virt-install to the create-vm script using python's subprocess,
and that part is working great!

On Tue, Apr 19, 2022 at 8:36 AM Cole Robinson <crobinso at redhat.com> wrote:

> On 4/8/22 11:01 PM, Cameron Showalter wrote:
> > Hi,
> >
> > I'm trying to learn libvirt enough have a python library around it to
> > manage VM's. I'm at the part where I'm trying to make almost any OS easy
> > to run based solely on the ISO. (For example: If I try to start a
> > Windows 10 VM, There's extra work to get the OS to see the qcow volume
> > during the install. But by creating one through the virt-manager GUI, it
> > see's it automatically. So this is something you've solved outside
> > libvirt). I'd like to get the same defaults as virt-manager into my
> > python package. To do this, any advice on the easiest / most stable
> > path? A couple ways I thought of:
> >
> > - Maybe add virt-manager as a submodule, and call your python scripts to
> > get the good default arguments? Is the back-end for your GUI stable
> > enough long term for something like this?
> >
> > - Do those defaults come straight from the `Libosinfo` library? And by
> > learning how to use that, it'll provide the default libvirt xml blocks I
> > can use for libvirt?
>
> For this type of thing most people call out directly to virt-install.
> It's the closest thing to an API for 'create a VM and give me good
> defaults'. Trying to use vendored virtinst/ code could work but you'll
> end up reimplementing parts of virtinstall.py.
>
> libosinfo is a critical piece but for virt-manager/virt-install usage
> it's mostly 'does this OS support virtio or not' and 'give me known
> install media location for OS $FOO'
>
> - Cole
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://listman.redhat.com/archives/virt-tools-list/attachments/20220424/dd80a09d/attachment.htm>


More information about the virt-tools-list mailing list