Metadata-Version: 2.5
Name: trytond_strings_xo_snapshot
Version: 8.0.0.1
Summary: Xen Orchestra Snapshot Schedules
Author: Clemens Hupka
Maintainer-email: Clemens Hupka <clemens.hupka@backend.at>
License-Expression: GPL-3.0-or-later
License-File: COPYRIGHT
License-File: LICENSE
Keywords: orchestra,snapshot,tryton,virtualization,xcp-ng,xen
Classifier: Development Status :: 2 - Pre-Alpha
Classifier: Environment :: Plugins
Classifier: Framework :: Tryton
Classifier: Topic :: Office/Business
Classifier: Topic :: System :: Systems Administration
Requires-Python: >=3.10
Requires-Dist: trytond-company<8.1,>=8.0
Requires-Dist: trytond-strings-xo-compute<8.1,>=8.0
Requires-Dist: trytond-strings-xo<8.1,>=8.0
Requires-Dist: trytond<8.1,>=8.0
Provides-Extra: test
Description-Content-Type: text/x-rst

Xen Orchestra Snapshot Schedules
================================

The ``strings_xo_snapshot`` module takes recurring snapshots of the
virtual machines mirrored by ``strings_xo_compute`` from schedules
stored in Tryton.  A schedule describes *what* to snapshot, *when* and
*how many* snapshots to keep, and the snapshots themselves are taken by
Xen Orchestra through its REST API v0.

Features
--------

- **Per-machine or per-tag schedules**: a schedule targets a single
  virtual machine or every active machine of a server carrying a tag,
  so that a whole population of machines is snapshotted without
  describing each of them.
- **Interval and retention**: each schedule declares the interval
  between two runs, in minutes, hours or days, and the number of
  snapshots it keeps per machine; the older ones are destroyed.
- **Disk or disk and RAM mode**: the mode of a schedule tells whether
  the snapshot holds the disk alone or also the memory of the guest.
  The Xen Orchestra REST API v0 exposes the disk snapshot only, so a
  schedule asking for the disk and the RAM is refused when it runs,
  with a message naming the limitation, instead of silently taking a
  snapshot of the disk alone.
- **Scheduled execution**: a scheduled ``ir.cron`` runs every active
  schedule whose interval has elapsed; a schedule can also be run at
  once from its *Run Now* button.
- **Safe retention**: only the snapshots created by a schedule are
  pruned.  They are recognised by the prefix of their name label, so a
  snapshot taken by hand, by another schedule or by a backup job is
  never destroyed.
- **Failure isolation**: the failure of a machine never leaves the
  remaining ones unsnapshotted, and the outcome of every run is stored
  on the schedule and logged.
- **Security**: dedicated access groups, model access rights and a
  permission on the *Run Now* button restricting a run to the
  administration groups.

Configuration
-------------

After installing the module, open *Xen Orchestra > Snapshots >
Schedules* to describe the schedules.  The snapshot schedules are also
listed on the *Snapshots* page of a virtual machine and of a server.

The module reads the ``[strings_xo_snapshot]`` section of the trytond
configuration file:

.. code-block:: ini

    [strings_xo_snapshot]
    schedule_cron = True
    snapshot_name_max = 50

``schedule_cron``
    whether the scheduled run of the schedules is enabled; defaults to
    ``True``.
``snapshot_name_max``
    the maximum number of characters of the name label given to a
    snapshot; defaults to ``50``.  The timestamp of a run is always
    preserved in the label.

The scheduled action ticks at a base granularity of five minutes and
every schedule skips itself while its own interval has not elapsed, so
the effective interval is controlled by the schedule itself.  The run
can also be suspended by deactivating the scheduled action record.
