Skip to main content
  1. Posts/

MCollective oVirt Agent

·201 words·1 min· loading · loading · ·
Marco Mornati
Author
Marco Mornati
I build, self-host and sometimes break software in production — writing about AI tooling, coding agents and infrastructure.

Overview
#

After some days of testing we produced a first working version of an oVirt agent for MCollective.

You can find the source code on GitHub: https://github.com/thinkfr/mcoplugins/blob/master/ovirt.rb

What we wanted 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 rather to expose the main functions so you can centralize control of your virtual farm.

Installation
#

Copy the agent file to your MCollective agent directory:

sudo cp ovirt.rb /usr/libexec/mcollective/mcollective/agent/

Or if you’re using the plugin directory:

sudo cp ovirt.rb /etc/puppetlabs/mcollective/plugins/

Available Actions
#

The agent provides the following actions:

  • vm_list — list all virtual machines in your oVirt farm
  • vm_status — get the status of a specific VM
  • vm_start — start a virtual machine
  • vm_stop — stop a virtual machine
  • vm_create — create a new virtual machine from a template
  • host_list — list all hypervisor hosts

Usage Examples
#

List all VMs:

mc-ovirt vm_list

Start a specific VM:

mc-ovirt vm_start vmname=my-vm

Integration with KermIT
#

This agent is also fully integrated with KermIT, our web UI for MCollective, providing a graphical interface for managing your oVirt resources without needing to use the command line.