You can find sources of agent on github: https://github.com/thinkfr/mcoplugins/blob/master/ovirt.rb
What we want to do wasn't a complete export of all oVirt functions (if you want to configure it in "expert" mode, it's better to use the oVirt console), but export all the main functions to let you to centralize the control of your virtual farm.
To use it you just need to put ovirt.rv and ovirt.ddl file on your ovirt machine (where you have installed the ovirt sdk, and it's not necessary to put it directly on the hypervisor), in /usr/libexec/mcollective/mcollective/agent. Install some gem dependencies: rbovirt (>= 0.0.12) that is the oVirt Ruby API we used as the based of this module and inifile.
Then you shoud to configure parameters to connect to your oVirt server API. To do this you need to create a file in /etc/kermit/kermit.cfg (why the file is named KermIT? Simply because if few days you will see the oVirt integration in the KermIT webconsole ;)).
And now you are ready to make some tests :)
[oVirt] username=admin@internal password=Password api_url=https://server.hostname.net/api
You can find a the HD demo video of the agent here: oVIrt MCollective Agent (webm format)
The actual allowed agent actions, that you can find listed into ddl file, are:
- get_api_version: get the oVirt installed API version
- list_vms: list all defined virtual machines (started up or not)
- vm_details: show the details of the specified VM
- get_clusters: get liste of defined clusters in the oVirt farm
- get_templates: get list of defined templates
- get_storagedomains: get list of storage domains
- start_vm: start the specified virtual machine
- stop_vm: stop the provided virtual machine
- create_vm: create a new virtual machine
- add_network: add a new network to a vm
- add_storage: add a new storage to a vm