{% load i18n %} {% load bootstrap_icons %} {% load operations %}
{% with busy=instance.snapshot_jobs held=instance.held_by_job %}
{% if busy %}
{% trans "A snapshot job is running:" %} {% for job in busy %}{{ job.dev }} {% widthratio job.cur job.end 100 %}%{% if not forloop.last %}, {% endif %}{% endfor %}. {% trans "Reload the page to see its progress." %}
{% 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 "Live snapshot could cause server timeout and instance might be paused!!!" %}

{% else %}

{% trans "Create an internal snapshot" %}

{% endif %}
{% csrf_token %}
| {% 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 %}
| {% 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 %} {% 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 %}
{% csrf_token %}{% submission_key %}
{% endif %} {% else %}

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

{% endif %}
{% endwith %}