{% extends "base.html" %} {% load i18n %} {% load static %} {% load operations %} {% load bootstrap_icons %} {% block title %}{% trans "Balance" %}{% endblock %} {% block content %}

{% trans "Migrations that give each host about the same share of its memory, then of its CPUs, for its running VMs: a host twice as large takes twice as much." %}

{% if unreachable %}
{% trans "These hosts cannot be read and are left out:" %} {{ unreachable|join:", " }}
{% endif %} {% if resting %}
{% trans "These hosts are in maintenance and are left out:" %} {{ resting|join:", " }}
{% endif %} {# each host's running VMs: the share of its memory now and, light to dark, after the migrations #}
{% for host in hosts %}
{{ host.name }} {% widthratio host.size.0 1 1024 as bytes %}{{ bytes|filesizeformat }}
{% for bar in host.bars %}{% if forloop.first or moves %} {% if forloop.first %}{% with memory=host.before.0 vcpus=host.before.1 %}
{% if moves %}{% trans "Now" %}{% else %}{% trans "Running VMs" %}{% endif %} {% widthratio memory 1 1024 as bytes %}{{ bytes|filesizeformat }}, {% blocktrans count counter=vcpus %}{{ counter }} vCPU{% plural %}{{ counter }} vCPUs{% endblocktrans %} {% blocktrans count counter=host.size.1 %}on {{ counter }} CPU{% plural %}on {{ counter }} CPUs{% endblocktrans %}
{% endwith %}{% else %}{% with memory=host.after.0 vcpus=host.after.1 %}
{% trans "After" %} {% widthratio memory 1 1024 as bytes %}{{ bytes|filesizeformat }}, {% blocktrans count counter=vcpus %}{{ counter }} vCPU{% plural %}{{ counter }} vCPUs{% endblocktrans %} {% blocktrans count counter=host.size.1 %}on {{ counter }} CPU{% plural %}on {{ counter }} CPUs{% endblocktrans %}
{% endwith %}{% endif %}
{% endif %}{% endfor %}
{% endfor %}
{# unticking a VM keeps it where it is and makes the proposal again #}
{% for instance in moves %}{% endfor %} {% for instance in pinned %}{% endfor %}
{% if moves %}
{% csrf_token %}{% submission_key %}
{% blocktrans count counter=moves|length %}Proposed migration ({{ counter }}){% plural %}Proposed migrations ({{ counter }}){% endblocktrans %}
{% for instance in moves %} {% endfor %}
{% trans "Name" %} {% trans "Memory" %} vCPU {% trans "Migration" %}
{% widthratio instance.info.2 1 1024 as bytes %}{{ bytes|filesizeformat }} {{ instance.info.3 }} {{ instance.compute.name }} {% bs_icon 'arrow-right' %} {{ instance.target.name }}
{% else %}
{% trans "The hosts are balanced: no migration would even them out more." %}
{% endif %} {% if pinned or unmovable %}
{% trans "Stay where they are" %}
{% for instance in pinned %} {% endfor %} {% for instance in unmovable %} {% endfor %}
{% trans "Let it move" %} {% trans "Name" %} {% trans "Host" %} {% trans "Why" %}
{{ instance.compute.name }} {% trans "You kept it here: tick it to let it move" %}
{{ instance.name }} {{ instance.compute.name }} {% for refusal in instance.refusals %}{{ refusal }}{% if not forloop.last %}
{% endif %}{% endfor %}
{% endif %} {% endblock %} {% block script %} {% endblock %}