[libvirt] CLI management tool

Kashyap Chamarthy kchamart at redhat.com
Thu May 11 10:08:12 UTC 2017

On Thu, May 11, 2017 at 09:17:39AM +0200, Michal Privoznik wrote:
> Dear list,
> you might have seen a discussion about virsh, and adding some new
> features to it [1]. While the feature was rejected, it got me thinking.
> What options do we offer for sysadmins that:
> a) want to stay in command line
> b) want higher level mgmt of their domains
> c) yet want to manage a single host
> Basically, virsh is just too low level for some operations (and using it

I'd guess probably you're thinking about advanced features like CPU
pinning, NUMA, etc.

But for the most majority of cases, is `virsh` really that much of a
low-level tool for administrators?  What do I know...

> in non-interactive mode from a script can mean hundreds of connections).

You mean, these kind of hundreds of connections could be avoided when
using proper APIs, where you open a connection and do multiple thing at
once.  e.g.:


import libvirt
import sys

conn = libvirt.openReadOnly('qemu:///system')
if conn == None:
    print 'Failed to open connection to the hypervisor'

domains = conn.listAllDomains(0)

# Perform other useful operations via libvirt API


Hmm, that's a valid point.

> Then we have virt-manager, which suits b) and c), but it's not a CLI
> tool. Therefore I was thinking whether we should start a new project on
> the top of libvirt that would fit all three points.
> Personally, I've never been a sysadmin, so perhaps I am not the best one
> to write the tool. But I'm open for suggestions.
> What do you think?



More information about the libvir-list mailing list