diff --git a/README.md b/README.md index 31204815..a94ccc96 100644 --- a/README.md +++ b/README.md @@ -32,7 +32,7 @@ WebVirtCloud and `virt-manager`/`virsh` can manage the same libvirt host **concu ## Features * QEMU/KVM hypervisor management (multiple compute nodes), with each host's capacity and what its VMs were given -* Virtual machine lifecycle: create, delete, power management, clone (also of a running VM, with libvirt 11.10 or later), migrate (with or without shared storage), evacuate a host (its chosen VMs migrate to another, the chosen number at once), disk moves between pools +* Virtual machine lifecycle: create, delete, power management, clone (also of a running VM, with libvirt 11.10 or later), migrate (with or without shared storage), bulk migrate (a host's chosen VMs to another host, the chosen number at once), disk moves between pools * Long operations (create, clone, delete, snapshots, migration, disk moves, ISO upload) run as jobs that the page follows; a queued job can be cancelled, and a running clone, migration, disk move or ISO upload too * External snapshots (memory optional; without memory, guest file systems can be frozen through the agent) * **External change detection:** VMs created, deleted or renamed via `virt-manager` or `virsh` are reconciled into the database automatically diff --git a/computes/jobs.py b/computes/jobs.py index 4564882d..ca32f868 100644 --- a/computes/jobs.py +++ b/computes/jobs.py @@ -14,7 +14,7 @@ from operations.jobs import Cancelled, Kind, Outcome, Plan, register from operations.models import Claim, Operation -# where a host is: an evacuation stops if either host's record points elsewhere since it was asked +# where a host is: a bulk migration stops if either host's record points elsewhere since it was asked WHERE = ("hostname", "login", "type") @@ -23,20 +23,20 @@ def _where(params): def parallel_limit(): - """The most migrations an evacuation runs at once: the worker gives a - host's jobs half of its slots, and the evacuation itself takes one.""" + """The most migrations a bulk migration runs at once: the worker gives a + host's jobs half of its slots, and the bulk migration itself takes one.""" slots = utils.concurrency() return min(max(1, slots // 2), slots - 1) @register -class EvacuateHost(Kind): +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.""" - name = "host.evacuate" - label = gettext_noop("Evacuate host") + name = "host.bulk_migrate" + label = gettext_noop("Bulk migrate") cancellable = True def normalize(self, raw): @@ -55,7 +55,7 @@ class EvacuateHost(Kind): def plan(self, user, params): compute = Compute.objects.get(pk=params["compute"]) target = Compute.objects.get(pk=params["target"]) - return Plan(claims={claims.evacuate_key(): Claim.EXCLUSIVE}, resource=claims.compute_key(compute.pk), + 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): @@ -122,9 +122,9 @@ class EvacuateHost(Kind): def reconcile(self, op): return Outcome(Operation.FAILED, error=utils.say(gettext_noop( - "The evacuation stopped: the migrations it started go on as their own jobs; the other VMs stay"))) + "The bulk migration stopped: the migrations it started go on as their own jobs; the other VMs stay"))) def log_entry(self, op, state): source, _sep, target = op.resource_label.partition(" -> ") - message = f"Evacuate to {target}" + message = f"Bulk migrate to {target}" return source, "", "", message if state == Operation.SUCCEEDED else f"{message} ({state})" diff --git a/computes/templates/computes/evacuate.html b/computes/templates/computes/bulk_migrate.html similarity index 64% rename from computes/templates/computes/evacuate.html rename to computes/templates/computes/bulk_migrate.html index ae9e00e0..cb5cd326 100644 --- a/computes/templates/computes/evacuate.html +++ b/computes/templates/computes/bulk_migrate.html @@ -2,8 +2,8 @@ {% load i18n %} {% load static %} {% load operations %} -{% block title %}{% trans "Evacuate" %} - {{ compute.name }}{% endblock %} -{% block page_heading %}{{ compute.name }} - {% trans "Evacuate" %}{% endblock page_heading %} +{% block title %}{% trans "Bulk Migrate" %} - {{ compute.name }}{% endblock %} +{% block page_heading %}{{ compute.name }} - {% trans "Bulk Migrate" %}{% endblock page_heading %} {% block content %}
{% trans "Each chosen VM migrates in a job of its own: a running VM live, a shut-off one offline. A VM that fails stays on this host." %}
- +{% else %} +{% trans "Destination" %}: {{ target.name }}
+{% endif %} {% if not parallel %}