[ovirt-users] a new CLI for oVirt

Fabrice Bacchella fabrice.bacchella at orange.fr
Fri May 6 12:26:04 EDT 2016

To try to learn the python SDK, and help the automation of my setup, I wrote a CLI to oVirt.

It tries to hide some of the complexity, so some simple python script like :

dc = context.datacenter(name="dc1")
if dc is not None:
context.datacenter().create(name="dc1", local=False, storage_format="v3", mac_pool_name="MoreMac")

cluster = context.cluster(name="cl1")
if cluster is not None:
context.cluster().create(name="cl1", cpu_type="Intel Haswell-noTSX Family", dc_name="en02",
                         memory_policy={'guaranteed': True, 'overcommit': 100, 'transparent_hugepages': False},

can be used. It avoid the use of params.Something.

It can also be used to do action in shell like :

./ovcmd -c ovirt.ini host -n host1 bond -i eth0 -i eth1 -n ovirtmgmt -o mode 4 -o miimon 100 -o xmit_hash_policy 2+3 -D -m 9000


./ovcmd -c ovirt.ini host -n host1 export nics

Complex commands can take template as an argument :

./ovcmd -d -c ovirt.ini vm create -T vm1.yaml -V cores 2 -V memory 4G -n vm1

It's of course on github :
https://github.com/fbacchella/ovirtcmd <https://github.com/fbacchella/ovirtcmd>

It's still a work in progress, only the very basic commands are implemented, I will add other as requested, it should be easy to do so.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.ovirt.org/pipermail/users/attachments/20160506/a3ab8cd8/attachment.html>

More information about the Users mailing list