{% load i18n %} {% load tz %} {% get_current_timezone as TIME_ZONE %} {% load operations %} {% load vm_states %}
{% with busy=instance.snapshot_jobs held=instance.held_by_job %} {% vm_state instance.status as state %}

{% trans "Snapshots" %} · {{ state.0 }}

{% if busy %}
{% trans "A disk job is running on this VM; snapshot actions are unavailable until it ends." %}
{% endif %} {# an external snapshot is the way: each disk goes on in a new file, the VM keeps running #}
{% csrf_token %}{% submission_key %}
{% if instance.status == 1 and instance.guest_agent_ready %} {% else %} {% endif %}

{% if instance.internal_snapshots %}{% trans "The VM has internal snapshots: delete them before taking an external one." %} {% elif instance.newer_than_current_snapshot %}{% trans "Snapshots newer than the one reverted to exist: delete them before taking a new one." %} {% else %}{% trans "Each disk goes on in a new file next to it; the VM keeps running." %} {% if instance.status == 1 %}{% trans "With memory, the VM pauses while its memory is saved." %}{% endif %} {% if instance.status != 1 %}{% trans "Memory and frozen file systems are for a running VM." %}{% elif not instance.guest_agent_ready %}{% trans "Freezing needs the guest agent, which is not connected." %}{% endif %}{% endif %}

{% trans "Internal snapshot: a fallback for a VM that cannot take an external one" %}
{% csrf_token %}{% submission_key %}

{% if instance.status == 1 %}{% trans "The disks and memory go into the disk files. The VM does not respond while its memory is saved, which can take long: avoid it in production." %} {% elif instance.status == 3 %}{% trans "The disks and memory go into the disk files; the paused VM stays paused." %} {% else %}{% trans "The disks go into their files." %}{% endif %}

{% if instance.external_snapshots %}

{% trans "The VM has external snapshots: the two kinds do not mix." %}

{% endif %}
{% if instance.snapshots %}
    {% for snap in instance.snapshots %}
  • {{ snap.name }}{% if snap.description %} · {{ snap.description }}{% endif %} · {% if snap.external %}{% trans "external" %}{% if snap.memory %}, {% trans "with memory" %}{% endif %}{% else %}{% trans "internal" %}{% endif %}{% if snap.current %}, {% trans "current" %}{% endif %} · {{ snap.date|date:"Y-m-d H:i" }}
    {% if snap.external %}
    {% csrf_token %}{% submission_key %}
    {% csrf_token %}{% submission_key %}
    {% else %}
    {% csrf_token %}{% submission_key %}
    {% csrf_token %}
    {% endif %}
  • {% endfor %}
{% if instance.internal_snapshots and instance.status != 5 %}

{% trans "Shut the VM down to revert to an internal snapshot." %}

{% endif %} {% else %}

{% trans "The VM has no snapshot." %}

{% endif %}

{% blocktrans %}Times in {{ TIME_ZONE }}. A VM with snapshots cannot be migrated.{% endblocktrans %}

{% endwith %}