{% load i18n %}
{% if can_change %} {% if instance.status == 5 or not instance.vcpus %}
{% csrf_token %}

{% trans "Logical host CPUs" %} : {{ vcpu_host }}

{% if instance.status == 5 %} {% else %} {% endif %}
{% else %}

{% trans "Logical Instance Active/Maximum CPUs" %} : {{ instance.cur_vcpu }} / {{ instance.vcpu }}

{% if request.user.is_superuser %} {% for id, vcpu in instance.vcpus.items %}
{% csrf_token %}
{% if vcpu.enabled == 'yes' and vcpu.hotpluggable == "yes" %} {% elif vcpu.enabled == 'yes' and vcpu.hotpluggable == "no" %} {% else %} {% endif %}
{% endfor %} {% endif %}
{% endif %} {% else %} {% trans "You don't have permission for resizing instance" %} {% endif %}
{% if can_change %}
{% csrf_token %}

{% trans "Total host memory" %}: {{ memory_host|filesizeformat }}

{% trans "Custom value" %}
{# a running VM keeps its maximum: only the current memory changes #} {% if instance.status == 5 %} {% trans "Custom value" %} {% else %} {% trans "Shut off the VM to change the maximum" %} {% endif %}
{% else %} {% trans "You don't have permission for resizing instance" %} {% endif %}
{% if can_change %}
{% csrf_token %}

{% trans "New disk size (GiB); leave empty to keep a disk as it is" %}:

{% for disk in instance.disks %}
{% if disk.storage is None %}
{% trans "Error getting disk info" %}
{% else %}
{# empty: the disk stays as it is #}
{% endif %}
{% endfor %} {% if instance.status == 1 or instance.status == 3 or instance.status == 5 %} {% else %} {% endif %}
{% else %} {% trans "You don't have permission for resizing instance" %} {% endif %}