[ovirt-users] a new CLI for oVirt
Fabrice Bacchella
fabrice.bacchella at orange.fr
Fri May 6 16:26:04 UTC 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:
dc.delete(force=True)
context.datacenter().create(name="dc1", local=False, storage_format="v3", mac_pool_name="MoreMac")
cluster = context.cluster(name="cl1")
if cluster is not None:
cluster.delete(force=True)
context.cluster().create(name="cl1", cpu_type="Intel Haswell-noTSX Family", dc_name="en02",
memory_policy={'guaranteed': True, 'overcommit': 100, 'transparent_hugepages': False},
ballooning_enabled=True)
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
or
./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-0001.html>
More information about the Users
mailing list