Description:

In my work I often create complex environments which contains a lot of virtual machines. These virtual machines contains mutual settings and I don't want that they lost their states.

At the beginning I used shell scripts for maintaining snapshots of virtual machines, but it's not very convinient. I decided to write some tool which allow me automate process of division the states in context of configuration.

This tool became ovirt-snap

Quick start:


Clone and install:

git clone https://github.com/livelace/ovirt-snap.git
cd ovirt-snap
pip install .

Save the configuration file (~/.ovirt-snap.ini):

[ovirt-snap]
username = admin@internal
url = https://example.com/ovirt-engine/api
insecure = True
password = Passw0rD

# this prefix will be used in names of the snapshots
snapshot_prefix = ovirt_snap_

# some operations take much time and we have to wait
snapshot_operation_timeout = 600

# default datacenter name
default_datacenter = default

List virtual machines:

ovirt-snap list vm

+-----------------+-------+--------+--------------+------------------+
| Virtual machine | State | Memory | Storage      | Network          |
+-----------------+-------+--------+--------------+------------------+
| centos6         | down  | 1GB    | centos6:30GB | nic1:management1 |
+-----------------+-------+--------+--------------+------------------+
| centos7         | down  | 1GB    | centos7:50GB | nic1:management1 |
+-----------------+-------+--------+--------------+------------------+
| w2016           | down  | 3GB    | w2016:50GB   | nic1:management1 |
+-----------------+-------+--------+--------------+------------------+