{% load i18n %} {% load bootstrap_icons %} {% load operations %}
{% with busy=instance.snapshot_jobs held=instance.held_by_job %}
{% if busy %}
{% trans "A disk job is running on this VM; snapshot actions are unavailable until it ends." %}
{% endif %}
{% if instance.status != 5 %}

{% trans "With running machine, internal snapshots may take more than an hour, depending on how much memory has on your instance and how large the disk is." %}

{% trans "The VM is paused while its memory is saved." %}

{% else %}

{% trans "Create an internal snapshot" %}

{% endif %}
{% csrf_token %}{% submission_key %}
| {% if instance.external_snapshots or busy or held %} {% else %} {% endif %}

{% trans "Create an external snapshot. Each disk keeps its state in a new file next to it." %}

{% csrf_token %}{% submission_key %}
| {% if instance.internal_snapshots or busy or held %} {% else %} {% endif %}
{% if instance.status == 1 and instance.guest_agent_ready %} {% else %} {% endif %}

{% trans "A VM with snapshots cannot be migrated." %}

{% if instance.internal_snapshots or instance.external_snapshots %}

{% trans "Choose a snapshot for restore/delete" %}

{% if instance.internal_snapshots %}
{% trans "Internal" %}
{% for snap in instance.internal_snapshots %} {% endfor %}
{% trans "Date" %} {% trans "Name" %} {% trans "Description" %} {% trans "Action" %}
{{ snap.date|date:"M d H:i:s" }} {{ snap.name }} {{ snap.description }}
{% csrf_token %}{% submission_key %} {% if instance.status == 5 %} {% else %} {% endif %}
{% csrf_token %}
{% endif %} {% if instance.external_snapshots %}
{% trans "External" %}
{% for ext_snap in instance.external_snapshots %} {% endfor %}
{% trans "Date" %} {% trans "Name" %} {% trans "Description" %} {% trans "Action" %}
{{ ext_snap.date|date:"M d H:i:s" }} {{ ext_snap.name }} {% if ext_snap.current %}{% trans "current" %}{% endif %} {% if ext_snap.memory %}{% trans "memory" %}{% endif %} {{ ext_snap.description }}
{% csrf_token %}{% submission_key %}
{% csrf_token %}{% submission_key %}
{% endif %} {% else %}

{% trans "You do not have any snapshots" %}

{% endif %}
{% endwith %}