Commit 7dbb9c7e by Kálmán Viktor

dashboard: mass op smart migrate

parent e64d3033
......@@ -2,28 +2,34 @@
{% load i18n %}
{% load sizefieldtags %}
{% block question %}
{% blocktrans with %}
Choose a compute node to migrate the selected VMs to.
{% endblocktrans %}
<p class="text-info">{{}}: {{op.description}}</p>
{% endblock %}
{% block formfields %}
<hr />
<ul id="vm-migrate-node-list" class="list-unstyled">
<li class="panel panel-default panel-primary mass-migrate-node">
<div class="panel-body">
<label for="migrate-to-none">
<strong>{% trans "Reschedule" %}</strong>
<input id="migrate-to-none" type="radio" name="node" value="" style="float: right;" checked="checked">
<span class="vm-migrate-node-property">
{% trans "This option will reschedule each virtual machine to the most optimal node." %}
<div style="clear: both;"></div>
{% for n in nodes %}
<li class="panel panel-default mass-migrate-node">
<li class="panel panel-default mass-migrate-node">
<div class="panel-body">
<label for="migrate-to-{{}}">
<strong>{{ n }}</strong>
<input id="migrate-to-{{}}" type="radio" name="node" value="{{ }}" style="float: right;" checked="checked">
<input id="migrate-to-{{}}" type="radio" name="node" value="{{ }}" style="float: right;"/>
<span class="vm-migrate-node-property">{% trans "CPU load" %}: {{ n.cpu_usage }}</span>
<span class="vm-migrate-node-property">{% trans "RAM usage" %}: {{ n.byte_ram_usage|filesize }}/{{ n.ram_size|filesize }}</span>
<div style="clear: both;"></div>
{% endfor %}
<hr />
......@@ -1124,7 +1124,9 @@ class MassMigrationView(MassOperationView):
node = self.request.POST.get("node")
if node:
node = get_object_or_404(Node, pk=node)
extra["to_node"] = node
node = None
extra["to_node"] = node
return super(MassMigrationView, self).post(request, extra, *args,
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment