diff --git a/computes/balance.py b/computes/balance.py new file mode 100644 index 00000000..9f5ab227 --- /dev/null +++ b/computes/balance.py @@ -0,0 +1,41 @@ +"""The Balance page's proposal: which running VMs to migrate so that the +hosts give their running VMs about the same memory, then the same vCPUs.""" + + +def propose(loads, vms, room): + """The moves [(VM, source, target)] and the loads after them. + + loads: {host: (memory KiB, vCPUs)} that each host gives its running VMs, + all of them, also those that cannot move. vms: the VMs that may move, + (VM, host, memory KiB, vCPUs, the hosts it may go to). room: {host: its + memory KiB its running and paused VMs leave}; the VMs moved to a host + fit in it without those moved away, so the moves may run in any order. + + Each step takes the one move that most lowers the sum of the squared + memory loads, then of the squared vCPU loads, and stops when none does: + each VM moves at most once.""" + loads = {host: list(load) for host, load in loads.items()} + room = dict(room) + left, moves = sorted(vms), [] + while True: + best = None + for vm in left: + pk, source, ram, vcpus, targets = vm + for target in sorted(targets): + if ram > room[target]: + continue + # the change of each sum of squares: (s - x)² + (t + x)² - s² - t² + change = tuple(2 * size * (loads[target][i] - loads[source][i] + size) + for i, size in enumerate((ram, vcpus))) + if change < (0, 0) and (best is None or change < best[0]): + best = (change, vm, target) + if best is None: + return moves, loads + _change, vm, target = best + pk, source, ram, vcpus, _targets = vm + for i, size in enumerate((ram, vcpus)): + loads[source][i] -= size + loads[target][i] += size + room[target] -= ram + left.remove(vm) + moves.append((pk, source, target)) diff --git a/computes/jobs.py b/computes/jobs.py index bc876db6..567c7a26 100644 --- a/computes/jobs.py +++ b/computes/jobs.py @@ -14,12 +14,12 @@ from operations.jobs import Cancelled, Kind, Outcome, Plan, register from operations.models import Claim, Operation -# where a host is: a bulk migration stops if either host's record points elsewhere since it was asked +# where a host is: a bulk migration stops if a host's record points elsewhere since it was asked WHERE = ("hostname", "login", "type") -def _where(params): - return [list(Compute.objects.filter(pk=pk).values_list(*WHERE).first() or []) for pk in (params["compute"], params["target"])] +def _where(hosts): + return [list(Compute.objects.filter(pk=pk).values_list(*WHERE).first() or []) for pk in sorted(hosts)] def parallel_limit(): @@ -29,43 +29,39 @@ def parallel_limit(): return min(max(1, slots // 2), slots - 1) -@register -class BulkMigrate(Kind): - """Migrates the chosen VMs of a host to another, each in a migrate job - of its own, at most parallel at once: one that fails leaves its VM on - the host and the rest go on.""" +class Migrations(Kind): + """Migrates VMs, each in a migrate job of its own, at most parallel at + once: one that fails stays where it is and the rest go on. One such job + at a time (it waits in a worker slot for its migrations). A kind gives + its moves, [(VM, source, target)], and the options of its migrations.""" - name = "host.bulk_migrate" - label = gettext_noop("Bulk migrate") cancellable = True + options = {} - def normalize(self, raw): - return {"compute": int(raw["compute"]), "target": int(raw["target"]), "parallel": int(raw["parallel"]), - "instances": sorted({int(pk) for pk in raw["instances"]})} + def moves(self, params): + raise NotImplementedError + + def hosts(self, params): + return {host for _vm, source, target in self.moves(params) for host in (source, target)} def validate(self, user, params): if not user.is_superuser: raise PermissionDenied - if not params["instances"]: + if not self.moves(params): raise util.OperationError(gettext_noop("Choose the VMs to migrate")) if not 1 <= params["parallel"] <= parallel_limit(): raise util.OperationError(gettext_noop("At most %(limit)s migrations can run at once"), limit=parallel_limit()) - def plan(self, user, params): - compute = Compute.objects.get(pk=params["compute"]) - target = Compute.objects.get(pk=params["target"]) - return Plan(claims={claims.bulk_migrate_key(): Claim.EXCLUSIVE}, resource=claims.compute_key(compute.pk), - label=f"{compute.name} -> {target.name}", intent={"migrations": {}, "where": _where(params)}) - def precheck(self, op, ctx): if op.user is None or not op.user.is_active or not op.user.is_superuser: raise PermissionDenied def run(self, op, ctx): p = op.params - names = dict(Instance.objects.filter(pk__in=p["instances"], compute_id=p["compute"]).values_list("pk", "name")) - waiting = [pk for pk in p["instances"] if pk in names] # one moved or deleted meanwhile is left out + moves = self.moves(p) + names = dict(Instance.objects.filter(pk__in=[vm for vm, _source, _target in moves]).values_list("pk", "name")) + waiting = [move for move in moves if move[0] in names] # one deleted meanwhile is left out started, refused = {}, [] # VM: its migrate job; the VMs whose job was refused, and why ctx.record_intent() ctx.set_phase(gettext_noop("Migrating the VMs")) @@ -87,28 +83,30 @@ class BulkMigrate(Kind): # the worker's slots may have been lowered: this job waits in one, its migrations need others; # once it ends, the migrations it queued run if parallel_limit() < 1: - stop(gettext_noop("The worker now runs one job at a time: the VMs not yet started stay on the host")) - if waiting and _where(p) != op.intent["where"]: - stop(gettext_noop("A host was changed or deleted: the VMs not yet started stay on the host")) - for pk in list(waiting): + stop(gettext_noop("The worker now runs one job at a time: the VMs not yet started stay where they are")) + if waiting and _where(self.hosts(p)) != op.intent["where"]: + stop(gettext_noop("A host was changed or deleted: the VMs not yet started stay where they are")) + for move in list(waiting): if len(running) >= min(p["parallel"], parallel_limit()): break - waiting.remove(pk) - if not Instance.objects.filter(pk=pk, compute_id=p["compute"]).exists(): - continue # it left the host meanwhile - raw = {"instance": pk, "source": p["compute"], "target": p["target"], "live": True, "autoconverge": True} + waiting.remove(move) + vm, source, target = move + if not Instance.objects.filter(pk=vm, compute_id=source).exists(): + continue # it left its host meanwhile + raw = {"instance": vm, "source": source, "target": target, "live": True, "autoconverge": True, + **self.options} try: - child = jobs.submit("instance.migrate", op.user, raw, f"bulk-{op.pk.hex}-{pk}", parent=op) + child = jobs.submit("instance.migrate", op.user, raw, f"bulk-{op.pk.hex}-{vm}", parent=op) except claims.Busy as busy: if busy.blocker is not None and busy.blocker.state == Operation.UNCERTAIN: # it holds its claims until someone resolves it - refused.append(f"{names[pk]}: {utils.busy_message(busy, op.user)}") + refused.append(f"{names[vm]}: {utils.busy_message(busy, op.user)}") else: - waiting.append(pk) # another job holds the VM or a host: asked again on the next round + waiting.append(move) # another job holds the VM or a host: asked again on the next round except Exception as err: - refused.append(f"{names[pk]}: {utils.safe_text(err)}") + refused.append(f"{names[vm]}: {utils.safe_text(err)}") else: - started[pk] = child.pk + started[vm] = child.pk running.append(child.pk) ctx.record_intent(migrations={str(vm): str(job) for vm, job in started.items()}) if not waiting and not running: @@ -122,8 +120,8 @@ class BulkMigrate(Kind): return {} def progress(self, op): - """(the VMs whose migration ended, the chosen VMs).""" - return op.children.filter(state__in=Operation.TERMINAL).count(), len(op.params["instances"]) + """(the VMs whose migration ended, the VMs to migrate).""" + return op.children.filter(state__in=Operation.TERMINAL).count(), len(self.moves(op.params)) def cancel(self, op): """run sees the cancel and cancels the migrations that run.""" @@ -134,7 +132,63 @@ class BulkMigrate(Kind): return Outcome(Operation.FAILED, error=utils.say(gettext_noop( "The bulk migration stopped: the migrations it started go on as their own jobs; the other VMs stay"))) + +@register +class BulkMigrate(Migrations): + """Migrates the chosen VMs of a host to another, for the host's + maintenance: a running VM live, a shut-off one offline.""" + + name = "host.bulk_migrate" + label = gettext_noop("Bulk migrate") + + def normalize(self, raw): + return {"compute": int(raw["compute"]), "target": int(raw["target"]), "parallel": int(raw["parallel"]), + "instances": sorted({int(pk) for pk in raw["instances"]})} + + def moves(self, params): + return [(vm, params["compute"], params["target"]) for vm in params["instances"]] + + def plan(self, user, params): + compute = Compute.objects.get(pk=params["compute"]) + target = Compute.objects.get(pk=params["target"]) + return Plan(claims={claims.bulk_migrate_key(): Claim.EXCLUSIVE}, resource=claims.compute_key(compute.pk), + label=f"{compute.name} -> {target.name}", + intent={"migrations": {}, "where": _where(self.hosts(params))}) + def log_entry(self, op, state): source, _sep, target = op.resource_label.partition(" -> ") message = f"Bulk migrate to {target}" return source, "", "", message if state == Operation.SUCCEEDED else f"{message} ({state})" + + +@register +class Balance(Migrations): + """Migrates running VMs between hosts, as the Balance page proposed, to + even out what the hosts give their running VMs. Each migration takes + only a running VM: one stopped since is left where it is.""" + + name = "host.balance" + label = gettext_noop("Balance") + options = {"running_only": True} + + def normalize(self, raw): + moves = {int(vm): (int(source), int(target)) for vm, source, target in raw["moves"]} + return {"parallel": int(raw["parallel"]), + "moves": [[vm, source, target] for vm, (source, target) in sorted(moves.items())]} + + def moves(self, params): + return [tuple(move) for move in params["moves"]] + + def validate(self, user, params): + super().validate(user, params) + if any(source == target for _vm, source, target in self.moves(params)): + raise util.OperationError(gettext_noop("A VM is already on its destination")) + + def plan(self, user, params): + names = Compute.objects.filter(pk__in=self.hosts(params)).order_by("name").values_list("name", flat=True) + return Plan(claims={claims.bulk_migrate_key(): Claim.EXCLUSIVE}, resource=claims.bulk_migrate_key(), + label=", ".join(names), intent={"migrations": {}, "where": _where(self.hosts(params))}) + + def log_entry(self, op, state): + message = f"Balance {op.resource_label}: {len(op.params['moves'])} VMs" + return "", "", "", message if state == Operation.SUCCEEDED else f"{message} ({state})" diff --git a/computes/templates/computes/balance.html b/computes/templates/computes/balance.html new file mode 100644 index 00000000..cef80e9d --- /dev/null +++ b/computes/templates/computes/balance.html @@ -0,0 +1,126 @@ +{% extends "base.html" %} +{% load i18n %} +{% load static %} +{% load operations %} +{% block title %}{% trans "Balance" %}{% endblock %} +{% block page_heading %}{% trans "Balance" %}{% endblock page_heading %} + +{% block content %} +

{% trans "Migrations of running VMs that even out the memory, then the vCPUs, the hosts give their running VMs. Each VM migrates live in a job of its own; one that fails or stops meanwhile stays where it is." %}

+{% if unreachable %} +
{% trans "These hosts cannot be read and are left out:" %} {{ unreachable|join:", " }}
+{% endif %} +
+ + + + + + + + + + {% for host in hosts %} + + + + + + {% endfor %} + +
{% trans "Host" %}{% trans "Memory" %}{% trans "VCPU" %}
{{ host.name }}{% widthratio host.before.0 1048576 1 %} GiB{% if host.after.0 != host.before.0 %} → {% widthratio host.after.0 1048576 1 %} GiB{% endif %}{{ host.before.1 }}{% if host.after.1 != host.before.1 %} → {{ host.after.1 }}{% endif %}
+
+

{% trans "After: if every migration below succeeds." %}

+ +{# 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 %} +
+ + + + + + + + + + + + + {% for instance in moves %} + + + + + + + + + {% endfor %} + +
{% trans "Name" %}{% trans "VCPU" %}{% trans "Memory" %}{% trans "Host" %}{% trans "Destination" %}
{{ instance.info.3 }}{% widthratio instance.info.2 1024 1 %} MiB{{ instance.compute.name }}{{ instance.target.name }}
+
+ {% else %} +
{% trans "No migration would even out the hosts more." %}
+ {% endif %} + {% if pinned %} +
{% trans "Stay where they are" %}
+
+ + + {% for instance in pinned %} + + + + + + {% endfor %} + +
{{ instance.compute.name }}
+
+ {% endif %} +
+{% if unmovable %} +
{% trans "Cannot move" %}
+
+ + + {% for instance in unmovable %} + + + + + + {% endfor %} + +
{{ instance.name }}{{ instance.compute.name }}{% for refusal in instance.refusals %}{{ refusal }}{% if not forloop.last %}
{% endif %}{% endfor %}
+
+{% endif %} + +{% if moves %} +{% if not parallel %} +
{% trans "The worker runs one job at a time: set Worker Concurrency to 2 or more on the Settings page." %}
+{% else %} +
{% csrf_token %}{% submission_key %} + {% for instance in moves %} + + + + {% endfor %} +
+ + +
+ +
+{% endif %} +{% endif %} +{% endblock %} +{% block script %} + +{% endblock %} diff --git a/computes/templates/computes/list.html b/computes/templates/computes/list.html index 599fe60d..5df2d13f 100644 --- a/computes/templates/computes/list.html +++ b/computes/templates/computes/list.html @@ -2,11 +2,14 @@ {% load i18n %} {% load static %} {% load bootstrap_icons %} +{% load operations %} {% block title %}{% trans "Computes" %}{% endblock %} {% block content %} +
{% include 'create_comp_block.html' %} + {% if computes|length > 1 %}{% trans "Balance" %}{% endif %} {% include 'search_block.html' %}

{% trans "Computes" %}

@@ -118,5 +121,7 @@ {% endblock content %} {% block script %} + +{% job_panel_script job_resource %} {% endblock script %} diff --git a/computes/tests/test_balance.py b/computes/tests/test_balance.py new file mode 100644 index 00000000..4b05fc46 --- /dev/null +++ b/computes/tests/test_balance.py @@ -0,0 +1,195 @@ +"""Balance proposes migrations of running VMs that even out the memory, then +the vCPUs, the hosts give their running VMs, and runs the proposal shown in +one job of migrate jobs that take only a running VM.""" + +from unittest.mock import patch + +import libvirt +from computes.balance import propose +from computes.jobs import Balance +from computes.models import Compute +from django.contrib.auth import get_user_model +from django.test import SimpleTestCase, TestCase +from django.urls import reverse +from instances.models import Instance +from lxml import etree, html +from operations import claims, jobs +from operations.models import Operation + +DOMAIN = """{name}1281 +hvm{disk}""" +LOCAL = "" +ROOM = {"a": 100, "b": 100, "c": 100, "d": 100} + + +class ProposeTests(SimpleTestCase): + def test_moves_even_out_the_memory_also_past_a_plateau_of_the_spread(self): + # the largest minus the smallest load stays 10 after the first move; the sum of squares does not + loads = {"a": (10, 0), "b": (10, 0), "c": (0, 0), "d": (0, 0)} + vms = [(1, "a", 5, 0, {"b", "c", "d"}), (2, "a", 5, 0, {"b", "c", "d"}), + (3, "b", 5, 0, {"a", "c", "d"}), (4, "b", 5, 0, {"a", "c", "d"})] + moves, after = propose(loads, vms, ROOM) + self.assertEqual(len(moves), 2) + self.assertEqual(sorted(load[0] for load in after.values()), [5, 5, 5, 5]) + + def test_the_memory_comes_first_then_the_vcpus(self): + loads = {"a": (8, 2), "b": (0, 6)} + vms = [(1, "a", 4, 1, {"b"}), (2, "b", 0, 3, {"a"})] + moves, after = propose(loads, vms, ROOM) + self.assertEqual(moves, [(1, "a", "b"), (2, "b", "a")]) + self.assertEqual(after, {"a": [4, 4], "b": [4, 4]}) + + def test_a_vm_moves_once_and_only_where_it_may_go(self): + loads = {"a": (12, 0), "b": (0, 0), "c": (0, 0)} + moves, _after = propose(loads, [(1, "a", 6, 0, {"b"}), (2, "a", 6, 0, {"b"})], ROOM) + self.assertEqual(moves, [(1, "a", "b")]) + + def test_no_move_fills_a_host_past_its_room(self): + loads = {"a": (60, 0), "b": (50, 0)} + self.assertEqual(propose(loads, [(1, "a", 30, 0, {"b"})], {"a": 40, "b": 20}), ([], {"a": [60, 0], "b": [50, 0]})) + + def test_a_vm_moved_away_makes_no_room_for_one_moved_in(self): + # b's room stays 0 after vm 2 leaves it: vm 1 would fill b before vm 2 has left, if it ran first + loads = {"a": (100, 0), "b": (80, 0), "c": (0, 0)} + vms = [(1, "a", 30, 0, {"b"}), (2, "b", 40, 0, {"c"})] + self.assertEqual(propose(loads, vms, {"a": 0, "b": 0, "c": 100})[0], [(2, "b", "c")]) + + def test_even_hosts_need_no_move(self): + loads = {"a": (4, 2), "b": (4, 2)} + self.assertEqual(propose(loads, [(1, "a", 4, 2, {"b"})], ROOM)[0], []) + + +class BalancePageTests(TestCase): + def setUp(self): + self.conn = libvirt.open("test:///default") + self.addCleanup(self.conn.close) + self.compute = Compute.objects.create(name="ba", hostname="localhost", login="", password="", type=4) + self.other = Compute.objects.create(name="ba-other", hostname="198.51.100.41", login="", password="", type=4) + self.vms = {} + for name, running, disk in (("ba-1", True, ""), ("ba-2", True, ""), ("ba-off", False, ""), + ("ba-local", True, LOCAL)): + domain = self.conn.defineXML(DOMAIN.format(name=name, disk=disk.format(name=name))) + self.addCleanup(domain.undefine) + if running: + domain.create() + self.addCleanup(domain.destroy) + self.vms[name] = Instance.objects.create(compute=self.compute, name=name, uuid=domain.UUIDString()) + self.client.force_login(get_user_model().objects.create_superuser("ba-admin", "ba@example.com", "pw")) + + def page(self, **query): + def disk_plan(conn, xml): + return [{"shared": "/local/" not in path} for path in etree.fromstring(xml).xpath("//source/@file")] + + with patch("vrtManager.connection.connection_manager.get_connection", return_value=self.conn), \ + patch("computes.views.utils.refresh_instance_database"), \ + patch("instances.jobs.migration_target"), \ + patch("computes.views.wvmInstances") as dest: + dest.return_value.disk_plan.side_effect = disk_plan + self.response = self.client.get(reverse("balance"), query) + return html.fromstring(self.response.content) + + def moved(self, page): + return page.xpath("//form[@method='post']//input[@name='instance']/@value") + + def test_a_running_vm_moves_to_the_emptier_host(self): + page = self.page() + self.assertEqual(self.moved(page), [str(self.vms["ba-1"].pk)]) + self.assertEqual(page.xpath("//form[@method='post']//input[@name='target']/@value"), [str(self.other.pk)]) + + def test_a_vm_unticked_stays_and_another_moves_instead(self): + pk = str(self.vms["ba-1"].pk) + page = self.page(shown=pk) + self.assertEqual(self.moved(page), [str(self.vms["ba-2"].pk)]) + (box,) = page.xpath("//input[@name='vm'][@value=$pk]", pk=pk) + self.assertIsNone(box.get("checked")) # listed to tick again + self.assertEqual(self.moved(self.page(shown=pk, vm=pk)), [pk]) + + def test_a_vm_with_a_disk_the_hosts_do_not_share_cannot_move_and_still_counts(self): + page = self.page() + self.assertIn("ba-local", page.xpath("//h5[.='Cannot move']/following-sibling::div[1]")[0].text_content()) + host = next(host for host in self.response.context["hosts"] if host == self.compute) + self.assertEqual(host.before, [3 * 128 * 1024, 3]) # the shut-off VM is not counted + self.assertNotIn(str(self.vms["ba-off"].pk), page.xpath("//input[@name='vm' or @name='instance']/@value")) + + def test_a_host_that_does_not_answer_is_left_out(self): + def read_hosts(computes): + for compute in computes: + compute.status, compute.shown_capacity = (False, None) if compute == self.other else (True, compute.capacity) + + with patch("computes.views.read_hosts", side_effect=read_hosts): + page = self.page() + self.assertEqual(self.moved(page), []) + self.assertIn("ba-other", page.xpath("//div[contains(@class, 'alert-warning')]")[0].text_content()) + + def test_the_moves_shown_go_in_one_balance_job(self): + vm = self.vms["ba-1"].pk + response = self.client.post(reverse("balance"), {"instance": [vm], "source": [self.compute.pk], + "target": [self.other.pk], "parallel": "1", + "submission_key": "bal00000key"}) + self.assertRedirects(response, reverse("computes"), fetch_redirect_response=False) + (op,) = Operation.objects.all() + self.assertEqual((op.kind, op.params, op.resource), + ("host.balance", {"parallel": 1, "moves": [[vm, self.compute.pk, self.other.pk]]}, + claims.bulk_migrate_key())) + + +class Ctx: + """The job context run uses, without a worker.""" + + def __init__(self, op): + self.op = op + + def record_intent(self, **values): + self.op.intent = {**self.op.intent, **values} + + def set_phase(self, text): + pass + + +class BalanceJobTests(TestCase): + def setUp(self): + self.hosts = [Compute.objects.create(name=f"bj-{n}", hostname=f"192.0.2.5{n}", login="", password="", type=4) + for n in range(3)] + self.vms = [Instance.objects.create(compute=self.hosts[0], name=f"bj-{n}", + uuid=f"00000000-0000-4000-8000-00000000010{n}") for n in range(2)] + self.admin = get_user_model().objects.create_superuser("bj-admin", "bj@example.com", "pw") + patcher = patch("instances.jobs.MigrateInstance.validate") # the hosts are not asked + patcher.start() + self.addCleanup(patcher.stop) + self.moves = [[self.vms[0].pk, self.hosts[0].pk, self.hosts[1].pk], + [self.vms[1].pk, self.hosts[0].pk, self.hosts[2].pk]] + + def test_each_vm_migrates_to_its_own_host_and_only_while_running(self): + params = {"parallel": 2, "moves": self.moves} + op = Operation.objects.create(kind="host.balance", user=self.admin, username=self.admin.username, + submission_key="key-bal00001", params=params, + intent=Balance().plan(self.admin, params).intent) + + def ends(seconds): + Operation.objects.filter(kind="instance.migrate").update(state=Operation.SUCCEEDED) + + with patch("computes.jobs.time.sleep", side_effect=ends): + self.assertEqual(Balance().run(op, Ctx(op)), {}) + children = Operation.objects.filter(kind="instance.migrate", parent=op) + self.assertEqual(sorted([job.params["instance"], job.params["source"], job.params["target"]] for job in children), + self.moves) + self.assertTrue(all(job.params["running_only"] for job in children)) + self.assertEqual(Balance().progress(op), (2, 2)) + + def test_the_computes_page_shows_the_balance_and_the_hosts_pages_not_its_migrations(self): + balance = jobs.submit("host.balance", self.admin, {"parallel": 1, "moves": self.moves[:1]}, "key-bal00002") + child = jobs.submit("instance.migrate", self.admin, {"instance": self.vms[0].pk, "target": self.hosts[1].pk}, + "key-mig00010", parent=balance) + self.client.force_login(self.admin) + + def shown(key): + return [job["id"] for job in self.client.get(reverse("operation-resource"), {"key": key}).json()["jobs"]] + + self.assertEqual(shown(claims.bulk_migrate_key()), [str(balance.pk)]) + self.assertEqual(shown(claims.compute_key(self.hosts[0].pk)), []) + self.assertEqual(shown(claims.instance_key(self.vms[0].uuid)), [str(child.pk)]) + + def test_a_move_to_the_vms_own_host_is_refused(self): + raw = {"parallel": 1, "moves": [[self.vms[0].pk, self.hosts[0].pk, self.hosts[0].pk]]} + with self.assertRaisesRegex(Exception, "already on its destination"): + jobs.submit("host.balance", self.admin, raw, "key-bal00003") diff --git a/computes/tests/test_balance_js.py b/computes/tests/test_balance_js.py new file mode 100644 index 00000000..5095f1e7 --- /dev/null +++ b/computes/tests/test_balance_js.py @@ -0,0 +1,45 @@ +"""The Balance page's script (static/js/balance.js): a ticked or unticked VM +makes the proposal again; the header box ticks or unticks every VM listed +first.""" + +import json +import shutil +import subprocess +import unittest +from pathlib import Path + +SCRIPT = Path(__file__).resolve().parents[2] / "static" / "js" / "balance.js" + +RUN = """ +const vm = require("vm"); +const boxes = [{name: "moves", checked: true}, {name: "stays", checked: false}]; +let handler, submitted = 0; +const form = { + addEventListener: (name, fn) => { handler = fn; }, + querySelectorAll: () => boxes, + submit: () => { submitted += 1; }, +}; +vm.runInNewContext(SCRIPT, vm.createContext({document: {getElementById: () => form}})); +const seen = []; +for (const [id, checked] of STEPS) { + handler({target: {id, checked}}); + seen.push(boxes.filter((b) => b.checked).map((b) => b.name)); +} +console.log(JSON.stringify({seen, submitted})); +""" + + +@unittest.skipUnless(shutil.which("node"), "node is not installed") +class BalanceScriptTests(unittest.TestCase): + def run_script(self, steps): + """{seen: the ticked VMs after each step, submitted: the form's reloads}.""" + code = f"const SCRIPT = {json.dumps(SCRIPT.read_text())};" + RUN.replace("STEPS", json.dumps(steps)) + out = subprocess.run(["node", "-e", code], capture_output=True, text=True, check=True, timeout=30) + return json.loads(out.stdout) + + def test_a_vm_box_makes_the_proposal_again(self): + self.assertEqual(self.run_script([["balance-7", False]]), {"seen": [["moves"]], "submitted": 1}) + + def test_select_all_ticks_or_unticks_every_vm_and_makes_the_proposal_again(self): + result = self.run_script([["balance-all", True], ["balance-all", False]]) + self.assertEqual(result, {"seen": [["moves", "stays"], []], "submitted": 2}) diff --git a/computes/urls.py b/computes/urls.py index d6797e22..4c4e4a0a 100644 --- a/computes/urls.py +++ b/computes/urls.py @@ -28,6 +28,7 @@ def superuser_only_patterns(patterns): urlpatterns = [ path("", views.computes, name="computes"), + path("balance/", views.balance, name="balance"), path( "add_tcp_host/", views.compute_create, diff --git a/computes/views.py b/computes/views.py index 36581660..05465261 100644 --- a/computes/views.py +++ b/computes/views.py @@ -174,7 +174,8 @@ def computes(request): totals["cpus"] += given["cpus"] totals["assigned"] += given["assigned"]["all"] totals["memory"] += given["memory"] - return render(request, "computes/list.html", {"computes": computes, "totals": totals}) + return render(request, "computes/list.html", + {"computes": computes, "totals": totals, "job_resource": claims.bulk_migrate_key()}) @superuser_only @@ -229,6 +230,25 @@ def instances(request, compute_id): ) +def migration_refusal(request, instance, target, dests): + """Why the VM cannot migrate to target in a bulk migration, or None: a + disk file the two hosts do not share takes a copy, chosen on the VM's + Migrate tab. dests: {compute pk: its connection}, filled as needed.""" + from instances.jobs import migration_target + + try: + migration_target(instance, target.pk) + if target.pk not in dests: + dests[target.pk] = wvmInstances(target.hostname, target.login, target.password, target.type) + domain = instance.proxy.instance + for xml in (domain.XMLDesc(0), domain.XMLDesc(VIR_DOMAIN_XML_INACTIVE)): + if not all(disk["shared"] for disk in dests[target.pk].disk_plan(instance.proxy, xml)): + return _("A disk file is not on storage both hosts share: migrate it from its page") + except libvirtError as err: + return error_text(request, err) + return None + + @superuser_only def bulk_migrate(request, compute_id): """Migrates the chosen VMs of the host to another in one job, for the @@ -237,7 +257,6 @@ def bulk_migrate(request, compute_id): hosts do not share is not offered: it takes a copy, chosen on its own Migrate tab.""" from computes.jobs import parallel_limit - from instances.jobs import migration_target compute = get_object_or_404(Compute, pk=compute_id) targets = list(Compute.objects.exclude(pk=compute.pk).order_by("name")) @@ -262,23 +281,78 @@ def bulk_migrate(request, compute_id): utils.refresh_instance_database(compute) instances = list(Instance.objects.filter(compute=compute).order_by("name")) read_list_rows(instances, [compute]) - dest = None + dests = {} for instance in instances if target else (): - instance.refusal = None - try: - migration_target(instance, target.pk) - dest = dest or wvmInstances(target.hostname, target.login, target.password, target.type) - domain = instance.proxy.instance - for xml in (domain.XMLDesc(0), domain.XMLDesc(VIR_DOMAIN_XML_INACTIVE)): - if not all(disk["shared"] for disk in dest.disk_plan(instance.proxy, xml)): - instance.refusal = _("A disk file is not on storage both hosts share: migrate it from its page") - except libvirtError as err: - instance.refusal = error_text(request, err) + instance.refusal = migration_refusal(request, instance, target, dests) return render(request, "computes/bulk_migrate.html", {"compute": compute, "targets": targets, "target": target, "instances": instances, "parallel": range(1, parallel_limit() + 1)}) +@superuser_only +def balance(request): + """Proposes migrations of running VMs that even out the memory, then + the vCPUs, the hosts give their running VMs (computes.balance), and + runs the proposal shown in one job. A VM unticked stays where it is and + the proposal is made again without it: the form sends the VMs it showed + ("shown") and the ticked ones ("vm").""" + from computes.balance import propose + from computes.jobs import parallel_limit + + if request.method == "POST": + moves = zip(request.POST.getlist("instance"), request.POST.getlist("source"), request.POST.getlist("target")) + raw = {"parallel": request.POST.get("parallel", ""), "moves": list(moves)} + try: + op = jobs.submit("host.balance", request.user, raw, request.POST.get("submission_key", "")) + except claims.Busy as busy: + messages.error(request, busy_message(busy, request.user)) + except (ValueError, jobs.SubmissionConflict, libvirtError) as err: + messages.error(request, error_text(request, err)) + else: + jobs.remember_job(request, op) + return redirect("computes") + return redirect("balance") + + computes = list(Compute.objects.order_by("name")) + read_hosts(computes) # side by side and bounded: a host that does not answer is left out + hosts = {compute.pk: compute for compute in computes if compute.status is True and compute.shown_capacity} + for compute in hosts.values(): + utils.refresh_instance_database(compute) + instances = list(Instance.objects.filter(compute__in=hosts).order_by("name")) + read_list_rows(instances, hosts.values()) + running = [instance for instance in instances if instance.info and instance.info[0] == 1] + pinned = set(request.GET.getlist("shown")) - set(request.GET.getlist("vm")) + loads = {pk: [0, 0] for pk in hosts} + movable, unmovable, dests = [], [], {} + for instance in running: + loads[instance.compute_id][0] += instance.info[2] + loads[instance.compute_id][1] += instance.info[3] + if str(instance.pk) in pinned: + continue + refusals = {target: migration_refusal(request, instance, target, dests) + for target in hosts.values() if target.pk != instance.compute_id} + targets = {target.pk for target, refusal in refusals.items() if refusal is None} + if targets: + movable.append((instance.pk, instance.compute_id, instance.info[2], instance.info[3], targets)) + elif refusals: + instance.refusals = [f"{target.name}: {refusal}" for target, refusal in refusals.items()] + unmovable.append(instance) + # what the running and paused VMs, also those the panel does not list, leave of each host's memory + room = {pk: (compute.shown_capacity["memory"] - compute.shown_capacity["assigned"]["running"]) // 1024 + for pk, compute in hosts.items()} + moves, after = propose(loads, movable, room) + for pk, compute in hosts.items(): + compute.before, compute.after = loads[pk], after[pk] + by_pk = {instance.pk: instance for instance in running} + for vm, _source, target in moves: + by_pk[vm].target = hosts[target] + return render(request, "computes/balance.html", { + "hosts": hosts.values(), "unreachable": [compute for compute in computes if compute.pk not in hosts], + "moves": [by_pk[vm] for vm, _source, _target in moves], + "pinned": [instance for instance in running if str(instance.pk) in pinned], + "unmovable": unmovable, "parallel": range(1, parallel_limit() + 1)}) + + # the form of each kind of compute, by Compute.type FORMS = {form.conn_type: form for form in (TcpComputeForm, SshComputeForm, TlsComputeForm, SocketComputeForm)} diff --git a/instances/jobs.py b/instances/jobs.py index df3d74aa..4ef3099b 100644 --- a/instances/jobs.py +++ b/instances/jobs.py @@ -1075,7 +1075,7 @@ class CreateInstance(Kind): return _log(op, state, "create") -MIGRATE_OPTIONS = ("live", "unsafe", "offline", "autoconverge", "compress", "delete_source") +MIGRATE_OPTIONS = ("live", "unsafe", "offline", "autoconverge", "compress", "delete_source", "running_only") def migration_target(instance, target_pk): diff --git a/instances/utils.py b/instances/utils.py index bf33a842..cff6525a 100644 --- a/instances/utils.py +++ b/instances/utils.py @@ -306,6 +306,7 @@ def migrate_instance( autoconverge=False, compress=False, delete_source=False, + running_only=False, disk_pools=None, ip=None, on_moved=None, @@ -345,6 +346,7 @@ def migrate_instance( uri=new_compute.migration_uri, pools=disk_pools, on_copy=on_copy, + running_only=running_only, ) except Exception as error: log(f"migrate to {target}", error) diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo index 70400623..942366e8 100644 Binary files a/locale/tr/LC_MESSAGES/django.mo and b/locale/tr/LC_MESSAGES/django.mo differ diff --git a/locale/tr/LC_MESSAGES/django.po b/locale/tr/LC_MESSAGES/django.po index 8d678983..417273f0 100644 --- a/locale/tr/LC_MESSAGES/django.po +++ b/locale/tr/LC_MESSAGES/django.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-15 16:43+0000\n" +"POT-Creation-Date: 2026-11-16 04:31+0000\n" "PO-Revision-Date: 2020-11-04 12:00+0000\n" "Last-Translator: catborise , 2020\n" "Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n" @@ -64,7 +64,8 @@ msgstr "Açık anahtar zaten mevcut" msgid "Invalid key" msgstr "Geçersiz anahtar" -#: accounts/forms.py:95 computes/templates/computes/bulk_migrate.html:45 +#: accounts/forms.py:95 computes/templates/computes/balance.html:45 +#: computes/templates/computes/bulk_migrate.html:45 #: computes/templates/computes/instances.html:46 #: instances/templates/add_instance_volume.html:39 #: instances/templates/allinstances_index_grouped.html:11 @@ -215,8 +216,8 @@ msgid "User sections" msgstr "Kullanıcı bölümleri" #: accounts/templates/account.html:50 accounts/templates/account.html:58 -#: admin/forms.py:207 computes/templates/computes/list.html:30 -#: computes/templates/computes/list.html:57 computes/templates/overview.html:46 +#: admin/forms.py:207 computes/templates/computes/list.html:33 +#: computes/templates/computes/list.html:60 computes/templates/overview.html:46 #: instances/views.py:262 msgid "VMs" msgstr "Sanal makineler" @@ -236,7 +237,8 @@ msgid "Add VM" msgstr "Sanal makine ekle" #: accounts/templates/account.html:68 admin/templates/admin/logs.html:40 -#: computes/templates/computes/list.html:56 +#: computes/templates/computes/balance.html:17 +#: computes/templates/computes/list.html:59 #: instances/templates/allinstances.html:108 #: instances/templates/allinstances_index_nongrouped.html:8 #: instances/templates/create_steps.html:6 @@ -250,7 +252,7 @@ msgstr "Sunucu" msgid "Power and console only" msgstr "Yalnızca güç ve konsol" -#: accounts/templates/account.html:80 computes/templates/computes/list.html:102 +#: accounts/templates/account.html:80 computes/templates/computes/list.html:105 #: instances/templates/instance_actions.html:9 #: storages/templates/storage.html:140 #, python-format @@ -758,7 +760,7 @@ msgstr "" "NEW_USER_DEFAULT_INSTANCES: %(name)s sanal makinesinin bir sahibi var ve " "yalnızca bir sahibe izin veriliyor" -#: admin/forms.py:208 computes/templates/computes/list.html:58 +#: admin/forms.py:208 computes/templates/computes/list.html:61 #: computes/templates/overview.html:58 instances/forms.py:15 #: instances/templates/allinstances_index_grouped.html:16 #: instances/templates/allinstances_index_nongrouped.html:14 @@ -768,9 +770,11 @@ msgstr "" msgid "vCPUs" msgstr "vCPU" -#: admin/forms.py:209 computes/templates/computes/bulk_migrate.html:48 +#: admin/forms.py:209 computes/templates/computes/balance.html:18 +#: computes/templates/computes/balance.html:47 +#: computes/templates/computes/bulk_migrate.html:48 #: computes/templates/computes/instances.html:50 -#: computes/templates/computes/list.html:59 computes/templates/overview.html:66 +#: computes/templates/computes/list.html:62 computes/templates/overview.html:66 #: computes/templates/overview.html:150 #: instances/templates/allinstances_index_grouped.html:17 #: instances/templates/allinstances_index_nongrouped.html:15 @@ -1936,43 +1940,40 @@ msgstr "Yerel" msgid "the libvirt of the host the panel runs on, by its socket" msgstr "panelin çalıştığı sunucunun libvirt'i, soketi üzerinden" -#: computes/jobs.py:39 -msgid "Bulk migrate" -msgstr "Toplu taşıma" - -#: computes/jobs.py:50 +#: computes/jobs.py:51 msgid "Choose the VMs to migrate" msgstr "Taşınacak sanal makineleri seçin" -#: computes/jobs.py:52 +#: computes/jobs.py:53 #, python-format msgid "At most %(limit)s migrations can run at once" msgstr "Aynı anda en fazla %(limit)s taşıma çalışabilir" -#: computes/jobs.py:71 +#: computes/jobs.py:67 msgid "Migrating the VMs" msgstr "Sanal makineler taşınıyor" -#: computes/jobs.py:85 +#: computes/jobs.py:86 msgid "" -"The worker now runs one job at a time: the VMs not yet started stay on the " -"host" +"The worker now runs one job at a time: the VMs not yet started stay where " +"they are" msgstr "" "İş yürütücü artık aynı anda tek iş çalıştırıyor: henüz başlatılmamış sanal " -"makineler sunucuda kalıyor" +"makineler oldukları yerde kalıyor" #: computes/jobs.py:88 -msgid "A host was changed or deleted: the VMs not yet started stay on the host" +msgid "" +"A host was changed or deleted: the VMs not yet started stay where they are" msgstr "" "Bir sunucu değiştirildi ya da silindi: henüz başlatılmamış sanal makineler " -"sunucuda kalıyor" +"oldukları yerde kalıyor" -#: computes/jobs.py:117 +#: computes/jobs.py:119 #, python-format msgid "These VMs did not migrate: %(vms)s" msgstr "Bu sanal makineler taşınamadı: %(vms)s" -#: computes/jobs.py:125 +#: computes/jobs.py:133 msgid "" "The bulk migration stopped: the migrations it started go on as their own " "jobs; the other VMs stay" @@ -1980,6 +1981,20 @@ msgstr "" "Toplu taşıma durdu: başlattığı taşımalar kendi işleri olarak sürüyor; diğer " "sanal makineler yerinde kalıyor" +#: computes/jobs.py:142 +msgid "Bulk migrate" +msgstr "Toplu taşıma" + +#: computes/jobs.py:171 computes/templates/computes/balance.html:5 +#: computes/templates/computes/balance.html:6 +#: computes/templates/computes/list.html:12 +msgid "Balance" +msgstr "Dengele" + +#: computes/jobs.py:185 +msgid "A VM is already on its destination" +msgstr "Bir sanal makine zaten hedef sunucusunda" + #: computes/models.py:21 msgid "hostname" msgstr "sunucuadı" @@ -2049,6 +2064,90 @@ msgstr "" "Bu, VM'lerinin bulunduğu sunucudan başka bir sunucu: yeni bir sunucu olarak " "ekleyin" +#: computes/templates/computes/balance.html:9 +msgid "" +"Migrations of running VMs that even out the memory, then the vCPUs, the hosts" +" give their running VMs. Each VM migrates live in a job of its own; one that " +"fails or stops meanwhile stays where it is." +msgstr "" +"Sunucuların çalışan sanal makinelere verdiği belleği, ardından vCPU'ları " +"eşitleyen taşımalar. Her sanal makine kendi işinde canlı taşınır; başarısız " +"olan ya da bu arada duran sanal makine olduğu yerde kalır." + +#: computes/templates/computes/balance.html:11 +msgid "These hosts cannot be read and are left out:" +msgstr "Bu sunucular okunamıyor ve hesaba katılmadı:" + +#: computes/templates/computes/balance.html:19 +#: computes/templates/computes/balance.html:46 +#: computes/templates/computes/bulk_migrate.html:47 +#: computes/templates/computes/instances.html:49 +msgid "VCPU" +msgstr "VCPU" + +#: computes/templates/computes/balance.html:33 +msgid "After: if every migration below succeeds." +msgstr "Sonrası: aşağıdaki taşımaların hepsi başarılı olursa." + +#: computes/templates/computes/balance.html:44 +#: computes/templates/computes/bulk_migrate.html:44 +msgid "Select all" +msgstr "Tümünü seç" + +#: computes/templates/computes/balance.html:48 +#: instances/templates/instances/settings_tab.html:527 +#: networks/templates/network.html:396 +msgid "From" +msgstr "Başlangıç" + +#: computes/templates/computes/balance.html:49 +#: instances/templates/instances/settings_tab.html:532 +#: networks/templates/network.html:400 +msgid "To" +msgstr "Bitiş" + +#: computes/templates/computes/balance.html:67 +msgid "No migration would even out the hosts more." +msgstr "Sunucuları daha fazla dengeleyecek bir taşıma yok." + +#: computes/templates/computes/balance.html:70 +msgid "Stay where they are" +msgstr "Yerinde kalanlar" + +#: computes/templates/computes/balance.html:76 +msgid "Let it move" +msgstr "Taşınabilsin" + +#: computes/templates/computes/balance.html:87 +msgid "Cannot move" +msgstr "Taşınamayanlar" + +#: computes/templates/computes/balance.html:105 +#: computes/templates/computes/bulk_migrate.html:30 +msgid "" +"The worker runs one job at a time: set Worker Concurrency to 2 or more on the" +" Settings page." +msgstr "" +"İş yürütücü aynı anda tek iş çalıştırıyor: Ayarlar sayfasında Eş zamanlı iş " +"sayısı değerini 2 veya daha fazla yapın." + +#: computes/templates/computes/balance.html:114 +#: computes/templates/computes/bulk_migrate.html:70 +msgid "Migrations at once" +msgstr "Aynı anda taşıma" + +#: computes/templates/computes/balance.html:119 +msgid "Migrate the VMs listed?" +msgstr "Listelenen sanal makineler taşınsın mı?" + +#: computes/templates/computes/balance.html:119 +#: computes/templates/computes/bulk_migrate.html:76 +#: instances/templates/instances/settings_tab.html:60 +#: instances/templates/instances/settings_tab.html:617 +#: instances/templates/instances/settings_tab.html:620 +msgid "Migrate" +msgstr "Taşı" + #: computes/templates/computes/bulk_migrate.html:5 #: computes/templates/computes/bulk_migrate.html:6 #: computes/templates/computes/instances.html:15 @@ -2072,14 +2171,6 @@ msgstr "" msgid "Destination" msgstr "Hedef" -#: computes/templates/computes/bulk_migrate.html:30 -msgid "" -"The worker runs one job at a time: set Worker Concurrency to 2 or more on the" -" Settings page." -msgstr "" -"İş yürütücü aynı anda tek iş çalıştırıyor: Ayarlar sayfasında Eş zamanlı iş " -"sayısı değerini 2 veya daha fazla yapın." - #: computes/templates/computes/bulk_migrate.html:32 msgid "The host has no VMs." msgstr "Bu sunucuda sanal makine yok." @@ -2088,10 +2179,6 @@ msgstr "Bu sunucuda sanal makine yok." msgid "Also migrate the shut-off VMs" msgstr "Kapalı sanal makineleri de taşı" -#: computes/templates/computes/bulk_migrate.html:44 -msgid "Select all" -msgstr "Tümünü seç" - #: computes/templates/computes/bulk_migrate.html:46 #: computes/templates/computes/instances.html:48 #: instances/templates/allinstances_index_grouped.html:12 @@ -2099,15 +2186,6 @@ msgstr "Tümünü seç" msgid "Status" msgstr "Durum" -#: computes/templates/computes/bulk_migrate.html:47 -#: computes/templates/computes/instances.html:49 -msgid "VCPU" -msgstr "VCPU" - -#: computes/templates/computes/bulk_migrate.html:70 -msgid "Migrations at once" -msgstr "Aynı anda taşıma" - #: computes/templates/computes/bulk_migrate.html:75 #, python-format msgid "Migrate the chosen VMs from %(source)s to %(dest)s?" @@ -2115,13 +2193,6 @@ msgstr "" "Seçilen sanal makineler %(source)s sunucusundan %(dest)s sunucusuna taşınsın " "mı?" -#: computes/templates/computes/bulk_migrate.html:76 -#: instances/templates/instances/settings_tab.html:60 -#: instances/templates/instances/settings_tab.html:617 -#: instances/templates/instances/settings_tab.html:620 -msgid "Migrate" -msgstr "Taşı" - #: computes/templates/computes/capacity_line.txt:2 #, python-format msgid "Given to VMs: %(counter)s vCPU (%(ratio)s:1), %(assigned)s memory." @@ -2135,7 +2206,7 @@ msgstr[1] "" "bellek." #: computes/templates/computes/capacity_line.txt:4 -#: computes/templates/computes/list.html:95 computes/templates/overview.html:83 +#: computes/templates/computes/list.html:98 computes/templates/overview.html:83 msgid "The capacity could not be read." msgstr "Kapasite okunamadı." @@ -2167,7 +2238,7 @@ msgstr "Sunucunun %(memory)s belleğinden %(stopped)s" #: computes/templates/computes/capacity_memory.html:18 #: computes/templates/computes/capacity_vcpus.html:18 -#: computes/templates/computes/list.html:86 +#: computes/templates/computes/list.html:89 #, python-format msgid "%(running)s running" msgstr "%(running)s çalışıyor" @@ -2195,7 +2266,7 @@ msgstr[0] "%(counter)s vCPU" msgstr[1] "%(counter)s vCPU" #: computes/templates/computes/capacity_vcpus.html:4 -#: computes/templates/computes/list.html:39 +#: computes/templates/computes/list.html:42 #, python-format msgid "on %(counter)s CPU" msgid_plural "on %(counter)s CPUs" @@ -2291,7 +2362,7 @@ msgstr "Sunucu bölümleri" #: computes/templates/computes/host_nav.html:7 #: computes/templates/computes/host_nav.html:8 -#: computes/templates/computes/list.html:104 computes/templates/overview.html:6 +#: computes/templates/computes/list.html:107 computes/templates/overview.html:6 msgid "Overview" msgstr "Genel Bakış" @@ -2363,7 +2434,7 @@ msgid "Problem occurred with host %(name)s: %(error)s" msgstr "%(name)s sunucusuyla ilgili bir sorun oluştu: %(error)s" #: computes/templates/computes/instances.html:37 -#: computes/templates/computes/list.html:16 +#: computes/templates/computes/list.html:19 msgid "Warning" msgstr "Uyarı" @@ -2372,7 +2443,7 @@ msgid "Hypervisor doesn't have any Instances" msgstr "Hipervizör üzerinde hiç sanal makine yok" #: computes/templates/computes/instances.html:51 -#: computes/templates/computes/list.html:60 +#: computes/templates/computes/list.html:63 #: instances/templates/allinstances_index_grouped.html:18 #: instances/templates/allinstances_index_nongrouped.html:16 #: instances/templates/instances/settings_tab.html:450 @@ -2384,41 +2455,41 @@ msgstr "Hipervizör üzerinde hiç sanal makine yok" msgid "Actions" msgstr "Eylemler" -#: computes/templates/computes/list.html:5 -#: computes/templates/computes/list.html:11 templates/navbar.html:18 +#: computes/templates/computes/list.html:6 +#: computes/templates/computes/list.html:14 templates/navbar.html:18 msgid "Computes" msgstr "Sunucular" -#: computes/templates/computes/list.html:16 +#: computes/templates/computes/list.html:19 msgid "You don't have any computes" msgstr "Hiç sunucunuz yok" -#: computes/templates/computes/list.html:23 +#: computes/templates/computes/list.html:26 msgid "Hosts" msgstr "Sunucular" -#: computes/templates/computes/list.html:25 +#: computes/templates/computes/list.html:28 msgid "connected" msgstr "bağlı" -#: computes/templates/computes/list.html:32 +#: computes/templates/computes/list.html:35 msgid "running" msgstr "çalışıyor" -#: computes/templates/computes/list.html:37 +#: computes/templates/computes/list.html:40 msgid "vCPUs given" msgstr "Verilen vCPU" -#: computes/templates/computes/list.html:44 +#: computes/templates/computes/list.html:47 msgid "Memory given" msgstr "Atanan bellek" -#: computes/templates/computes/list.html:46 +#: computes/templates/computes/list.html:49 #, python-format msgid "of %(memory)s" msgstr "/ %(memory)s" -#: computes/templates/computes/list.html:71 computes/templates/overview.html:19 +#: computes/templates/computes/list.html:74 computes/templates/overview.html:19 #: console/templates/console-vnc.html:13 #: console/templates/console-xterm.html:16 #: instances/templates/allinstances_index_grouped.html:36 @@ -2427,21 +2498,21 @@ msgstr "/ %(memory)s" msgid "Connected" msgstr "Bağlı" -#: computes/templates/computes/list.html:73 computes/templates/overview.html:21 +#: computes/templates/computes/list.html:76 computes/templates/overview.html:21 #: instances/templates/allinstances_index_grouped.html:38 msgid "Not connected" msgstr "Bağlı değil" -#: computes/templates/computes/list.html:95 +#: computes/templates/computes/list.html:98 msgid "No capacity while the host cannot be reached." msgstr "Sunucuya ulaşılamadığı sürece kapasite gösterilmez." -#: computes/templates/computes/list.html:105 computes/templates/overview.html:9 +#: computes/templates/computes/list.html:108 computes/templates/overview.html:9 #: computes/templates/overview.html:34 msgid "Edit connection" msgstr "Bağlantıyı düzenle" -#: computes/templates/computes/list.html:107 +#: computes/templates/computes/list.html:110 #: computes/templates/overview.html:10 msgid "Remove from panel" msgstr "Panelden kaldır" @@ -2620,19 +2691,19 @@ msgstr "" msgid "The host did not answer within %(seconds)s seconds" msgstr "Sunucu %(seconds)s saniye içinde yanıt vermedi" -#: computes/views.py:274 +#: computes/views.py:246 msgid "" "A disk file is not on storage both hosts share: migrate it from its page" msgstr "" "Bir disk dosyası iki sunucunun paylaştığı depolamada değil: sanal makineyi " "kendi sayfasından taşıyın" -#: computes/views.py:289 +#: computes/views.py:359 #, python-format msgid "The host was saved, but the panel cannot connect to it: %(error)s" msgstr "Sunucu kaydedildi, ancak panel ona bağlanamıyor: %(error)s" -#: computes/views.py:345 +#: computes/views.py:415 #, python-format msgid "" "Its VMs keep running on the host and leave the panel; their owners are kept " @@ -2981,7 +3052,7 @@ msgstr "" msgid "A password takes no line breaks or other control characters." msgstr "Parola satır sonu ya da başka denetim karakteri içeremez." -#: instances/forms.py:114 vrtManager/instance.py:1656 +#: instances/forms.py:114 vrtManager/instance.py:1658 msgid "" "The console listens on no address (on a network, a socket or nowhere); change" " it in the XML editor" @@ -3075,7 +3146,7 @@ msgstr "" msgid "Delete snapshot" msgstr "Anlık görüntüyü sil" -#: instances/jobs.py:356 vrtManager/instance.py:2415 +#: instances/jobs.py:356 vrtManager/instance.py:2417 #, python-format msgid "The VM has no external snapshot named %(name)s" msgstr "Sanal makinede %(name)s adında harici anlık görüntü yok" @@ -3110,7 +3181,7 @@ msgstr "Sanal makine artık işin çalıştığı sunucuda değil" msgid "Take snapshot" msgstr "Anlık görüntü al" -#: instances/jobs.py:424 instances/jobs.py:433 vrtManager/instance.py:2006 +#: instances/jobs.py:424 instances/jobs.py:433 vrtManager/instance.py:2008 #, python-format msgid "A snapshot named %(name)s already exists" msgstr "%(name)s adında bir anlık görüntü zaten var" @@ -3272,12 +3343,12 @@ msgstr "" msgid "Each network card needs a network" msgstr "Her ağ kartının bir ağı olmalı" -#: instances/jobs.py:851 vrtManager/instance.py:2847 +#: instances/jobs.py:851 vrtManager/instance.py:2849 #, python-format msgid "This host has no network %(name)s" msgstr "Bu sunucuda %(name)s ağı yok" -#: instances/jobs.py:853 vrtManager/instance.py:2849 +#: instances/jobs.py:853 vrtManager/instance.py:2851 #, python-format msgid "This host has no network filter %(name)s" msgstr "Bu sunucuda %(name)s ağ filtresi yok" @@ -3351,7 +3422,7 @@ msgstr "cloud-init tohumu, disk için bir dizin depolama havuzu gerektirir" msgid "This host offers no firmware %(firmware)s" msgstr "Bu sunucu %(firmware)s firmware'ini sunmuyor" -#: instances/jobs.py:939 vrtManager/instance.py:3196 +#: instances/jobs.py:939 vrtManager/instance.py:3198 msgid "This host offers no TPM 2.0: install swtpm on it" msgstr "Bu sunucu TPM 2.0 sunmuyor: üzerine swtpm kurun" @@ -4640,7 +4711,7 @@ msgid "Add USB device" msgstr "USB aygıtı ekle" #: instances/templates/instances/host_devices_form.html:18 -#: vrtManager/instance.py:3100 +#: vrtManager/instance.py:3102 msgid "" "A VM with a saved state does not change its USB devices: start it, or start " "it without its saved state" @@ -5546,16 +5617,6 @@ msgstr "Sanal makinenin sunucu aygıtı yok." msgid "Migration route" msgstr "Taşıma yolu" -#: instances/templates/instances/settings_tab.html:527 -#: networks/templates/network.html:396 -msgid "From" -msgstr "Başlangıç" - -#: instances/templates/instances/settings_tab.html:532 -#: networks/templates/network.html:400 -msgid "To" -msgstr "Bitiş" - #: instances/templates/instances/settings_tab.html:541 msgid "" "The VM is running: it migrates live, or paused for the transfer when Live " @@ -6300,21 +6361,21 @@ msgstr "%(quota)s (%(total)s > %(limit)s)" msgid "None available device name" msgstr "Hiçbiri uygun aygıt adı değil" -#: instances/utils.py:478 +#: instances/utils.py:480 #, python-format msgid "Connection Failed: %(host)s did not answer within %(seconds)s seconds" msgstr "Bağlantı başarısız: %(host)s %(seconds)s saniye içinde yanıt vermedi" -#: instances/utils.py:506 +#: instances/utils.py:508 #, python-format msgid "%(hostname)s via %(address)s" msgstr "%(address)s üzerinden %(hostname)s" -#: instances/utils.py:539 +#: instances/utils.py:541 msgid "Invalid MAC address" msgstr "Geçersiz MAC adresi" -#: instances/utils.py:541 +#: instances/utils.py:543 msgid "More MAC addresses than networks" msgstr "Ağlardan daha fazla MAC adresi" @@ -6653,7 +6714,7 @@ msgstr "Birim başarıyla değiştirildi." msgid "Disk %(dev)s is not a storage volume of this instance" msgstr "%(dev)s diski bu sanal makinenin bir depolama birimi değil" -#: instances/views.py:1594 vrtManager/instance.py:2425 +#: instances/views.py:1594 vrtManager/instance.py:2427 msgid "The VM has a saved state; start it or remove the saved state first" msgstr "" "Sanal makinenin kaydedilmiş durumu var; önce başlatın veya kaydedilmiş durumu" @@ -6715,7 +6776,7 @@ msgstr "Anlık görüntü silinmedi: %(err)s" msgid "Add at least one device to the boot order." msgstr "Ön yükleme sırasına en az bir aygıt ekleyin." -#: instances/views.py:1906 vrtManager/instance.py:1197 +#: instances/views.py:1906 vrtManager/instance.py:1199 msgid "Invalid Device Type for boot order" msgstr "Ön yükleme sırası için geçersiz aygıt türü" @@ -9491,84 +9552,88 @@ msgstr "" "%(pool)s havuzu etkin değil: içindeki sanal makine disklerinin oluşturulduğu " "dosyalar denetlenemiyor; önce havuzu başlatın" -#: vrtManager/instance.py:173 +#: vrtManager/instance.py:170 +msgid "The VM is not running" +msgstr "Sanal makine çalışmıyor" + +#: vrtManager/instance.py:175 msgid "A running or paused VM cannot be migrated offline" msgstr "Çalışan veya duraklatılmış bir sanal makine çevrimdışı taşınamaz" -#: vrtManager/instance.py:176 +#: vrtManager/instance.py:178 msgid "The VM can be migrated when it is running, paused or shut off" msgstr "Sanal makine çalışırken, duraklatılmışken veya kapalıyken taşınabilir" -#: vrtManager/instance.py:199 +#: vrtManager/instance.py:201 msgid "A VM with snapshots cannot be migrated" msgstr "Anlık görüntüleri olan bir sanal makine taşınamaz" -#: vrtManager/instance.py:202 +#: vrtManager/instance.py:204 msgid "A VM with a saved state cannot be migrated" msgstr "Kaydedilmiş durumu olan bir sanal makine taşınamaz" -#: vrtManager/instance.py:209 +#: vrtManager/instance.py:211 msgid "A VM with host devices cannot be migrated; remove them first" msgstr "Sunucu aygıtları olan bir sanal makine taşınamaz; önce onları kaldırın" -#: vrtManager/instance.py:213 +#: vrtManager/instance.py:215 #, python-format msgid "The destination host does not have these networks of the VM: %(names)s" msgstr "Hedef sunucuda VM'in şu ağları yok: %(names)s" -#: vrtManager/instance.py:217 +#: vrtManager/instance.py:219 #, python-format msgid "" "The destination host does not have these network filters of the VM: %(names)s" msgstr "Hedef sunucuda VM'in şu ağ filtreleri yok: %(names)s" -#: vrtManager/instance.py:220 +#: vrtManager/instance.py:222 #, python-format msgid "" "These network filters of the VM have other rules on the destination host: " "%(names)s" msgstr "VM'in şu ağ filtrelerinin hedef sunucudaki kuralları farklı: %(names)s" -#: vrtManager/instance.py:223 +#: vrtManager/instance.py:225 #, python-format msgid "The destination host does not have these secrets of the VM: %(names)s" msgstr "Hedef sunucuda VM'in şu parolaları yok: %(names)s" -#: vrtManager/instance.py:230 +#: vrtManager/instance.py:232 #, python-format msgid "The destination host does not have these disks of the VM: %(disks)s" msgstr "Hedef sunucuda sanal makinenin şu diskleri yok: %(disks)s" -#: vrtManager/instance.py:231 +#: vrtManager/instance.py:233 #, python-format msgid "%(target)s (%(source)s)" msgstr "%(target)s (%(source)s)" -#: vrtManager/instance.py:239 +#: vrtManager/instance.py:241 msgid "Destination host emulator is different. Cannot be migrated" msgstr "Hedef sunucunun emülatörü farklı. Taşınamaz" -#: vrtManager/instance.py:373 +#: vrtManager/instance.py:375 msgid "an image is not copied; eject it first" msgstr "bir imaj kopyalanmaz; önce onu çıkarın" -#: vrtManager/instance.py:376 +#: vrtManager/instance.py:378 msgid "a read-only or encrypted disk is not copied" msgstr "salt okunur veya şifreli bir disk kopyalanmaz" -#: vrtManager/instance.py:379 +#: vrtManager/instance.py:381 msgid "only raw and qcow2 disks are copied" msgstr "yalnızca raw ve qcow2 diskler kopyalanır" -#: vrtManager/instance.py:381 +#: vrtManager/instance.py:383 msgid "no storage pool of the source host has it" msgstr "kaynak sunucunun hiçbir depolama havuzunda yok" -#: vrtManager/instance.py:383 +#: vrtManager/instance.py:385 msgid "a disk with a backing file is not copied" msgstr "temel (backing) dosyası olan bir disk kopyalanmaz" -#: vrtManager/instance.py:403 +#: vrtManager/instance.py:405 #, python-format msgid "" "%(target)s (%(path)s): the destination host does not share it; choose a pool " @@ -9577,12 +9642,12 @@ msgstr "" "%(target)s (%(path)s): hedef sunucu bunu paylaşmıyor; kopyalanacağı bir havuz" " seçin" -#: vrtManager/instance.py:407 +#: vrtManager/instance.py:409 #, python-format msgid "%(target)s (%(path)s): %(refusal)s" msgstr "%(target)s (%(path)s): %(refusal)s" -#: vrtManager/instance.py:412 +#: vrtManager/instance.py:414 #, python-format msgid "" "%(target)s (%(path)s): the destination host has no pool %(pool)s for disk " @@ -9590,7 +9655,7 @@ msgid "" msgstr "" "%(target)s (%(path)s): hedef sunucuda disk dosyaları için %(pool)s havuzu yok" -#: vrtManager/instance.py:419 +#: vrtManager/instance.py:421 #, python-format msgid "" "%(target)s (%(path)s): pool %(pool)s of the destination host already has a " @@ -9599,17 +9664,17 @@ msgstr "" "%(target)s (%(path)s): hedef sunucunun %(pool)s havuzunda zaten %(file)s " "dosyası var" -#: vrtManager/instance.py:426 +#: vrtManager/instance.py:428 #, python-format msgid "%(target)s (%(path)s): another disk is copied to %(dest)s" msgstr "%(target)s (%(path)s): başka bir disk %(dest)s konumuna kopyalanıyor" -#: vrtManager/instance.py:431 +#: vrtManager/instance.py:433 #, python-format msgid "%(target)s: the VM has no disk file to copy" msgstr "%(target)s: sanal makinenin kopyalanacak disk dosyası yok" -#: vrtManager/instance.py:435 +#: vrtManager/instance.py:437 #, python-format msgid "" "%(target)s (%(path)s) of the next start: the destination host does not share " @@ -9618,12 +9683,12 @@ msgstr "" "Sonraki başlatmanın %(target)s (%(path)s) diski: hedef sunucu bunu " "paylaşmıyor" -#: vrtManager/instance.py:439 +#: vrtManager/instance.py:441 #, python-format msgid "The disks cannot be migrated: %(problems)s" msgstr "Diskler taşınamaz: %(problems)s" -#: vrtManager/instance.py:452 +#: vrtManager/instance.py:454 #, python-format msgid "" "%(error)s; remove the partial disk copies from the destination host: " @@ -9631,14 +9696,14 @@ msgid "" msgstr "" "%(error)s; yarım kalan disk kopyalarını hedef sunucudan kaldırın: %(copies)s" -#: vrtManager/instance.py:469 +#: vrtManager/instance.py:471 #, python-format msgid "" "%(error)s; remove the partial disk copies from the destination host: %(left)s" msgstr "" "%(error)s; yarım kalan disk kopyalarını hedef sunucudan kaldırın: %(left)s" -#: vrtManager/instance.py:483 +#: vrtManager/instance.py:485 #, python-format msgid "" "The NVRAM file %(path)s is not in libvirt's NVRAM directory %(dir)s and " @@ -9647,26 +9712,26 @@ msgstr "" "%(path)s NVRAM dosyası libvirt'in NVRAM dizini %(dir)s içinde değil ve " "kopyalanamaz" -#: vrtManager/instance.py:492 +#: vrtManager/instance.py:494 #, python-format msgid "The destination host cannot see the NVRAM file %(path)s" msgstr "Hedef sunucu %(path)s NVRAM dosyasını göremiyor" -#: vrtManager/instance.py:583 +#: vrtManager/instance.py:585 #, python-format msgid "%(type)s disk, cannot be checked" msgstr "%(type)s disk, kontrol edilemiyor" -#: vrtManager/instance.py:623 +#: vrtManager/instance.py:625 #, python-format msgid "The destination host already has a VM %(key)s" msgstr "Hedef sunucuda zaten %(key)s sanal makinesi var" -#: vrtManager/instance.py:645 +#: vrtManager/instance.py:647 msgid "The VM was started on the source host during the migration" msgstr "Sanal makine taşıma sırasında kaynak sunucuda başlatıldı" -#: vrtManager/instance.py:661 +#: vrtManager/instance.py:663 #, python-format msgid "" "%(error)s; the VM may now be defined only on the destination host: check both" @@ -9675,7 +9740,7 @@ msgstr "" "%(error)s; sanal makine artık yalnızca hedef sunucuda tanımlı olabilir: iki " "sunucuyu da kontrol edin" -#: vrtManager/instance.py:667 +#: vrtManager/instance.py:669 #, python-format msgid "" "%(error)s; the VM is now defined on both hosts, remove it from the " @@ -9684,7 +9749,7 @@ msgstr "" "%(error)s; sanal makine artık iki sunucuda da tanımlı, hedeften kaldırın: " "%(undo_error)s" -#: vrtManager/instance.py:673 +#: vrtManager/instance.py:675 msgid "" "Snapshot names are 1-64 letters, digits, '.', '_' or '-' and do not start " "with '.'" @@ -9692,7 +9757,7 @@ msgstr "" "Anlık görüntü adları 1-64 harf, rakam, '.', '_' veya '-' karakterinden oluşur" " ve '.' ile başlamaz" -#: vrtManager/instance.py:1185 +#: vrtManager/instance.py:1187 msgid "" "A device other than a disk or NIC is in the boot order: change it in the XML " "editor" @@ -9700,47 +9765,47 @@ msgstr "" "Önyükleme sırasında disk veya NIC dışında bir aygıt var: bunu XML " "düzenleyicide değiştirin" -#: vrtManager/instance.py:1200 +#: vrtManager/instance.py:1202 #, python-format msgid "Boot device %(dev)s is not in the definition" msgstr "Ön yükleme aygıtı %(dev)s tanımda yok" -#: vrtManager/instance.py:1220 +#: vrtManager/instance.py:1222 #, python-format msgid "CD-ROM %(dev)s is not in the running definition" msgstr "CD-ROM %(dev)s çalışan tanımda yok" -#: vrtManager/instance.py:1221 +#: vrtManager/instance.py:1223 #, python-format msgid "CD-ROM %(dev)s is not in the persistent definition" msgstr "CD-ROM %(dev)s kalıcı tanımda yok" -#: vrtManager/instance.py:1234 +#: vrtManager/instance.py:1236 #, python-format msgid "Media of %(dev)s changed in the running VM only: %(err)s" msgstr "%(dev)s ortamı yalnızca çalışan sanal makinede değişti: %(err)s" -#: vrtManager/instance.py:1245 +#: vrtManager/instance.py:1247 #, python-format msgid "ISO image %(image)s was not found" msgstr "ISO imajı %(image)s bulunamadı" -#: vrtManager/instance.py:1247 +#: vrtManager/instance.py:1249 #, python-format msgid "ISO image %(image)s is in more than one storage pool" msgstr "ISO imajı %(image)s birden fazla depolama havuzunda var" -#: vrtManager/instance.py:1342 +#: vrtManager/instance.py:1344 #, python-format msgid "Disk %(target_dev)s is not in the VM's definition" msgstr "Disk %(target_dev)s sanal makinenin tanımında yok" -#: vrtManager/instance.py:1474 +#: vrtManager/instance.py:1476 msgid "Please shutdown the instance then try to enable vCPU hotplug" msgstr "" "vCPU hotplug özelliğini etkinleştirmek için önce sanal makineyi kapatın" -#: vrtManager/instance.py:1677 +#: vrtManager/instance.py:1679 #, python-format msgid "" "The serial console is a %(type)s one, the browser opens only a pty one; " @@ -9749,11 +9814,11 @@ msgstr "" "Seri konsol %(type)s türünde, tarayıcı yalnızca pty türünü açar; bunu XML " "düzenleyicide değiştirin" -#: vrtManager/instance.py:1788 +#: vrtManager/instance.py:1790 msgid "The VM has no video card" msgstr "Sanal makinede ekran kartı yok" -#: vrtManager/instance.py:1798 +#: vrtManager/instance.py:1800 #, python-format msgid "" "The VM's CPU topology has %(count)s vCPUs: change it in the XML editor to set" @@ -9762,62 +9827,62 @@ msgstr "" "VM'nin CPU topolojisi %(count)s vCPU içeriyor: başka bir en fazla değer için " "onu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:1824 +#: vrtManager/instance.py:1826 #, python-format msgid "The VM's next start has a maximum memory of %(max)s MiB" msgstr "" "Sanal makinenin bir sonraki başlangıcındaki en yüksek bellek %(max)s MiB" -#: vrtManager/instance.py:1965 +#: vrtManager/instance.py:1967 msgid "" "The VM has external snapshots; internal snapshots cannot be mixed with them" msgstr "" "Sanal makinenin harici anlık görüntüleri var; dahili anlık görüntüler " "bunlarla karıştırılamaz" -#: vrtManager/instance.py:1997 +#: vrtManager/instance.py:1999 msgid "A snapshot with memory is not quiesced; it keeps the whole guest state" msgstr "" "Bellekli bir anlık görüntüde dosya sistemleri dondurulmaz; tüm konuk durumunu" " saklar" -#: vrtManager/instance.py:1999 +#: vrtManager/instance.py:2001 msgid "Only a running VM's file systems can be frozen" msgstr "Yalnızca çalışan bir sanal makinenin dosya sistemleri dondurulabilir" -#: vrtManager/instance.py:2001 +#: vrtManager/instance.py:2003 msgid "The QEMU guest agent is not connected; it freezes the file systems" msgstr "QEMU konuk aracısı bağlı değil; dosya sistemlerini o dondurur" -#: vrtManager/instance.py:2004 +#: vrtManager/instance.py:2006 msgid "" "The VM has internal snapshots; external snapshots cannot be mixed with them" msgstr "" "Sanal makinenin dahili anlık görüntüleri var; harici anlık görüntüler " "bunlarla karıştırılamaz" -#: vrtManager/instance.py:2009 +#: vrtManager/instance.py:2011 msgid "Newer snapshots exist after the last revert; delete them first" msgstr "" "Son geri dönüşten sonra daha yeni anlık görüntüler var; önce onları silin" -#: vrtManager/instance.py:2012 +#: vrtManager/instance.py:2014 msgid "No snapshot is current; revert to a snapshot first" msgstr "Geçerli anlık görüntü yok; önce bir anlık görüntüye geri dönün" -#: vrtManager/instance.py:2018 +#: vrtManager/instance.py:2020 #, python-format msgid "Eject the media from %(dev)s first" msgstr "Önce %(dev)s içindeki ortamı çıkarın" -#: vrtManager/instance.py:2020 +#: vrtManager/instance.py:2022 #, python-format msgid "Disk %(dev)s is not a file; external snapshots need file disks" msgstr "" "Disk %(dev)s bir dosya değil; harici anlık görüntüler dosya diskleri " "gerektirir" -#: vrtManager/instance.py:2028 +#: vrtManager/instance.py:2030 #, python-format msgid "" "The storage pools could not be refreshed, so their free space is unknown: " @@ -9825,21 +9890,21 @@ msgid "" msgstr "" "Depolama havuzları yenilenemedi, bu yüzden boş alanları bilinmiyor: %(err)s" -#: vrtManager/instance.py:2049 +#: vrtManager/instance.py:2051 msgid "Memory is saved only from a running VM" msgstr "Bellek yalnızca çalışan bir sanal makineden kaydedilir" -#: vrtManager/instance.py:2051 +#: vrtManager/instance.py:2053 msgid "The VM has no disk to keep its memory next to" msgstr "Sanal makinenin, belleğinin yanına kaydedileceği bir diski yok" -#: vrtManager/instance.py:2055 +#: vrtManager/instance.py:2057 #, python-format msgid "%(disk)s is not in a storage pool; memory is saved only into one" msgstr "" "%(disk)s bir depolama havuzunda değil; bellek yalnızca bir havuza kaydedilir" -#: vrtManager/instance.py:2086 +#: vrtManager/instance.py:2088 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the snapshot needs %(size).1f " @@ -9850,7 +9915,7 @@ msgstr "" "%(size).1f GiB gerektiriyor (sanal makinenin oradaki disklerinin " "%%%(percent)g kadarı, en az %(minimum)g GiB, ve kaydediliyorsa bellek)" -#: vrtManager/instance.py:2104 +#: vrtManager/instance.py:2106 msgid "" "This snapshot was taken by an older version on a UEFI VM and cannot be " "reverted; delete it instead" @@ -9858,7 +9923,7 @@ msgstr "" "Bu anlık görüntü UEFI bir sanal makinede eski bir sürümle alındı ve geri " "dönülemez; bunun yerine silin" -#: vrtManager/instance.py:2134 +#: vrtManager/instance.py:2136 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is " @@ -9867,7 +9932,7 @@ msgstr "" "Geri dönüş iki kez başarısız oldu; biraz sonra tekrar deneyin (%(error)s). " "Sanal makine çalışıyor." -#: vrtManager/instance.py:2136 +#: vrtManager/instance.py:2138 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is shut " @@ -9876,13 +9941,13 @@ msgstr "" "Geri dönüş iki kez başarısız oldu; biraz sonra tekrar deneyin (%(error)s). " "Sanal makine kapalı." -#: vrtManager/instance.py:2304 +#: vrtManager/instance.py:2306 msgid "A disk moves when its VM is defined and running, paused or shut off" msgstr "" "Bir disk, sanal makinesi tanımlıyken ve çalışırken, duraklatılmışken veya " "kapalıyken taşınır" -#: vrtManager/instance.py:2306 +#: vrtManager/instance.py:2308 msgid "" "A disk of a VM with snapshots, a saved state or a running block job does not " "move" @@ -9890,7 +9955,7 @@ msgstr "" "Anlık görüntüleri, kaydedilmiş durumu veya çalışan bir blok işi olan sanal " "makinenin diski taşınmaz" -#: vrtManager/instance.py:2314 +#: vrtManager/instance.py:2316 #, python-format msgid "" "%(dev)s is not a disk file of the VM, the same in its running and next " @@ -9899,127 +9964,127 @@ msgstr "" "%(dev)s, sanal makinenin çalışan ve sonraki başlatma tanımlarında aynı olan " "bir disk dosyası değil" -#: vrtManager/instance.py:2319 +#: vrtManager/instance.py:2321 #, python-format msgid "%(dev)s does not move: only writable raw and qcow2 disks do" msgstr "%(dev)s taşınmaz: yalnızca yazılabilir raw ve qcow2 diskler taşınır" -#: vrtManager/instance.py:2326 +#: vrtManager/instance.py:2328 #, python-format msgid "%(dev)s does not move: no storage pool has %(path)s" msgstr "%(dev)s taşınmaz: hiçbir depolama havuzunda %(path)s yok" -#: vrtManager/instance.py:2328 +#: vrtManager/instance.py:2330 #, python-format msgid "%(dev)s does not move: it has a backing file" msgstr "%(dev)s taşınmaz: temel (backing) dosyası var" -#: vrtManager/instance.py:2331 +#: vrtManager/instance.py:2333 #, python-format msgid "%(pool_name)s is not an active pool of disk files of this host" msgstr "%(pool_name)s bu sunucunun etkin bir disk dosyası havuzu değil" -#: vrtManager/instance.py:2334 +#: vrtManager/instance.py:2336 #, python-format msgid "%(dev)s is in pool %(pool_name)s already" msgstr "%(dev)s zaten %(pool_name)s havuzunda" -#: vrtManager/instance.py:2338 +#: vrtManager/instance.py:2340 #, python-format msgid "Pool %(pool_name)s already has a file %(name)s" msgstr "%(pool_name)s havuzunda zaten %(name)s dosyası var" -#: vrtManager/instance.py:2362 +#: vrtManager/instance.py:2364 #, python-format msgid "The copy of %(dev)s ended before it was complete" msgstr "%(dev)s kopyası tamamlanmadan sona erdi" -#: vrtManager/instance.py:2407 +#: vrtManager/instance.py:2409 #, python-format msgid "%(error)s; remove %(dest)s if it is there: %(cleanup_error)s" msgstr "%(error)s; varsa %(dest)s dosyasını kaldırın: %(cleanup_error)s" -#: vrtManager/instance.py:2409 +#: vrtManager/instance.py:2411 #, python-format msgid "%(error)s; the VM may use %(dest)s now: check its disk %(dev)s" msgstr "" "%(error)s; sanal makine şu anda %(dest)s dosyasını kullanıyor olabilir: " "%(dev)s diskini kontrol edin" -#: vrtManager/instance.py:2416 +#: vrtManager/instance.py:2418 #, python-format msgid "The VM has no internal snapshot named %(name)s" msgstr "Sanal makinenin %(name)s adlı dahili anlık görüntüsü yok" -#: vrtManager/instance.py:2427 +#: vrtManager/instance.py:2429 msgid "A snapshot job is still running on this VM; try again when it ends" msgstr "" "Bu sanal makinede hâlâ bir anlık görüntü işi çalışıyor; bittiğinde tekrar " "deneyin" -#: vrtManager/instance.py:2437 +#: vrtManager/instance.py:2439 msgid "Shut the VM down to revert to an internal snapshot" msgstr "Dahili bir anlık görüntüye geri dönmek için sanal makineyi kapatın" -#: vrtManager/instance.py:2524 +#: vrtManager/instance.py:2526 msgid "A VM with a host's or an external TPM is not cloned; remove it first" msgstr "" "Ana makinenin ya da harici bir TPM'i olan sanal makine klonlanmaz; önce onu " "kaldırın" -#: vrtManager/instance.py:2555 +#: vrtManager/instance.py:2557 msgid "Cannot clone a VM whose NVRAM is not a file" msgstr "NVRAM'i dosya olmayan bir sanal makine klonlanamaz" -#: vrtManager/instance.py:2625 +#: vrtManager/instance.py:2627 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(path)s" msgstr "" "Klonlama başarısız oldu (%(err)s); bu kopyaları elle kaldırın: %(path)s" -#: vrtManager/instance.py:2636 +#: vrtManager/instance.py:2638 msgid "Shut the VM down before cloning it" msgstr "Klonlamadan önce sanal makineyi kapatın" -#: vrtManager/instance.py:2663 +#: vrtManager/instance.py:2665 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(leftovers)s" msgstr "" "Klonlama başarısız oldu (%(err)s); bu kopyaları elle kaldırın: %(leftovers)s" -#: vrtManager/instance.py:2674 +#: vrtManager/instance.py:2676 msgid "Live clone needs libvirt 11.10 or later; shut the VM down to clone it" msgstr "" "Canlı klonlama libvirt 11.10 veya sonrasını gerektirir; klonlamak için sanal " "makineyi kapatın" -#: vrtManager/instance.py:2677 +#: vrtManager/instance.py:2679 msgid "A VM with a TPM is cloned only shut down" msgstr "TPM'i olan bir sanal makine yalnızca kapalıyken klonlanır" -#: vrtManager/instance.py:2680 +#: vrtManager/instance.py:2682 #, python-format msgid "Disk %(dev)s is not a local file; shut the VM down to clone it" msgstr "" "Disk %(dev)s yerel bir dosya değil; klonlamak için sanal makineyi kapatın" -#: vrtManager/instance.py:2682 +#: vrtManager/instance.py:2684 #, python-format msgid "Disk %(dev)s is shareable; shut the VM down to clone it" msgstr "Disk %(dev)s paylaşılabilir; klonlamak için sanal makineyi kapatın" -#: vrtManager/instance.py:2687 +#: vrtManager/instance.py:2689 #, python-format msgid "Disk %(dev)s changes at the next start; shut the VM down to clone it" msgstr "" "Disk %(dev)s sonraki başlatmada değişiyor; klonlamak için sanal makineyi " "kapatın" -#: vrtManager/instance.py:2689 +#: vrtManager/instance.py:2691 msgid "Another job is running on the VM; clone it when that ends" msgstr "Sanal makinede başka bir iş çalışıyor; o bittiğinde klonlayın" -#: vrtManager/instance.py:2715 +#: vrtManager/instance.py:2717 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the clone needs %(size).1f GiB" @@ -10029,25 +10094,25 @@ msgstr "" "gerektiriyor (kopyalanan diskler, artı bunların %%%(percent)g kadarı, en az " "%(minimum)g GiB)" -#: vrtManager/instance.py:2732 +#: vrtManager/instance.py:2734 #, python-format msgid "Volume %(name)s already exists in storage pool %(pool)s" msgstr "%(name)s birimi %(pool)s depolama havuzunda zaten var" -#: vrtManager/instance.py:2886 +#: vrtManager/instance.py:2888 msgid "A network interface that is a host device is removed in the XML editor" msgstr "Sunucu aygıtı olan bir ağ arabirimi XML düzenleyicide kaldırılır" -#: vrtManager/instance.py:2902 +#: vrtManager/instance.py:2904 #, python-format msgid "No network interface with MAC %(old_mac)s" msgstr "MAC adresi %(old_mac)s olan ağ arabirimi yok" -#: vrtManager/instance.py:2905 +#: vrtManager/instance.py:2907 msgid "A network interface that is a host device is changed in the XML editor" msgstr "Sunucu aygıtı olan bir ağ arabirimi XML düzenleyicide değiştirilir" -#: vrtManager/instance.py:2999 +#: vrtManager/instance.py:3001 msgid "" "A VM changes its PCI devices while it runs, or is shut off without a saved " "state" @@ -10055,43 +10120,43 @@ msgstr "" "Sanal makine PCI aygıtlarını çalışırken veya kaydedilmiş durumu olmadan " "kapalıyken değiştirir" -#: vrtManager/instance.py:3020 +#: vrtManager/instance.py:3022 #, python-format msgid "%(err)s; whether the VM has %(device)s now is not known" msgstr "%(err)s; sanal makinede şu anda %(device)s olup olmadığı bilinmiyor" -#: vrtManager/instance.py:3022 +#: vrtManager/instance.py:3024 #, python-format msgid "%(err)s; %(device)s: the VM is not running, its next start has it" msgstr "%(err)s; %(device)s: sanal makine çalışmıyor, sonraki başlatmada var" -#: vrtManager/instance.py:3023 +#: vrtManager/instance.py:3025 #, python-format msgid "" "%(err)s; %(device)s: the VM is not running, its next start does not have it" msgstr "%(err)s; %(device)s: sanal makine çalışmıyor, sonraki başlatmada yok" -#: vrtManager/instance.py:3024 +#: vrtManager/instance.py:3026 #, python-format msgid "%(err)s; %(device)s: the running VM has it, its next start has it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede var, sonraki başlatmada var" -#: vrtManager/instance.py:3025 +#: vrtManager/instance.py:3027 #, python-format msgid "" "%(err)s; %(device)s: the running VM has it, its next start does not have it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede var, sonraki başlatmada yok" -#: vrtManager/instance.py:3026 +#: vrtManager/instance.py:3028 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start has it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede yok, sonraki başlatmada var" -#: vrtManager/instance.py:3028 +#: vrtManager/instance.py:3030 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start does not" @@ -10099,48 +10164,48 @@ msgid "" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede yok, sonraki başlatmada yok" -#: vrtManager/instance.py:3062 +#: vrtManager/instance.py:3064 #, python-format msgid "The VM has no PCI device %(address)s" msgstr "Sanal makinede %(address)s PCI aygıtı yok" -#: vrtManager/instance.py:3083 +#: vrtManager/instance.py:3085 msgid "The VM has no USB controller" msgstr "Sanal makinede USB denetleyicisi yok" -#: vrtManager/instance.py:3117 +#: vrtManager/instance.py:3119 msgid "The VM has no such USB device" msgstr "Sanal makinede böyle bir USB aygıtı yok" -#: vrtManager/instance.py:3131 +#: vrtManager/instance.py:3133 #, python-format msgid "The VM has no network interface %(mac)s" msgstr "Sanal makinede %(mac)s ağ arabirimi yok" -#: vrtManager/instance.py:3162 +#: vrtManager/instance.py:3164 msgid "The VM has its own RNG device: change it in the XML editor" msgstr "" "Sanal makinenin kendi RNG aygıtı var: bunu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:3189 +#: vrtManager/instance.py:3191 msgid "The VM has its own TPM: change it in the XML editor" msgstr "Sanal makinenin kendi TPM'i var: bunu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:3208 +#: vrtManager/instance.py:3210 #, python-format msgid "Unknown crash action %(action)s" msgstr "Bilinmeyen çökme eylemi %(action)s" -#: vrtManager/instance.py:3235 +#: vrtManager/instance.py:3237 #, python-format msgid "Network interface %(mac)s is not in the definition" msgstr "%(mac)s ağ arayüzü tanımda yok" -#: vrtManager/instance.py:3326 +#: vrtManager/instance.py:3328 msgid "The guest agent did not answer in time; nothing was changed" msgstr "Konuk ajanı zamanında yanıt vermedi; hiçbir şey değiştirilmedi" -#: vrtManager/instance.py:3329 +#: vrtManager/instance.py:3331 msgid "The VM runs Windows: its guest agent sets no root password or SSH key" msgstr "" "Sanal makinede Windows çalışıyor: konuk ajanı root parolası ya da SSH " diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index 3acd3feb..81d93899 100644 Binary files a/locale/zh/LC_MESSAGES/django.mo and b/locale/zh/LC_MESSAGES/django.mo differ diff --git a/locale/zh/LC_MESSAGES/django.po b/locale/zh/LC_MESSAGES/django.po index 3e35096e..0688116d 100644 --- a/locale/zh/LC_MESSAGES/django.po +++ b/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-15 16:43+0000\n" +"POT-Creation-Date: 2026-11-16 04:31+0000\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -61,7 +61,8 @@ msgstr "公钥已存在" msgid "Invalid key" msgstr "无效的密钥" -#: accounts/forms.py:95 computes/templates/computes/bulk_migrate.html:45 +#: accounts/forms.py:95 computes/templates/computes/balance.html:45 +#: computes/templates/computes/bulk_migrate.html:45 #: computes/templates/computes/instances.html:46 #: instances/templates/add_instance_volume.html:39 #: instances/templates/allinstances_index_grouped.html:11 @@ -210,8 +211,8 @@ msgid "User sections" msgstr "用户页面导航" #: accounts/templates/account.html:50 accounts/templates/account.html:58 -#: admin/forms.py:207 computes/templates/computes/list.html:30 -#: computes/templates/computes/list.html:57 computes/templates/overview.html:46 +#: admin/forms.py:207 computes/templates/computes/list.html:33 +#: computes/templates/computes/list.html:60 computes/templates/overview.html:46 #: instances/views.py:262 msgid "VMs" msgstr "虚拟机" @@ -231,7 +232,8 @@ msgid "Add VM" msgstr "添加虚拟机" #: accounts/templates/account.html:68 admin/templates/admin/logs.html:40 -#: computes/templates/computes/list.html:56 +#: computes/templates/computes/balance.html:17 +#: computes/templates/computes/list.html:59 #: instances/templates/allinstances.html:108 #: instances/templates/allinstances_index_nongrouped.html:8 #: instances/templates/create_steps.html:6 @@ -245,7 +247,7 @@ msgstr "主机" msgid "Power and console only" msgstr "仅电源和控制台" -#: accounts/templates/account.html:80 computes/templates/computes/list.html:102 +#: accounts/templates/account.html:80 computes/templates/computes/list.html:105 #: instances/templates/instance_actions.html:9 #: storages/templates/storage.html:140 #, python-format @@ -735,7 +737,7 @@ msgid "" "NEW_USER_DEFAULT_INSTANCES: %(name)s has an owner, and only one is allowed" msgstr "NEW_USER_DEFAULT_INSTANCES:%(name)s 已有所有者,且只允许一个所有者" -#: admin/forms.py:208 computes/templates/computes/list.html:58 +#: admin/forms.py:208 computes/templates/computes/list.html:61 #: computes/templates/overview.html:58 instances/forms.py:15 #: instances/templates/allinstances_index_grouped.html:16 #: instances/templates/allinstances_index_nongrouped.html:14 @@ -745,9 +747,11 @@ msgstr "NEW_USER_DEFAULT_INSTANCES:%(name)s 已有所有者,且只允许一 msgid "vCPUs" msgstr "vCPU" -#: admin/forms.py:209 computes/templates/computes/bulk_migrate.html:48 +#: admin/forms.py:209 computes/templates/computes/balance.html:18 +#: computes/templates/computes/balance.html:47 +#: computes/templates/computes/bulk_migrate.html:48 #: computes/templates/computes/instances.html:50 -#: computes/templates/computes/list.html:59 computes/templates/overview.html:66 +#: computes/templates/computes/list.html:62 computes/templates/overview.html:66 #: computes/templates/overview.html:150 #: instances/templates/allinstances_index_grouped.html:17 #: instances/templates/allinstances_index_nongrouped.html:15 @@ -1873,44 +1877,55 @@ msgstr "本地" msgid "the libvirt of the host the panel runs on, by its socket" msgstr "面板所在主机的 libvirt,通过其套接字连接" -#: computes/jobs.py:39 -msgid "Bulk migrate" -msgstr "批量迁移" - -#: computes/jobs.py:50 +#: computes/jobs.py:51 msgid "Choose the VMs to migrate" msgstr "请选择要迁移的虚拟机" -#: computes/jobs.py:52 +#: computes/jobs.py:53 #, python-format msgid "At most %(limit)s migrations can run at once" msgstr "最多可同时运行 %(limit)s 个迁移" -#: computes/jobs.py:71 +#: computes/jobs.py:67 msgid "Migrating the VMs" msgstr "正在迁移虚拟机" -#: computes/jobs.py:85 +#: computes/jobs.py:86 msgid "" -"The worker now runs one job at a time: the VMs not yet started stay on the " -"host" -msgstr "任务执行器现在一次只运行一个任务:尚未开始的虚拟机留在主机上" +"The worker now runs one job at a time: the VMs not yet started stay where " +"they are" +msgstr "任务执行器现在一次只运行一个任务:尚未开始的虚拟机留在原处" #: computes/jobs.py:88 -msgid "A host was changed or deleted: the VMs not yet started stay on the host" -msgstr "有主机被修改或删除:尚未开始的虚拟机留在主机上" +msgid "" +"A host was changed or deleted: the VMs not yet started stay where they are" +msgstr "有主机被修改或删除:尚未开始的虚拟机留在原处" -#: computes/jobs.py:117 +#: computes/jobs.py:119 #, python-format msgid "These VMs did not migrate: %(vms)s" msgstr "以下虚拟机未能迁移:%(vms)s" -#: computes/jobs.py:125 +#: computes/jobs.py:133 msgid "" "The bulk migration stopped: the migrations it started go on as their own " "jobs; the other VMs stay" msgstr "批量迁移已停止:已启动的迁移作为各自的任务继续进行;其他虚拟机保持不动" +#: computes/jobs.py:142 +msgid "Bulk migrate" +msgstr "批量迁移" + +#: computes/jobs.py:171 computes/templates/computes/balance.html:5 +#: computes/templates/computes/balance.html:6 +#: computes/templates/computes/list.html:12 +msgid "Balance" +msgstr "均衡" + +#: computes/jobs.py:185 +msgid "A VM is already on its destination" +msgstr "有虚拟机已在其目标主机上" + #: computes/models.py:21 msgid "hostname" msgstr "主机名" @@ -1971,6 +1986,86 @@ msgstr "其虚拟机所在的主机尚不明确:请在面板通过当前连接 msgid "This is another host than the one its VMs are on: add it as a new host" msgstr "这不是其虚拟机所在的主机:请将其添加为新主机" +#: computes/templates/computes/balance.html:9 +msgid "" +"Migrations of running VMs that even out the memory, then the vCPUs, the hosts" +" give their running VMs. Each VM migrates live in a job of its own; one that " +"fails or stops meanwhile stays where it is." +msgstr "" +"迁移正在运行的虚拟机,使各主机分配给运行中虚拟机的内存(其次是 vCPU)趋于均衡。每台虚拟机在各自的任务中在线迁移;失败或期间停止的虚拟机留在原处。" + +#: computes/templates/computes/balance.html:11 +msgid "These hosts cannot be read and are left out:" +msgstr "以下主机无法读取,已排除:" + +#: computes/templates/computes/balance.html:19 +#: computes/templates/computes/balance.html:46 +#: computes/templates/computes/bulk_migrate.html:47 +#: computes/templates/computes/instances.html:49 +msgid "VCPU" +msgstr "VCPU" + +#: computes/templates/computes/balance.html:33 +msgid "After: if every migration below succeeds." +msgstr "之后:假设下面的每次迁移都成功。" + +#: computes/templates/computes/balance.html:44 +#: computes/templates/computes/bulk_migrate.html:44 +msgid "Select all" +msgstr "全选" + +#: computes/templates/computes/balance.html:48 +#: instances/templates/instances/settings_tab.html:527 +#: networks/templates/network.html:396 +msgid "From" +msgstr "源" + +#: computes/templates/computes/balance.html:49 +#: instances/templates/instances/settings_tab.html:532 +#: networks/templates/network.html:400 +msgid "To" +msgstr "目标" + +#: computes/templates/computes/balance.html:67 +msgid "No migration would even out the hosts more." +msgstr "没有能让主机更均衡的迁移。" + +#: computes/templates/computes/balance.html:70 +msgid "Stay where they are" +msgstr "留在原处" + +#: computes/templates/computes/balance.html:76 +msgid "Let it move" +msgstr "允许迁移" + +#: computes/templates/computes/balance.html:87 +msgid "Cannot move" +msgstr "无法迁移" + +#: computes/templates/computes/balance.html:105 +#: computes/templates/computes/bulk_migrate.html:30 +msgid "" +"The worker runs one job at a time: set Worker Concurrency to 2 or more on the" +" Settings page." +msgstr "任务执行器一次只运行一个任务:请在设置页面将工作进程并发数设为 2 或更大。" + +#: computes/templates/computes/balance.html:114 +#: computes/templates/computes/bulk_migrate.html:70 +msgid "Migrations at once" +msgstr "同时迁移数" + +#: computes/templates/computes/balance.html:119 +msgid "Migrate the VMs listed?" +msgstr "迁移列出的虚拟机?" + +#: computes/templates/computes/balance.html:119 +#: computes/templates/computes/bulk_migrate.html:76 +#: instances/templates/instances/settings_tab.html:60 +#: instances/templates/instances/settings_tab.html:617 +#: instances/templates/instances/settings_tab.html:620 +msgid "Migrate" +msgstr "迁移" + #: computes/templates/computes/bulk_migrate.html:5 #: computes/templates/computes/bulk_migrate.html:6 #: computes/templates/computes/instances.html:15 @@ -1992,12 +2087,6 @@ msgstr "每台选中的虚拟机在各自的任务中迁移:运行中的虚拟 msgid "Destination" msgstr "目标主机" -#: computes/templates/computes/bulk_migrate.html:30 -msgid "" -"The worker runs one job at a time: set Worker Concurrency to 2 or more on the" -" Settings page." -msgstr "任务执行器一次只运行一个任务:请在设置页面将工作进程并发数设为 2 或更大。" - #: computes/templates/computes/bulk_migrate.html:32 msgid "The host has no VMs." msgstr "此主机没有虚拟机。" @@ -2006,10 +2095,6 @@ msgstr "此主机没有虚拟机。" msgid "Also migrate the shut-off VMs" msgstr "同时迁移已关机的虚拟机" -#: computes/templates/computes/bulk_migrate.html:44 -msgid "Select all" -msgstr "全选" - #: computes/templates/computes/bulk_migrate.html:46 #: computes/templates/computes/instances.html:48 #: instances/templates/allinstances_index_grouped.html:12 @@ -2017,27 +2102,11 @@ msgstr "全选" msgid "Status" msgstr "状态" -#: computes/templates/computes/bulk_migrate.html:47 -#: computes/templates/computes/instances.html:49 -msgid "VCPU" -msgstr "VCPU" - -#: computes/templates/computes/bulk_migrate.html:70 -msgid "Migrations at once" -msgstr "同时迁移数" - #: computes/templates/computes/bulk_migrate.html:75 #, python-format msgid "Migrate the chosen VMs from %(source)s to %(dest)s?" msgstr "将选中的虚拟机从 %(source)s 迁移到 %(dest)s?" -#: computes/templates/computes/bulk_migrate.html:76 -#: instances/templates/instances/settings_tab.html:60 -#: instances/templates/instances/settings_tab.html:617 -#: instances/templates/instances/settings_tab.html:620 -msgid "Migrate" -msgstr "迁移" - #: computes/templates/computes/capacity_line.txt:2 #, python-format msgid "Given to VMs: %(counter)s vCPU (%(ratio)s:1), %(assigned)s memory." @@ -2046,7 +2115,7 @@ msgid_plural "" msgstr[0] "已分配给虚拟机:%(counter)s 个 vCPU(%(ratio)s:1),%(assigned)s 内存。" #: computes/templates/computes/capacity_line.txt:4 -#: computes/templates/computes/list.html:95 computes/templates/overview.html:83 +#: computes/templates/computes/list.html:98 computes/templates/overview.html:83 msgid "The capacity could not be read." msgstr "无法读取容量。" @@ -2076,7 +2145,7 @@ msgstr "占主机 %(memory)s 中的 %(stopped)s" #: computes/templates/computes/capacity_memory.html:18 #: computes/templates/computes/capacity_vcpus.html:18 -#: computes/templates/computes/list.html:86 +#: computes/templates/computes/list.html:89 #, python-format msgid "%(running)s running" msgstr "运行中 %(running)s" @@ -2102,7 +2171,7 @@ msgid_plural "%(counter)s vCPUs" msgstr[0] "%(counter)s 个 vCPU" #: computes/templates/computes/capacity_vcpus.html:4 -#: computes/templates/computes/list.html:39 +#: computes/templates/computes/list.html:42 #, python-format msgid "on %(counter)s CPU" msgid_plural "on %(counter)s CPUs" @@ -2195,7 +2264,7 @@ msgstr "主机栏目" #: computes/templates/computes/host_nav.html:7 #: computes/templates/computes/host_nav.html:8 -#: computes/templates/computes/list.html:104 computes/templates/overview.html:6 +#: computes/templates/computes/list.html:107 computes/templates/overview.html:6 msgid "Overview" msgstr "概览" @@ -2267,7 +2336,7 @@ msgid "Problem occurred with host %(name)s: %(error)s" msgstr "主机 %(name)s 出现问题:%(error)s" #: computes/templates/computes/instances.html:37 -#: computes/templates/computes/list.html:16 +#: computes/templates/computes/list.html:19 msgid "Warning" msgstr "警告" @@ -2276,7 +2345,7 @@ msgid "Hypervisor doesn't have any Instances" msgstr "虚拟机管理程序中没有任何虚拟机" #: computes/templates/computes/instances.html:51 -#: computes/templates/computes/list.html:60 +#: computes/templates/computes/list.html:63 #: instances/templates/allinstances_index_grouped.html:18 #: instances/templates/allinstances_index_nongrouped.html:16 #: instances/templates/instances/settings_tab.html:450 @@ -2288,41 +2357,41 @@ msgstr "虚拟机管理程序中没有任何虚拟机" msgid "Actions" msgstr "操作" -#: computes/templates/computes/list.html:5 -#: computes/templates/computes/list.html:11 templates/navbar.html:18 +#: computes/templates/computes/list.html:6 +#: computes/templates/computes/list.html:14 templates/navbar.html:18 msgid "Computes" msgstr "计算节点" -#: computes/templates/computes/list.html:16 +#: computes/templates/computes/list.html:19 msgid "You don't have any computes" msgstr "您还没有任何计算节点" -#: computes/templates/computes/list.html:23 +#: computes/templates/computes/list.html:26 msgid "Hosts" msgstr "主机" -#: computes/templates/computes/list.html:25 +#: computes/templates/computes/list.html:28 msgid "connected" msgstr "已连接" -#: computes/templates/computes/list.html:32 +#: computes/templates/computes/list.html:35 msgid "running" msgstr "运行中" -#: computes/templates/computes/list.html:37 +#: computes/templates/computes/list.html:40 msgid "vCPUs given" msgstr "已分配 vCPU" -#: computes/templates/computes/list.html:44 +#: computes/templates/computes/list.html:47 msgid "Memory given" msgstr "已分配内存" -#: computes/templates/computes/list.html:46 +#: computes/templates/computes/list.html:49 #, python-format msgid "of %(memory)s" msgstr "共 %(memory)s" -#: computes/templates/computes/list.html:71 computes/templates/overview.html:19 +#: computes/templates/computes/list.html:74 computes/templates/overview.html:19 #: console/templates/console-vnc.html:13 #: console/templates/console-xterm.html:16 #: instances/templates/allinstances_index_grouped.html:36 @@ -2331,21 +2400,21 @@ msgstr "共 %(memory)s" msgid "Connected" msgstr "已连接" -#: computes/templates/computes/list.html:73 computes/templates/overview.html:21 +#: computes/templates/computes/list.html:76 computes/templates/overview.html:21 #: instances/templates/allinstances_index_grouped.html:38 msgid "Not connected" msgstr "未连接" -#: computes/templates/computes/list.html:95 +#: computes/templates/computes/list.html:98 msgid "No capacity while the host cannot be reached." msgstr "无法连接主机时不显示容量。" -#: computes/templates/computes/list.html:105 computes/templates/overview.html:9 +#: computes/templates/computes/list.html:108 computes/templates/overview.html:9 #: computes/templates/overview.html:34 msgid "Edit connection" msgstr "编辑连接" -#: computes/templates/computes/list.html:107 +#: computes/templates/computes/list.html:110 #: computes/templates/overview.html:10 msgid "Remove from panel" msgstr "从面板中移除" @@ -2516,17 +2585,17 @@ msgstr "请输入主机 /etc/default/webvirt-gstfsd 中 GSTFSD_KEY 的 64 个十 msgid "The host did not answer within %(seconds)s seconds" msgstr "主机未在 %(seconds)s 秒内响应" -#: computes/views.py:274 +#: computes/views.py:246 msgid "" "A disk file is not on storage both hosts share: migrate it from its page" msgstr "有磁盘文件不在两台主机共享的存储上:请在该虚拟机的页面上迁移它" -#: computes/views.py:289 +#: computes/views.py:359 #, python-format msgid "The host was saved, but the panel cannot connect to it: %(error)s" msgstr "主机已保存,但面板无法连接到它:%(error)s" -#: computes/views.py:345 +#: computes/views.py:415 #, python-format msgid "" "Its VMs keep running on the host and leave the panel; their owners are kept " @@ -2855,7 +2924,7 @@ msgstr "VNC 密码最多 8 个字母、数字或符号,不能有带重音的 msgid "A password takes no line breaks or other control characters." msgstr "密码不能包含换行或其他控制字符。" -#: instances/forms.py:114 vrtManager/instance.py:1656 +#: instances/forms.py:114 vrtManager/instance.py:1658 msgid "" "The console listens on no address (on a network, a socket or nowhere); change" " it in the XML editor" @@ -2942,7 +3011,7 @@ msgstr "虚拟机未定义;请检查这些卷,然后处理此任务:%(volu msgid "Delete snapshot" msgstr "删除快照" -#: instances/jobs.py:356 vrtManager/instance.py:2415 +#: instances/jobs.py:356 vrtManager/instance.py:2417 #, python-format msgid "The VM has no external snapshot named %(name)s" msgstr "虚拟机没有名为 %(name)s 的外部快照" @@ -2974,7 +3043,7 @@ msgstr "虚拟机已不在运行该任务的计算节点上" msgid "Take snapshot" msgstr "创建快照" -#: instances/jobs.py:424 instances/jobs.py:433 vrtManager/instance.py:2006 +#: instances/jobs.py:424 instances/jobs.py:433 vrtManager/instance.py:2008 #, python-format msgid "A snapshot named %(name)s already exists" msgstr "名为 %(name)s 的快照已存在" @@ -3113,12 +3182,12 @@ msgstr "镜像已存在。请检查卷或更改虚拟机名称" msgid "Each network card needs a network" msgstr "每个网卡都需要一个网络" -#: instances/jobs.py:851 vrtManager/instance.py:2847 +#: instances/jobs.py:851 vrtManager/instance.py:2849 #, python-format msgid "This host has no network %(name)s" msgstr "此主机没有网络 %(name)s" -#: instances/jobs.py:853 vrtManager/instance.py:2849 +#: instances/jobs.py:853 vrtManager/instance.py:2851 #, python-format msgid "This host has no network filter %(name)s" msgstr "此主机没有网络过滤器 %(name)s" @@ -3188,7 +3257,7 @@ msgstr "cloud-init 种子需要为磁盘使用目录类型的存储池" msgid "This host offers no firmware %(firmware)s" msgstr "此主机不提供固件 %(firmware)s" -#: instances/jobs.py:939 vrtManager/instance.py:3196 +#: instances/jobs.py:939 vrtManager/instance.py:3198 msgid "This host offers no TPM 2.0: install swtpm on it" msgstr "此主机不提供 TPM 2.0:请在主机上安装 swtpm" @@ -4422,7 +4491,7 @@ msgid "Add USB device" msgstr "添加 USB 设备" #: instances/templates/instances/host_devices_form.html:18 -#: vrtManager/instance.py:3100 +#: vrtManager/instance.py:3102 msgid "" "A VM with a saved state does not change its USB devices: start it, or start " "it without its saved state" @@ -5264,16 +5333,6 @@ msgstr "该虚拟机没有主机设备。" msgid "Migration route" msgstr "迁移路径" -#: instances/templates/instances/settings_tab.html:527 -#: networks/templates/network.html:396 -msgid "From" -msgstr "源" - -#: instances/templates/instances/settings_tab.html:532 -#: networks/templates/network.html:400 -msgid "To" -msgstr "目标" - #: instances/templates/instances/settings_tab.html:541 msgid "" "The VM is running: it migrates live, or paused for the transfer when Live " @@ -5944,21 +6003,21 @@ msgstr "%(quota)s(%(total)s > %(limit)s)" msgid "None available device name" msgstr "没有可用的设备名称" -#: instances/utils.py:478 +#: instances/utils.py:480 #, python-format msgid "Connection Failed: %(host)s did not answer within %(seconds)s seconds" msgstr "连接失败:%(host)s 在 %(seconds)s 秒内无响应" -#: instances/utils.py:506 +#: instances/utils.py:508 #, python-format msgid "%(hostname)s via %(address)s" msgstr "%(hostname)s,经由 %(address)s" -#: instances/utils.py:539 +#: instances/utils.py:541 msgid "Invalid MAC address" msgstr "无效的 MAC 地址" -#: instances/utils.py:541 +#: instances/utils.py:543 msgid "More MAC addresses than networks" msgstr "MAC 地址数量多于网络数量" @@ -6278,7 +6337,7 @@ msgstr "卷已成功更改。" msgid "Disk %(dev)s is not a storage volume of this instance" msgstr "磁盘 %(dev)s 不是此虚拟机的存储卷" -#: instances/views.py:1594 vrtManager/instance.py:2425 +#: instances/views.py:1594 vrtManager/instance.py:2427 msgid "The VM has a saved state; start it or remove the saved state first" msgstr "虚拟机有保存的状态;请先启动它或删除保存的状态" @@ -6332,7 +6391,7 @@ msgstr "快照未删除:%(err)s" msgid "Add at least one device to the boot order." msgstr "请至少向启动顺序中添加一个设备。" -#: instances/views.py:1906 vrtManager/instance.py:1197 +#: instances/views.py:1906 vrtManager/instance.py:1199 msgid "Invalid Device Type for boot order" msgstr "启动顺序的设备类型无效" @@ -8957,319 +9016,323 @@ msgid "" "from cannot be checked; start the pool first" msgstr "存储池 %(pool)s 未激活:无法检查其中虚拟机磁盘所基于的文件;请先启动该存储池" -#: vrtManager/instance.py:173 +#: vrtManager/instance.py:170 +msgid "The VM is not running" +msgstr "虚拟机未在运行" + +#: vrtManager/instance.py:175 msgid "A running or paused VM cannot be migrated offline" msgstr "运行中或已暂停的虚拟机不能离线迁移" -#: vrtManager/instance.py:176 +#: vrtManager/instance.py:178 msgid "The VM can be migrated when it is running, paused or shut off" msgstr "虚拟机在运行、暂停或关机时可以迁移" -#: vrtManager/instance.py:199 +#: vrtManager/instance.py:201 msgid "A VM with snapshots cannot be migrated" msgstr "有快照的虚拟机不能迁移" -#: vrtManager/instance.py:202 +#: vrtManager/instance.py:204 msgid "A VM with a saved state cannot be migrated" msgstr "有保存的状态的虚拟机不能迁移" -#: vrtManager/instance.py:209 +#: vrtManager/instance.py:211 msgid "A VM with host devices cannot be migrated; remove them first" msgstr "有主机设备的虚拟机不能迁移;请先移除它们" -#: vrtManager/instance.py:213 +#: vrtManager/instance.py:215 #, python-format msgid "The destination host does not have these networks of the VM: %(names)s" msgstr "目标主机没有该虚拟机的这些网络:%(names)s" -#: vrtManager/instance.py:217 +#: vrtManager/instance.py:219 #, python-format msgid "" "The destination host does not have these network filters of the VM: %(names)s" msgstr "目标主机没有该虚拟机的这些网络过滤器:%(names)s" -#: vrtManager/instance.py:220 +#: vrtManager/instance.py:222 #, python-format msgid "" "These network filters of the VM have other rules on the destination host: " "%(names)s" msgstr "该虚拟机的这些网络过滤器在目标主机上的规则不同:%(names)s" -#: vrtManager/instance.py:223 +#: vrtManager/instance.py:225 #, python-format msgid "The destination host does not have these secrets of the VM: %(names)s" msgstr "目标主机没有该虚拟机的这些机密:%(names)s" -#: vrtManager/instance.py:230 +#: vrtManager/instance.py:232 #, python-format msgid "The destination host does not have these disks of the VM: %(disks)s" msgstr "目标主机没有该虚拟机的这些磁盘:%(disks)s" -#: vrtManager/instance.py:231 +#: vrtManager/instance.py:233 #, python-format msgid "%(target)s (%(source)s)" msgstr "%(target)s(%(source)s)" -#: vrtManager/instance.py:239 +#: vrtManager/instance.py:241 msgid "Destination host emulator is different. Cannot be migrated" msgstr "目标主机的模拟器不同,无法迁移" -#: vrtManager/instance.py:373 +#: vrtManager/instance.py:375 msgid "an image is not copied; eject it first" msgstr "镜像不会被复制;请先弹出它" -#: vrtManager/instance.py:376 +#: vrtManager/instance.py:378 msgid "a read-only or encrypted disk is not copied" msgstr "只读或加密的磁盘不会被复制" -#: vrtManager/instance.py:379 +#: vrtManager/instance.py:381 msgid "only raw and qcow2 disks are copied" msgstr "只复制 raw 和 qcow2 磁盘" -#: vrtManager/instance.py:381 +#: vrtManager/instance.py:383 msgid "no storage pool of the source host has it" msgstr "源主机的任何存储池中都没有它" -#: vrtManager/instance.py:383 +#: vrtManager/instance.py:385 msgid "a disk with a backing file is not copied" msgstr "有后备文件的磁盘不会被复制" -#: vrtManager/instance.py:403 +#: vrtManager/instance.py:405 #, python-format msgid "" "%(target)s (%(path)s): the destination host does not share it; choose a pool " "to copy it to" msgstr "%(target)s (%(path)s):目标主机不共享它;请选择要复制到的存储池" -#: vrtManager/instance.py:407 +#: vrtManager/instance.py:409 #, python-format msgid "%(target)s (%(path)s): %(refusal)s" msgstr "%(target)s (%(path)s):%(refusal)s" -#: vrtManager/instance.py:412 +#: vrtManager/instance.py:414 #, python-format msgid "" "%(target)s (%(path)s): the destination host has no pool %(pool)s for disk " "files" msgstr "%(target)s (%(path)s):目标主机没有用于磁盘文件的存储池 %(pool)s" -#: vrtManager/instance.py:419 +#: vrtManager/instance.py:421 #, python-format msgid "" "%(target)s (%(path)s): pool %(pool)s of the destination host already has a " "file %(file)s" msgstr "%(target)s (%(path)s):目标主机的存储池 %(pool)s 中已有文件 %(file)s" -#: vrtManager/instance.py:426 +#: vrtManager/instance.py:428 #, python-format msgid "%(target)s (%(path)s): another disk is copied to %(dest)s" msgstr "%(target)s (%(path)s):另一个磁盘已复制到 %(dest)s" -#: vrtManager/instance.py:431 +#: vrtManager/instance.py:433 #, python-format msgid "%(target)s: the VM has no disk file to copy" msgstr "%(target)s:虚拟机没有可复制的磁盘文件" -#: vrtManager/instance.py:435 +#: vrtManager/instance.py:437 #, python-format msgid "" "%(target)s (%(path)s) of the next start: the destination host does not share " "it" msgstr "下次启动的 %(target)s (%(path)s):目标主机不共享它" -#: vrtManager/instance.py:439 +#: vrtManager/instance.py:441 #, python-format msgid "The disks cannot be migrated: %(problems)s" msgstr "磁盘无法迁移:%(problems)s" -#: vrtManager/instance.py:452 +#: vrtManager/instance.py:454 #, python-format msgid "" "%(error)s; remove the partial disk copies from the destination host: " "%(copies)s" msgstr "%(error)s;请从目标主机删除不完整的磁盘副本:%(copies)s" -#: vrtManager/instance.py:469 +#: vrtManager/instance.py:471 #, python-format msgid "" "%(error)s; remove the partial disk copies from the destination host: %(left)s" msgstr "%(error)s;请从目标主机删除不完整的磁盘副本:%(left)s" -#: vrtManager/instance.py:483 +#: vrtManager/instance.py:485 #, python-format msgid "" "The NVRAM file %(path)s is not in libvirt's NVRAM directory %(dir)s and " "cannot be copied" msgstr "NVRAM 文件 %(path)s 不在 libvirt 的 NVRAM 目录 %(dir)s 中,无法复制" -#: vrtManager/instance.py:492 +#: vrtManager/instance.py:494 #, python-format msgid "The destination host cannot see the NVRAM file %(path)s" msgstr "目标主机看不到 NVRAM 文件 %(path)s" -#: vrtManager/instance.py:583 +#: vrtManager/instance.py:585 #, python-format msgid "%(type)s disk, cannot be checked" msgstr "%(type)s 磁盘,无法检查" -#: vrtManager/instance.py:623 +#: vrtManager/instance.py:625 #, python-format msgid "The destination host already has a VM %(key)s" msgstr "目标主机上已有虚拟机 %(key)s" -#: vrtManager/instance.py:645 +#: vrtManager/instance.py:647 msgid "The VM was started on the source host during the migration" msgstr "迁移期间虚拟机在源主机上被启动" -#: vrtManager/instance.py:661 +#: vrtManager/instance.py:663 #, python-format msgid "" "%(error)s; the VM may now be defined only on the destination host: check both" " hosts" msgstr "%(error)s;虚拟机现在可能只在目标主机上定义:请检查两台主机" -#: vrtManager/instance.py:667 +#: vrtManager/instance.py:669 #, python-format msgid "" "%(error)s; the VM is now defined on both hosts, remove it from the " "destination: %(undo_error)s" msgstr "%(error)s;虚拟机现在在两台主机上都有定义,请从目标主机删除它:%(undo_error)s" -#: vrtManager/instance.py:673 +#: vrtManager/instance.py:675 msgid "" "Snapshot names are 1-64 letters, digits, '.', '_' or '-' and do not start " "with '.'" msgstr "快照名称为 1-64 个字母、数字、'.'、'_' 或 '-',且不能以 '.' 开头" -#: vrtManager/instance.py:1185 +#: vrtManager/instance.py:1187 msgid "" "A device other than a disk or NIC is in the boot order: change it in the XML " "editor" msgstr "启动顺序中有磁盘或网卡以外的设备:请在 XML 编辑器中修改" -#: vrtManager/instance.py:1200 +#: vrtManager/instance.py:1202 #, python-format msgid "Boot device %(dev)s is not in the definition" msgstr "启动设备 %(dev)s 不在定义中" -#: vrtManager/instance.py:1220 +#: vrtManager/instance.py:1222 #, python-format msgid "CD-ROM %(dev)s is not in the running definition" msgstr "CD-ROM %(dev)s 不在运行中的定义中" -#: vrtManager/instance.py:1221 +#: vrtManager/instance.py:1223 #, python-format msgid "CD-ROM %(dev)s is not in the persistent definition" msgstr "CD-ROM %(dev)s 不在持久定义中" -#: vrtManager/instance.py:1234 +#: vrtManager/instance.py:1236 #, python-format msgid "Media of %(dev)s changed in the running VM only: %(err)s" msgstr "%(dev)s 的介质仅在运行中的虚拟机中更改:%(err)s" -#: vrtManager/instance.py:1245 +#: vrtManager/instance.py:1247 #, python-format msgid "ISO image %(image)s was not found" msgstr "未找到 ISO 镜像 %(image)s" -#: vrtManager/instance.py:1247 +#: vrtManager/instance.py:1249 #, python-format msgid "ISO image %(image)s is in more than one storage pool" msgstr "ISO 镜像 %(image)s 位于多个存储池中" -#: vrtManager/instance.py:1342 +#: vrtManager/instance.py:1344 #, python-format msgid "Disk %(target_dev)s is not in the VM's definition" msgstr "磁盘 %(target_dev)s 不在虚拟机的定义中" -#: vrtManager/instance.py:1474 +#: vrtManager/instance.py:1476 msgid "Please shutdown the instance then try to enable vCPU hotplug" msgstr "请先关闭虚拟机,再启用 vCPU 热插拔" -#: vrtManager/instance.py:1677 +#: vrtManager/instance.py:1679 #, python-format msgid "" "The serial console is a %(type)s one, the browser opens only a pty one; " "change it in the XML editor" msgstr "串行控制台的类型是 %(type)s,浏览器只能打开 pty 类型的;请在 XML 编辑器中更改" -#: vrtManager/instance.py:1788 +#: vrtManager/instance.py:1790 msgid "The VM has no video card" msgstr "虚拟机没有显卡" -#: vrtManager/instance.py:1798 +#: vrtManager/instance.py:1800 #, python-format msgid "" "The VM's CPU topology has %(count)s vCPUs: change it in the XML editor to set" " another maximum" msgstr "该虚拟机的 CPU 拓扑为 %(count)s 个 vCPU:要设置其他最大值,请在 XML 编辑器中修改拓扑" -#: vrtManager/instance.py:1824 +#: vrtManager/instance.py:1826 #, python-format msgid "The VM's next start has a maximum memory of %(max)s MiB" msgstr "虚拟机下次启动时的最大内存为 %(max)s MiB" -#: vrtManager/instance.py:1965 +#: vrtManager/instance.py:1967 msgid "" "The VM has external snapshots; internal snapshots cannot be mixed with them" msgstr "虚拟机有外部快照;内部快照不能与其混用" -#: vrtManager/instance.py:1997 +#: vrtManager/instance.py:1999 msgid "A snapshot with memory is not quiesced; it keeps the whole guest state" msgstr "含内存的快照不会静默文件系统;它保存整个客户机状态" -#: vrtManager/instance.py:1999 +#: vrtManager/instance.py:2001 msgid "Only a running VM's file systems can be frozen" msgstr "只有运行中的虚拟机的文件系统可以冻结" -#: vrtManager/instance.py:2001 +#: vrtManager/instance.py:2003 msgid "The QEMU guest agent is not connected; it freezes the file systems" msgstr "QEMU 客户机代理未连接;文件系统由它冻结" -#: vrtManager/instance.py:2004 +#: vrtManager/instance.py:2006 msgid "" "The VM has internal snapshots; external snapshots cannot be mixed with them" msgstr "虚拟机有内部快照;外部快照不能与其混用" -#: vrtManager/instance.py:2009 +#: vrtManager/instance.py:2011 msgid "Newer snapshots exist after the last revert; delete them first" msgstr "上次还原后存在更新的快照;请先删除它们" -#: vrtManager/instance.py:2012 +#: vrtManager/instance.py:2014 msgid "No snapshot is current; revert to a snapshot first" msgstr "没有当前快照;请先还原到某个快照" -#: vrtManager/instance.py:2018 +#: vrtManager/instance.py:2020 #, python-format msgid "Eject the media from %(dev)s first" msgstr "请先弹出 %(dev)s 中的介质" -#: vrtManager/instance.py:2020 +#: vrtManager/instance.py:2022 #, python-format msgid "Disk %(dev)s is not a file; external snapshots need file disks" msgstr "磁盘 %(dev)s 不是文件;外部快照需要文件磁盘" -#: vrtManager/instance.py:2028 +#: vrtManager/instance.py:2030 #, python-format msgid "" "The storage pools could not be refreshed, so their free space is unknown: " "%(err)s" msgstr "无法刷新存储池,其可用空间未知:%(err)s" -#: vrtManager/instance.py:2049 +#: vrtManager/instance.py:2051 msgid "Memory is saved only from a running VM" msgstr "只能保存运行中的虚拟机的内存" -#: vrtManager/instance.py:2051 +#: vrtManager/instance.py:2053 msgid "The VM has no disk to keep its memory next to" msgstr "虚拟机没有可存放其内存的磁盘" -#: vrtManager/instance.py:2055 +#: vrtManager/instance.py:2057 #, python-format msgid "%(disk)s is not in a storage pool; memory is saved only into one" msgstr "%(disk)s 不在存储池中;内存只能保存到存储池中" -#: vrtManager/instance.py:2086 +#: vrtManager/instance.py:2088 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the snapshot needs %(size).1f " @@ -9279,151 +9342,151 @@ msgstr "" "存储池 %(pool)s 可用 %(free).1f GiB;快照需要 %(size).1f GiB(其中虚拟机磁盘的 %(percent)g%%,至少 " "%(minimum)g GiB,若保存内存则另加内存)" -#: vrtManager/instance.py:2104 +#: vrtManager/instance.py:2106 msgid "" "This snapshot was taken by an older version on a UEFI VM and cannot be " "reverted; delete it instead" msgstr "此快照由旧版本在 UEFI 虚拟机上创建,无法还原;请将其删除" -#: vrtManager/instance.py:2134 +#: vrtManager/instance.py:2136 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is " "running." msgstr "还原两次失败;请稍后重试(%(error)s)。虚拟机正在运行。" -#: vrtManager/instance.py:2136 +#: vrtManager/instance.py:2138 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is shut " "off." msgstr "还原两次失败;请稍后重试(%(error)s)。虚拟机已关机。" -#: vrtManager/instance.py:2304 +#: vrtManager/instance.py:2306 msgid "A disk moves when its VM is defined and running, paused or shut off" msgstr "仅当虚拟机已定义且处于运行、暂停或关机状态时才能移动磁盘" -#: vrtManager/instance.py:2306 +#: vrtManager/instance.py:2308 msgid "" "A disk of a VM with snapshots, a saved state or a running block job does not " "move" msgstr "有快照、保存的状态或正在运行块任务的虚拟机的磁盘不能移动" -#: vrtManager/instance.py:2314 +#: vrtManager/instance.py:2316 #, python-format msgid "" "%(dev)s is not a disk file of the VM, the same in its running and next " "start's definition" msgstr "%(dev)s 不是该虚拟机在运行中的定义和下次启动定义中相同的磁盘文件" -#: vrtManager/instance.py:2319 +#: vrtManager/instance.py:2321 #, python-format msgid "%(dev)s does not move: only writable raw and qcow2 disks do" msgstr "%(dev)s 不能移动:只能移动可写的 raw 和 qcow2 磁盘" -#: vrtManager/instance.py:2326 +#: vrtManager/instance.py:2328 #, python-format msgid "%(dev)s does not move: no storage pool has %(path)s" msgstr "%(dev)s 不能移动:没有存储池包含 %(path)s" -#: vrtManager/instance.py:2328 +#: vrtManager/instance.py:2330 #, python-format msgid "%(dev)s does not move: it has a backing file" msgstr "%(dev)s 不能移动:它有后备文件" -#: vrtManager/instance.py:2331 +#: vrtManager/instance.py:2333 #, python-format msgid "%(pool_name)s is not an active pool of disk files of this host" msgstr "%(pool_name)s 不是此主机上活动的磁盘文件存储池" -#: vrtManager/instance.py:2334 +#: vrtManager/instance.py:2336 #, python-format msgid "%(dev)s is in pool %(pool_name)s already" msgstr "%(dev)s 已在存储池 %(pool_name)s 中" -#: vrtManager/instance.py:2338 +#: vrtManager/instance.py:2340 #, python-format msgid "Pool %(pool_name)s already has a file %(name)s" msgstr "存储池 %(pool_name)s 中已有文件 %(name)s" -#: vrtManager/instance.py:2362 +#: vrtManager/instance.py:2364 #, python-format msgid "The copy of %(dev)s ended before it was complete" msgstr "%(dev)s 的复制在完成前结束" -#: vrtManager/instance.py:2407 +#: vrtManager/instance.py:2409 #, python-format msgid "%(error)s; remove %(dest)s if it is there: %(cleanup_error)s" msgstr "%(error)s;如果 %(dest)s 存在请将其删除:%(cleanup_error)s" -#: vrtManager/instance.py:2409 +#: vrtManager/instance.py:2411 #, python-format msgid "%(error)s; the VM may use %(dest)s now: check its disk %(dev)s" msgstr "%(error)s;虚拟机现在可能在使用 %(dest)s:请检查其磁盘 %(dev)s" -#: vrtManager/instance.py:2416 +#: vrtManager/instance.py:2418 #, python-format msgid "The VM has no internal snapshot named %(name)s" msgstr "虚拟机没有名为 %(name)s 的内部快照" -#: vrtManager/instance.py:2427 +#: vrtManager/instance.py:2429 msgid "A snapshot job is still running on this VM; try again when it ends" msgstr "此虚拟机上仍有快照任务在运行;请在其结束后重试" -#: vrtManager/instance.py:2437 +#: vrtManager/instance.py:2439 msgid "Shut the VM down to revert to an internal snapshot" msgstr "请关闭虚拟机后再还原到内部快照" -#: vrtManager/instance.py:2524 +#: vrtManager/instance.py:2526 msgid "A VM with a host's or an external TPM is not cloned; remove it first" msgstr "带有主机 TPM 或外部 TPM 的虚拟机无法克隆;请先将其移除" -#: vrtManager/instance.py:2555 +#: vrtManager/instance.py:2557 msgid "Cannot clone a VM whose NVRAM is not a file" msgstr "NVRAM 不是文件的虚拟机无法克隆" -#: vrtManager/instance.py:2625 +#: vrtManager/instance.py:2627 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(path)s" msgstr "克隆失败(%(err)s);请手动删除这些副本:%(path)s" -#: vrtManager/instance.py:2636 +#: vrtManager/instance.py:2638 msgid "Shut the VM down before cloning it" msgstr "请先关闭虚拟机再克隆" -#: vrtManager/instance.py:2663 +#: vrtManager/instance.py:2665 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(leftovers)s" msgstr "克隆失败(%(err)s);请手动删除这些副本:%(leftovers)s" -#: vrtManager/instance.py:2674 +#: vrtManager/instance.py:2676 msgid "Live clone needs libvirt 11.10 or later; shut the VM down to clone it" msgstr "在线克隆需要 libvirt 11.10 或更高版本;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2677 +#: vrtManager/instance.py:2679 msgid "A VM with a TPM is cloned only shut down" msgstr "带 TPM 的虚拟机只能在关机时克隆" -#: vrtManager/instance.py:2680 +#: vrtManager/instance.py:2682 #, python-format msgid "Disk %(dev)s is not a local file; shut the VM down to clone it" msgstr "磁盘 %(dev)s 不是本地文件;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2682 +#: vrtManager/instance.py:2684 #, python-format msgid "Disk %(dev)s is shareable; shut the VM down to clone it" msgstr "磁盘 %(dev)s 是可共享的;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2687 +#: vrtManager/instance.py:2689 #, python-format msgid "Disk %(dev)s changes at the next start; shut the VM down to clone it" msgstr "磁盘 %(dev)s 在下次启动时会改变;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2689 +#: vrtManager/instance.py:2691 msgid "Another job is running on the VM; clone it when that ends" msgstr "虚拟机上有另一个任务正在运行;请在其结束后再克隆" -#: vrtManager/instance.py:2715 +#: vrtManager/instance.py:2717 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the clone needs %(size).1f GiB" @@ -9432,111 +9495,111 @@ msgstr "" "存储池 %(pool)s 可用 %(free).1f GiB;克隆需要 %(size).1f GiB(复制的磁盘,再加其 %(percent)g%%,至少" " %(minimum)g GiB)" -#: vrtManager/instance.py:2732 +#: vrtManager/instance.py:2734 #, python-format msgid "Volume %(name)s already exists in storage pool %(pool)s" msgstr "卷 %(name)s 已存在于存储池 %(pool)s 中" -#: vrtManager/instance.py:2886 +#: vrtManager/instance.py:2888 msgid "A network interface that is a host device is removed in the XML editor" msgstr "作为主机设备的网络接口需在 XML 编辑器中删除" -#: vrtManager/instance.py:2902 +#: vrtManager/instance.py:2904 #, python-format msgid "No network interface with MAC %(old_mac)s" msgstr "没有 MAC 为 %(old_mac)s 的网络接口" -#: vrtManager/instance.py:2905 +#: vrtManager/instance.py:2907 msgid "A network interface that is a host device is changed in the XML editor" msgstr "作为主机设备的网络接口需在 XML 编辑器中修改" -#: vrtManager/instance.py:2999 +#: vrtManager/instance.py:3001 msgid "" "A VM changes its PCI devices while it runs, or is shut off without a saved " "state" msgstr "虚拟机只能在运行时或无保存的状态的关机时更改其 PCI 设备" -#: vrtManager/instance.py:3020 +#: vrtManager/instance.py:3022 #, python-format msgid "%(err)s; whether the VM has %(device)s now is not known" msgstr "%(err)s;虚拟机现在是否有 %(device)s 未知" -#: vrtManager/instance.py:3022 +#: vrtManager/instance.py:3024 #, python-format msgid "%(err)s; %(device)s: the VM is not running, its next start has it" msgstr "%(err)s;%(device)s:虚拟机未运行,下次启动时有它" -#: vrtManager/instance.py:3023 +#: vrtManager/instance.py:3025 #, python-format msgid "" "%(err)s; %(device)s: the VM is not running, its next start does not have it" msgstr "%(err)s;%(device)s:虚拟机未运行,下次启动时没有它" -#: vrtManager/instance.py:3024 +#: vrtManager/instance.py:3026 #, python-format msgid "%(err)s; %(device)s: the running VM has it, its next start has it" msgstr "%(err)s;%(device)s:运行中的虚拟机有它,下次启动时有它" -#: vrtManager/instance.py:3025 +#: vrtManager/instance.py:3027 #, python-format msgid "" "%(err)s; %(device)s: the running VM has it, its next start does not have it" msgstr "%(err)s;%(device)s:运行中的虚拟机有它,下次启动时没有它" -#: vrtManager/instance.py:3026 +#: vrtManager/instance.py:3028 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start has it" msgstr "%(err)s;%(device)s:运行中的虚拟机没有它,下次启动时有它" -#: vrtManager/instance.py:3028 +#: vrtManager/instance.py:3030 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start does not" " have it" msgstr "%(err)s;%(device)s:运行中的虚拟机没有它,下次启动时没有它" -#: vrtManager/instance.py:3062 +#: vrtManager/instance.py:3064 #, python-format msgid "The VM has no PCI device %(address)s" msgstr "虚拟机没有 PCI 设备 %(address)s" -#: vrtManager/instance.py:3083 +#: vrtManager/instance.py:3085 msgid "The VM has no USB controller" msgstr "虚拟机没有 USB 控制器" -#: vrtManager/instance.py:3117 +#: vrtManager/instance.py:3119 msgid "The VM has no such USB device" msgstr "虚拟机没有此 USB 设备" -#: vrtManager/instance.py:3131 +#: vrtManager/instance.py:3133 #, python-format msgid "The VM has no network interface %(mac)s" msgstr "虚拟机没有网络接口 %(mac)s" -#: vrtManager/instance.py:3162 +#: vrtManager/instance.py:3164 msgid "The VM has its own RNG device: change it in the XML editor" msgstr "虚拟机有自己的 RNG 设备:请在 XML 编辑器中修改" -#: vrtManager/instance.py:3189 +#: vrtManager/instance.py:3191 msgid "The VM has its own TPM: change it in the XML editor" msgstr "虚拟机有自己的 TPM:请在 XML 编辑器中修改" -#: vrtManager/instance.py:3208 +#: vrtManager/instance.py:3210 #, python-format msgid "Unknown crash action %(action)s" msgstr "未知的崩溃操作 %(action)s" -#: vrtManager/instance.py:3235 +#: vrtManager/instance.py:3237 #, python-format msgid "Network interface %(mac)s is not in the definition" msgstr "网络接口 %(mac)s 不在定义中" -#: vrtManager/instance.py:3326 +#: vrtManager/instance.py:3328 msgid "The guest agent did not answer in time; nothing was changed" msgstr "客户机代理未及时响应;未做任何更改" -#: vrtManager/instance.py:3329 +#: vrtManager/instance.py:3331 msgid "The VM runs Windows: its guest agent sets no root password or SSH key" msgstr "该虚拟机运行 Windows:其客户机代理不能设置 root 密码或 SSH 密钥" diff --git a/operations/api/viewsets.py b/operations/api/viewsets.py index ccc3d754..231fd3cc 100644 --- a/operations/api/viewsets.py +++ b/operations/api/viewsets.py @@ -50,9 +50,10 @@ class OperationViewSet(mixins.ListModelMixin, mixins.RetrieveModelMixin, viewset raise ValidationError({"key": "required"}) if not visible(request.user, key): raise Http404 - # the jobs on the resource and the page's own; a job another one on this page started shows in that one - active = list(Operation.objects.filter(Q(claims__resource=key) | Q(resource=key), state__in=SHOWN_STATES) - .exclude(parent__resource=key).distinct()) + # the page's own jobs and the jobs on its resource; a job another one started (a bulk migration's + # migration) shows on its own page only, the one that started it on its pages + active = list(Operation.objects.filter(Q(resource=key) | Q(claims__resource=key, parent__isnull=True), + state__in=SHOWN_STATES).distinct()) mine = [op for op in active if may_see(op, request.user)] others = [summary(op, request.user) for op in active if not may_see(op, request.user)] seen = last_seen() diff --git a/operations/claims.py b/operations/claims.py index 883285fd..2cf302ba 100644 --- a/operations/claims.py +++ b/operations/claims.py @@ -42,8 +42,9 @@ def reconcile_key(compute_id): def bulk_migrate_key(): - """The bulk migrations: one at a time. One waits in a worker slot for its - migrations; several could take every slot and leave none for them.""" + """The bulk migrations and balances: one at a time. One waits in a worker + slot for its migrations; several could take every slot and leave none + for them. The Computes page shows them.""" return "bulk_migrate" diff --git a/static/js/balance.js b/static/js/balance.js new file mode 100644 index 00000000..106dba41 --- /dev/null +++ b/static/js/balance.js @@ -0,0 +1,12 @@ +// The Balance page: unticking a VM keeps it where it is, ticking it again +// lets it move; either makes the proposal again. The header box ticks or +// unticks every VM listed. +const form = document.getElementById("balance-form"); +form?.addEventListener("change", function (event) { + if (event.target.id === "balance-all") { + form.querySelectorAll("input[name=vm]").forEach(function (box) { + box.checked = event.target.checked; + }); + } + form.submit(); +}); diff --git a/vrtManager/instance.py b/vrtManager/instance.py index a79aac98..bbc56a52 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -149,15 +149,15 @@ class wvmInstances(wvmConnect): return sorted(missing), sorted(unlike) def moveto(self, conn, name, live, unsafe, offline, autoconverge=False, compress=False, uri=None, - pools=None, on_copy=None): + pools=None, on_copy=None, running_only=False): """Migrates the VM of conn (a wvmInstance on the source) here. The mode follows the VM's state, read once: a running VM migrates live or, without live, paused for the transfer (non-live); a paused VM stays paused; a shut-off VM moves offline, also when the request was made while it ran (live). An offline request for a running or - paused VM is refused. unsafe, autoconverge (live only) and - compress apply to a running VM. uri: the native migration URI + paused VM is refused, and with running_only a VM not running. + unsafe, autoconverge (live only) and compress apply to a running VM. uri: the native migration URI (tcp://address) on the destination; None lets libvirt use the destination's own hostname. pools: {target: pool here} of the disks libvirt copies into those pools during the migration (disk_copies); @@ -166,6 +166,8 @@ class wvmInstances(wvmConnect): libvirt makes them. Returns the mode and options used, for the log, and each copied disk's path and the path of its copy here.""" state = conn.get_status() + if running_only and state != 1: + raise util.OperationError(gettext_noop("The VM is not running")) if state == 5: mode = ["offline"] elif state in (1, 3): diff --git a/vrtManager/tests/test_migration.py b/vrtManager/tests/test_migration.py index 6c05bdea..b6b19950 100644 --- a/vrtManager/tests/test_migration.py +++ b/vrtManager/tests/test_migration.py @@ -30,6 +30,17 @@ class MigrationFlagsTestCase(unittest.TestCase): destination().moveto(source, "vm", live=True, unsafe=False, offline=False) self.assertIsNone(source.instance.calls[0][1]) + def test_running_only_refuses_a_vm_not_running(self): + for state in (3, 5): + with self.subTest(state=state): + source = FakeSource(state) + with self.assertRaisesRegex(util.OperationError, "not running"): + destination().moveto(source, "vm", live=True, unsafe=False, offline=False, running_only=True) + self.assertEqual(source.instance.calls, []) + source = FakeSource(1) + destination().moveto(source, "vm", live=True, unsafe=False, offline=False, running_only=True) + self.assertEqual(len(source.instance.calls), 1) + class ShutOffMigrationTestCase(unittest.TestCase): """libvirt's offline migration fails on some builds (RHEL-156800); a