diff --git a/README.md b/README.md index 94947bef..1a319b84 100644 --- a/README.md +++ b/README.md @@ -866,7 +866,7 @@ What an update from an older version changes for operators and users. `manage.py - On a running VM the edit forms show the settings as they will be at the next start, so saving an edit no longer reverts another pending change. - External snapshots need libvirt 9.9 or newer on the computes. libvirt 9.10 (openEuler 24.03 LTS) refuses to revert a snapshot taken without memory of a running or paused VM ("Invalid target domain state 'disk-snapshot'"); 11.10 reverts it. A VM's snapshots form one chain: after a revert, delete the newer snapshots before taking another. An internal snapshot is reverted only on a shut-off VM. Snapshot names no longer get an `s1.` prefix. A snapshot an older version took of a UEFI VM can only be deleted, not reverted. On NFS, the qemu user needs write access to the image directory to remove merged snapshot files. - A storage volume a VM still needs (a disk, a backing file or a snapshot's file) is not deleted; deleting a VM with its files keeps a file another compute's VM or volume uses at the same path, and is refused before the VM is stopped when one of the other computes cannot be reached. -- A VM that vanishes from its compute, or whose compute is deleted, keeps its owners for `INSTANCE_OWNERSHIP_RETENTION_DAYS` (30) in case the same UUID comes back; superusers manage these records on the "Removed VMs" page. +- A VM that vanishes from its compute, or whose compute is deleted, keeps its owners, tags, protection and schedules for `INSTANCE_OWNERSHIP_RETENTION_DAYS` (30) in case the same UUID comes back, and its backups are linked to it again; superusers manage these records on the "Removed VMs" page. - The Logs page records who changed what (computes, users, groups, VM owners, settings, SSH keys, host networks, pools, volumes, interfaces, secrets and network filters), every login, failed login and lockout, and every page or API call answered 401 or 403 to a signed-in user or a request with credentials, with the address and the result (a VM hidden with 404 is not logged). - On a host whose libvirt cannot change network interfaces (the udev backend: RHEL 9 and later, Debian 12), the interface pages offer no create, start, stop or delete. - The panel is offered in English, Turkish and Simplified Chinese. diff --git a/admin/templates/admin/tombstone_list.html b/admin/templates/admin/tombstone_list.html index 9e31400b..55615eda 100644 --- a/admin/templates/admin/tombstone_list.html +++ b/admin/templates/admin/tombstone_list.html @@ -8,7 +8,7 @@ {% block page_heading %}{% trans "Removed VMs" %}{% endblock page_heading %} {% block content %} -

{% trans "VMs that vanished from their compute. Their owners and tags come back if the same UUID shows up again before the record expires." %}

+

{% trans "VMs that vanished from their compute. Their owners, tags, protection and schedules come back if the same UUID shows up again before the record expires; their backups come back with them." %}

{% if not tombstones %}
{% bs_icon 'info-circle' %} {% trans "No removed VMs" %} @@ -26,6 +26,7 @@
{{ tombstone.name }} {% if tombstone.is_template %}{% trans "Template" %}{% endif %} + {% if tombstone.protected %}{% trans "Protected" %}{% endif %} {% include 'common/tag_badges.html' with tags=tombstone.tags %}
{{ tombstone.uuid }}
diff --git a/admin/tests/test_tombstones.py b/admin/tests/test_tombstones.py index bc590305..5c2dc63c 100644 --- a/admin/tests/test_tombstones.py +++ b/admin/tests/test_tombstones.py @@ -53,7 +53,7 @@ class TombstoneTests(TestCase): def test_a_get_only_asks_for_confirmation(self): response = self.client.get(reverse("admin:tombstone_delete", args=[self.tombstone.pk])) self.assertContains(response, "ts-vm") - self.assertContains(response, "Its owners and tags no longer come back if its UUID shows up again.") + self.assertContains(response, "Its owners, tags, protection and schedules no longer come back if its UUID shows up again, nor are its backups linked to it again.") self.assertTrue(InstanceTombstone.objects.exists()) def test_a_post_removes_it(self): diff --git a/admin/views.py b/admin/views.py index 2c45d2cd..4653cb81 100644 --- a/admin/views.py +++ b/admin/views.py @@ -462,7 +462,7 @@ def tombstone_delete(request, pk): request, "common/confirm_delete.html", {"object": tombstone, - "consequence": _("Its owners and tags no longer come back if its UUID shows up again.")}, + "consequence": _("Its owners, tags, protection and schedules no longer come back if its UUID shows up again, nor are its backups linked to it again.")}, ) @@ -485,7 +485,7 @@ def _retag_removed_vms(old, new): tombstone.tags = [new if name == old else name for name in tombstone.tags] else: tombstone.tags = [name for name in tombstone.tags if name != old] - if tombstone.tags or tombstone.owners or tombstone.is_template: + if tombstone.keeps_anything(): tombstone.save(update_fields=["tags"]) else: # kept only for the tag (computes.utils._bury) tombstone.delete() diff --git a/computes/tests/test_ownership.py b/computes/tests/test_ownership.py index 9cfcf54d..02076810 100644 --- a/computes/tests/test_ownership.py +++ b/computes/tests/test_ownership.py @@ -1,10 +1,10 @@ """Ownership survives a VM's temporary disappearance or an out-of-band move.""" -from datetime import timedelta +from datetime import time, timedelta from unittest.mock import MagicMock from accounts.models import UserInstance -from computes.models import Compute +from computes.models import Compute, Tag from computes.utils import refresh_instance_database from django.contrib.auth import get_user_model from django.test import TestCase, override_settings @@ -15,6 +15,7 @@ from logs.models import Logs from operations import claims from operations.models import Claim from rest_framework.test import APIClient +from vmbackups.models import Backup, BackupPolicy, BackupTarget from computes.tests.fakes import Domain UUID = "44444444-4444-4444-4444-444444444444" @@ -59,14 +60,57 @@ class OwnershipTestCase(TestCase): self.assertEqual(self.ownership(self.host_a), (True, [(self.owner, True, False, True)])) self.assertFalse(InstanceTombstone.objects.exists()) self.assertEqual(self.rows(), [ - ("-", "host-a", f"VM vm ({UUID}): owners and tags kept on the Removed VMs page"), - ("-", "host-a", f"VM vm ({UUID}): owners and tags restored"), + ("-", "host-a", f"VM vm ({UUID}): kept on the Removed VMs page"), + ("-", "host-a", f"VM vm ({UUID}): restored from the Removed VMs page"), ]) + def test_vm_that_returns_gets_its_protection_schedules_and_backups_back(self): + vm = Instance.objects.create(compute=self.host_a, name="vm", uuid=UUID, protected=True) + target = BackupTarget.objects.create(name="t") + policy = BackupPolicy.objects.create(name="nightly", target=target, time=time(2), keep=1) + policy.instances.add(vm) + backup = Backup.objects.create(target=target, instance=vm, vm_uuid=UUID, vm_name="vm", compute_name="host-a", + state=Backup.READY, policy=policy) + refresh_instance_database(self.host_a) # undefined for a while + self.assertEqual(InstanceTombstone.objects.get().policies, [policy.pk]) + + self.on(self.host_a, [("vm", UUID)]) # defined again + refresh_instance_database(self.host_a) + + vm = Instance.objects.get(uuid=UUID) + self.assertTrue(vm.protected) + self.assertEqual(list(vm.backup_policies.all()), [policy]) + backup.refresh_from_db() + self.assertEqual(backup.instance, vm) + + def test_a_schedule_that_chooses_by_tag_since_is_not_given_the_vm(self): + vm = Instance.objects.create(compute=self.host_a, name="vm", uuid=UUID) + policy = BackupPolicy.objects.create(name="nightly", target=BackupTarget.objects.create(name="t"), + time=time(2), keep=1) + policy.instances.add(vm) + refresh_instance_database(self.host_a) + BackupPolicy.objects.filter(pk=policy.pk).update(tag=Tag.objects.create(name="prod")) + self.on(self.host_a, [("vm", UUID)]) + refresh_instance_database(self.host_a) + self.assertFalse(policy.instances.exists()) + + def test_vm_that_returns_does_not_get_a_copys_backups(self): + target = BackupTarget.objects.create(name="t") + copy = Instance.objects.create(compute=self.host_b, name="vm", uuid=UUID) + theirs = Backup.objects.create(target=target, instance=copy, vm_uuid=UUID, vm_name="vm", compute_name="host-b", + state=Backup.READY) + copy.delete() # deleted in the panel: its backups stay, unlinked + Instance.objects.create(compute=self.host_a, name="vm", uuid=UUID, protected=True) + refresh_instance_database(self.host_a) + self.on(self.host_a, [("vm", UUID)]) + refresh_instance_database(self.host_a) + theirs.refresh_from_db() + self.assertIsNone(theirs.instance) + def test_an_ownerless_vm_leaves_a_row(self): Instance.objects.create(compute=self.host_a, name="vm", uuid=UUID) refresh_instance_database(self.host_a) - self.assertEqual(self.rows(), [("-", "host-a", f"VM vm ({UUID}): left the panel (no owners or tags)")]) + self.assertEqual(self.rows(), [("-", "host-a", f"VM vm ({UUID}): left the panel (nothing to keep)")]) def test_move_seen_on_the_new_host_first(self): self.owned_vm(self.host_a) @@ -165,7 +209,7 @@ class OwnershipTestCase(TestCase): self.assertEqual((tombstone.owners[0]["user"], tombstone.host), (self.owner.id, "host-a")) self.assertEqual(self.rows(), [ ("cd-admin", "-", "Login"), - ("-", "host-a", f"VM vm ({UUID}): owners and tags kept on the Removed VMs page"), + ("-", "host-a", f"VM vm ({UUID}): kept on the Removed VMs page"), ("cd-admin", "host-a", "Compute host-a (host-a.example): delete"), ]) diff --git a/computes/utils.py b/computes/utils.py index 8da217df..c09345a8 100644 --- a/computes/utils.py +++ b/computes/utils.py @@ -12,7 +12,7 @@ from instances.models import Instance, InstanceTombstone from logs.audit import write from operations import claims from operations.models import Claim -from vmbackups.models import Backup, BackupRun +from vmbackups.models import Backup, BackupPolicy, BackupRun logger = logging.getLogger(__name__) @@ -134,13 +134,16 @@ def _bury(inst): {"user": ui.user_id, "is_change": ui.is_change, "is_delete": ui.is_delete, "is_vnc": ui.is_vnc} for ui in UserInstance.objects.filter(instance=inst) ] - tags = list(inst.tags.values_list("name", flat=True)) - if owners or inst.is_template or tags: - InstanceTombstone.objects.create(uuid=inst.uuid, name=inst.name, host=inst.compute.name, - is_template=inst.is_template, owners=owners, tags=tags) - _log(inst, "owners and tags kept on the Removed VMs page") + tombstone = InstanceTombstone(uuid=inst.uuid, name=inst.name, host=inst.compute.name, is_template=inst.is_template, + protected=inst.protected, owners=owners, + tags=list(inst.tags.values_list("name", flat=True)), + policies=list(inst.backup_policies.values_list("pk", flat=True)), + backups=list(inst.backups.values_list("pk", flat=True))) + if tombstone.keeps_anything(): + tombstone.save() + _log(inst, "kept on the Removed VMs page") else: - _log(inst, "left the panel (no owners or tags)") + _log(inst, "left the panel (nothing to keep)") def _restore(inst): @@ -158,11 +161,13 @@ def _restore(inst): is_vnc=owner["is_vnc"], ) inst.tags.set(Tag.objects.filter(name__in=tombstone.tags)) - if tombstone.is_template: - inst.is_template = True - inst.save(update_fields=["is_template"]) + # not a schedule that chooses its VMs by compute or tag since: it chooses this one, or not, by itself + inst.backup_policies.set(BackupPolicy.objects.filter(pk__in=tombstone.policies, compute=None, tag=None)) + Backup.objects.filter(pk__in=tombstone.backups, instance__isnull=True).update(instance=inst) + inst.is_template, inst.protected = tombstone.is_template, tombstone.protected + inst.save(update_fields=["is_template", "protected"]) InstanceTombstone.objects.filter(uuid=inst.uuid).delete() - _log(inst, "owners and tags restored") + _log(inst, "restored from the Removed VMs page") def _host_domains(compute): diff --git a/instances/migrations/0020_tombstone_keeps.py b/instances/migrations/0020_tombstone_keeps.py new file mode 100644 index 00000000..0eede112 --- /dev/null +++ b/instances/migrations/0020_tombstone_keeps.py @@ -0,0 +1,28 @@ +# Generated by Django 5.2.18 on 2026-11-20 04:58 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('instances', '0019_protected'), + ] + + operations = [ + migrations.AddField( + model_name='instancetombstone', + name='backups', + field=models.JSONField(default=list), + ), + migrations.AddField( + model_name='instancetombstone', + name='policies', + field=models.JSONField(default=list), + ), + migrations.AddField( + model_name='instancetombstone', + name='protected', + field=models.BooleanField(default=False), + ), + ] diff --git a/instances/models.py b/instances/models.py index 47626316..6c75444d 100644 --- a/instances/models.py +++ b/instances/models.py @@ -410,7 +410,7 @@ class Instance(models.Model): class InstanceTombstone(models.Model): - """Ownership and tags of a VM that disappeared from its compute. + """Ownership, tags, protection, schedules and backups of a VM that disappeared from its compute. Kept for INSTANCE_OWNERSHIP_RETENTION_DAYS so that they come back when the same UUID shows up again, on this or another compute. @@ -420,13 +420,19 @@ class InstanceTombstone(models.Model): name = models.CharField(max_length=255) host = models.CharField(max_length=64, blank=True) # the compute's name: the compute may be deleted is_template = models.BooleanField(default=False) + protected = models.BooleanField(default=False) owners = models.JSONField(default=list) # [{"user": id, "is_change": .., "is_delete": .., "is_vnc": ..}] tags = models.JSONField(default=list) # the names: a tag deleted meanwhile is not given back + policies = models.JSONField(default=list) # the ids of the schedules that chose it: one deleted is not + backups = models.JSONField(default=list) # the ids of its backups: not a copy's under the same UUID removed = models.DateTimeField(auto_now_add=True) def __str__(self): return "%s (%s)" % (self.name, self.uuid) + def keeps_anything(self): + return bool(self.owners or self.is_template or self.protected or self.tags or self.policies or self.backups) + class PermissionSet(models.Model): """ diff --git a/instances/tests/test_protected.py b/instances/tests/test_protected.py index 443c79b3..d3e5b6c0 100644 --- a/instances/tests/test_protected.py +++ b/instances/tests/test_protected.py @@ -1,5 +1,7 @@ """A protected VM: only a superuser turns its protection on or off; while on, the VM is not deleted nor restored over (refusals in test_destroy and vmbackups.tests.test_restore_over).""" +from unittest.mock import patch + from django.contrib.auth import get_user_model from django.test import TestCase from django.urls import reverse @@ -50,6 +52,18 @@ class ProtectedTestCase(TestCase): self.client.post(reverse("instances:set_protected", args=[self.instance.id]), {"protected": "True"}) self.assertFalse(Instance.objects.get(pk=self.instance.pk).protected) + def test_not_changed_when_the_vm_left_its_host_meanwhile(self): + # its record may be kept, unprotected, for the Removed VMs page: no success is told + # the first check is the claim's (serialize_instance_mutation); the VM goes after it + with patch("instances.views._moved_meanwhile", side_effect=[False, True]), \ + patch("instances.views.lock_ownership") as lock: + response = self.client.post(reverse("instances:set_protected", args=[self.instance.id]), + {"protected": "True"}, HTTP_X_REQUESTED_WITH="XMLHttpRequest") + lock.assert_called_once() + self.assertEqual(response.status_code, 409) + self.assertFalse(Instance.objects.get(pk=self.instance.pk).protected) + self.assertFalse(Logs.objects.filter(instance="pe-vm").exists()) + def test_the_destroy_page_offers_no_form(self): Instance.objects.filter(pk=self.instance.pk).update(protected=True) page = self.client.get(reverse("instances:destroy", args=[self.instance.id])) diff --git a/instances/views.py b/instances/views.py index 12b1e91d..ec73d2fe 100755 --- a/instances/views.py +++ b/instances/views.py @@ -2550,9 +2550,12 @@ def set_protected(request, pk): """Turns a VM's protection against deletion and a restore over it on or off.""" instance = get_instance(request.user, pk) protected = bool(request.POST.get("protected")) - with audit_vm(request, instance, "protect" if protected else "unprotect"): - Instance.objects.filter(pk=instance.pk).update(protected=protected) - return _back(request, pk, "options") + with audit_vm(request, instance, "protect" if protected else "unprotect") as entry, transaction.atomic(): + lock_ownership() # not while the VM's protection is kept or given back (computes.utils.forget) + entry.skip = moved = _moved_meanwhile(pk, instance) # its host's list may have dropped it meanwhile + if not moved: + Instance.objects.filter(pk=instance.pk).update(protected=protected) + return _moved(request, pk) if moved else _back(request, pk, "options") def keyfile_value(value): diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo index 0e11b447..3b24ff4b 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 236951c8..3d68cb58 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-19 19:29+0000\n" +"POT-Creation-Date: 2026-11-20 05:04+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" @@ -470,7 +470,7 @@ msgstr "%(name)s API anahtarı için işlemler" #: accounts/templates/ssh_key_list.html:13 #: admin/templates/admin/group_list.html:44 #: admin/templates/admin/tag_list.html:38 -#: admin/templates/admin/tombstone_list.html:43 +#: admin/templates/admin/tombstone_list.html:44 #: admin/templates/admin/user_list.html:74 #: admin/templates/admin/user_list.html:76 #: instances/templates/create_flavors.html:11 @@ -703,7 +703,7 @@ msgstr "Sanal makineleri yedekleyebilir" msgid "Can clone instances" msgstr "Sanal makineleri klonlayabilir" -#: admin/forms.py:26 instances/models.py:440 +#: admin/forms.py:26 instances/models.py:446 msgid "Can access console without password" msgstr "Parolasız konsol erişimi yapabilir" @@ -1093,11 +1093,13 @@ msgstr "Kaldırılan Sanal Makineler" #: admin/templates/admin/tombstone_list.html:11 msgid "" -"VMs that vanished from their compute. Their owners and tags come back if the " -"same UUID shows up again before the record expires." +"VMs that vanished from their compute. Their owners, tags, protection and " +"schedules come back if the same UUID shows up again before the record " +"expires; their backups come back with them." msgstr "" "Sunucularından kaybolan sanal makineler. Kayıt süresi dolmadan aynı UUID " -"yeniden görünürse sahipleri ve etiketleri geri gelir." +"yeniden görünürse sahipleri, etiketleri, korumaları ve zamanlamaları geri " +"gelir; yedekleri de onlarla birlikte geri gelir." #: admin/templates/admin/tombstone_list.html:14 msgid "No removed VMs" @@ -1112,23 +1114,28 @@ msgstr "Kaldırılan sanal makinelerde ara" msgid "Template" msgstr "Şablon" -#: admin/templates/admin/tombstone_list.html:34 +#: admin/templates/admin/tombstone_list.html:29 +#: instances/templates/instances/settings_tab.html:926 +msgid "Protected" +msgstr "Korumalı" + +#: admin/templates/admin/tombstone_list.html:35 msgid "Left" msgstr "Ayrıldığı sunucu" -#: admin/templates/admin/tombstone_list.html:35 instances/views.py:244 +#: admin/templates/admin/tombstone_list.html:36 instances/views.py:244 msgid "Owners" msgstr "Sahipler" -#: admin/templates/admin/tombstone_list.html:38 +#: admin/templates/admin/tombstone_list.html:39 msgid "Removed" msgstr "Kaldırılma" -#: admin/templates/admin/tombstone_list.html:39 +#: admin/templates/admin/tombstone_list.html:40 msgid "expires" msgstr "sona erer" -#: admin/templates/admin/tombstone_list.html:50 +#: admin/templates/admin/tombstone_list.html:51 msgid "No removed VM matches the search." msgstr "Aramayla eşleşen kaldırılmış sanal makine yok." @@ -1333,9 +1340,12 @@ msgid "Removed VM %(name)s deleted" msgstr "Kaldırılan sanal makine %(name)s silindi" #: admin/views.py:465 -msgid "Its owners and tags no longer come back if its UUID shows up again." +msgid "" +"Its owners, tags, protection and schedules no longer come back if its UUID " +"shows up again, nor are its backups linked to it again." msgstr "" -"UUID'si yeniden görünse bile sahipleri ve etiketleri artık geri gelmez." +"UUID'si yeniden görünse bile sahipleri, etiketleri, koruması ve zamanlamaları" +" artık geri gelmez, yedekleri de ona yeniden bağlanmaz." #: admin/views.py:512 #, python-format @@ -3187,21 +3197,21 @@ msgstr "" "Sunucudaki /etc/default/webvirt-gstfsd içindeki GSTFSD_KEY değerinin 64 " "onaltılık karakterini girin" -#: computes/views.py:168 +#: computes/views.py:188 #, python-format msgid "The host did not answer within %(seconds)s seconds" msgstr "Sunucu %(seconds)s saniye içinde yanıt vermedi" -#: computes/views.py:396 +#: computes/views.py:417 msgid "No other host has room for it" msgstr "Başka hiçbir sunucuda ona yer yok" -#: computes/views.py:475 +#: computes/views.py:496 #, 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:548 +#: computes/views.py:569 #, python-format msgid "" "Its VMs keep running on the host and leave the panel; their owners are kept " @@ -3882,7 +3892,7 @@ msgstr "" msgid "Create VM" msgstr "Sanal makine oluştur" -#: instances/jobs.py:936 instances/jobs.py:983 instances/views.py:2647 +#: instances/jobs.py:936 instances/jobs.py:983 instances/views.py:2650 msgid "A virtual machine with this name already exists" msgstr "Bu isimde bir sanal makine mevcut" @@ -4246,7 +4256,7 @@ msgid "Disk source" msgstr "Disk kaynağı" #: instances/templates/add_instance_volume.html:21 -#: instances/templates/create_instance_w2.html:134 instances/views.py:2677 +#: instances/templates/create_instance_w2.html:134 instances/views.py:2680 msgid "New disk" msgstr "Yeni disk" @@ -4280,7 +4290,7 @@ msgstr "Harf, rakam, nokta, tire ve alt çizgi." #: instances/templates/add_instance_volume.html:44 #: instances/templates/instances/settings_tab.html:851 -#: vmbackups/templates/vmbackups/index.html:51 +#: vmbackups/templates/vmbackups/index.html:52 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "Size" msgstr "Boyut" @@ -4437,7 +4447,7 @@ msgstr "Adres" #: instances/templates/allinstances.html:106 instances/views.py:243 #: interfaces/templates/interface.html:153 networks/templates/network.html:202 #: vmbackups/templates/vmbackups/index.html:18 -#: vmbackups/templates/vmbackups/index.html:49 +#: vmbackups/templates/vmbackups/index.html:50 #: vmbackups/templates/vmbackups/policy.html:30 msgid "VM" msgstr "VM" @@ -4643,7 +4653,7 @@ msgstr "Özel CPU modelleri" msgid "Size (GiB)" msgstr "Boyut (GiB)" -#: instances/templates/create_instance_w2.html:161 instances/views.py:2678 +#: instances/templates/create_instance_w2.html:161 instances/views.py:2681 msgid "Existing volumes" msgstr "Mevcut birimler" @@ -4680,7 +4690,7 @@ msgstr "Aygıt" msgid "Remove" msgstr "Kaldır" -#: instances/templates/create_instance_w2.html:194 instances/views.py:2679 +#: instances/templates/create_instance_w2.html:194 instances/views.py:2682 msgid "Clone from template" msgstr "Şablondan klonla" @@ -6491,10 +6501,6 @@ msgstr "" msgid "Only administrators and staff can change this." msgstr "Bunu yalnızca yöneticiler ve personel değiştirebilir." -#: instances/templates/instances/settings_tab.html:926 -msgid "Protected" -msgstr "Korumalı" - #: instances/templates/instances/settings_tab.html:928 msgid "A protected VM is not deleted and no backup is restored over it." msgstr "Korumalı bir VM silinmez ve üzerine yedek geri yüklenmez." @@ -6954,7 +6960,7 @@ msgstr "Çok fazla arama hâlâ çalışıyor; birazdan yeniden deneyin." #: operations/templates/operations/jobs.html:62 #: storages/templates/storage.html:91 #: vmbackups/templates/vmbackups/index.html:29 -#: vmbackups/templates/vmbackups/index.html:51 +#: vmbackups/templates/vmbackups/index.html:52 #: vmbackups/templates/vmbackups/policies.html:18 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "State" @@ -7357,7 +7363,7 @@ msgstr "Ön yükleme sırası başarıyla değiştirildi." msgid "The XML is empty" msgstr "XML boş" -#: instances/views.py:1965 instances/views.py:2659 +#: instances/views.py:1965 instances/views.py:2662 #, python-format msgid "The XML is not well-formed: %(error)s" msgstr "XML düzgün biçimlendirilmemiş: %(error)s" @@ -7513,28 +7519,28 @@ msgstr "Şablon olup olmadığını değiştirmek için sanal makineyi kapatın. msgid "%(quota)s: '%(instance_name)s' stays a template." msgstr "%(quota)s: '%(instance_name)s' şablon olarak kalıyor." -#: instances/views.py:2645 +#: instances/views.py:2648 msgid "The XML has no name" msgstr "XML'de ad yok" -#: instances/views.py:2663 webvirtcloud/middleware.py:157 +#: instances/views.py:2666 webvirtcloud/middleware.py:157 #, python-format msgid "libvirt Error - %(exception)s" msgstr "libvirt Hatası - %(exception)s" -#: instances/views.py:2677 +#: instances/views.py:2680 msgid "An empty disk of the size you set" msgstr "Belirlediğiniz boyutta boş bir disk" -#: instances/views.py:2678 +#: instances/views.py:2681 msgid "Volumes already in a pool" msgstr "Bir havuzda zaten bulunan birimler" -#: instances/views.py:2679 +#: instances/views.py:2682 msgid "A copy of a template volume" msgstr "Bir şablon biriminin kopyası" -#: instances/views.py:2769 +#: instances/views.py:2772 msgid "" "This host has no running storage pool for the VM's disks: add or start one on" " its Storage page." @@ -7542,29 +7548,29 @@ msgstr "" "Bu sunucuda sanal makinenin diskleri için çalışan bir depolama havuzu yok: " "Depolama sayfasından bir tane ekleyin ya da başlatın." -#: instances/views.py:2771 +#: instances/views.py:2774 msgid "This host has no network for the VM: add one on its Networks page." msgstr "" "Bu sunucuda sanal makine için ağ yok: Ağlar sayfasından bir tane ekleyin." -#: instances/views.py:2803 +#: instances/views.py:2806 #, python-format msgid "The machine type is q35, not %(machine)s: UEFI Secure Boot needs it" msgstr "Makine türü %(machine)s değil q35: UEFI Secure Boot bunu gerektiriyor" -#: instances/views.py:2832 +#: instances/views.py:2835 msgid "Flavor Created" msgstr "Flavor Oluşturuldu" -#: instances/views.py:2840 +#: instances/views.py:2843 msgid "Create Flavor" msgstr "Kullanıcı Oluştur" -#: instances/views.py:2852 +#: instances/views.py:2855 msgid "Flavor Deleted" msgstr "Flavor Silindi" -#: instances/views.py:2858 +#: instances/views.py:2861 msgid "Only the size template goes; VMs made from it keep their size." msgstr "" "Yalnızca boyut şablonu silinir; ondan oluşturulan sanal makineler boyutlarını" @@ -8621,7 +8627,7 @@ msgstr "Filtre oluştur" #: nwfilters/templates/nwfilter.html:15 nwfilters/templates/nwfilter.html:54 #: operations/templates/operations/jobs.html:46 #: vmbackups/templates/vmbackups/index.html:16 -#: vmbackups/templates/vmbackups/index.html:40 +#: vmbackups/templates/vmbackups/index.html:41 msgid "Filter" msgstr "Filtre" @@ -10735,7 +10741,7 @@ msgid "VM name" msgstr "Sanal makine adı" #: vmbackups/templates/vmbackups/index.html:22 -#: vmbackups/templates/vmbackups/index.html:58 +#: vmbackups/templates/vmbackups/index.html:59 #: vmbackups/templates/vmbackups/policies.html:17 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "Target" @@ -10760,29 +10766,34 @@ msgstr "Oluşturuluyor" msgid "Deleting" msgstr "Siliniyor" -#: vmbackups/templates/vmbackups/index.html:49 +#: vmbackups/templates/vmbackups/index.html:37 +#: vmbackups/templates/vmbackups/state.html:1 +msgid "Damaged" +msgstr "Hasarlı" + +#: vmbackups/templates/vmbackups/index.html:50 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "Time" msgstr "Zaman" -#: vmbackups/templates/vmbackups/index.html:50 +#: vmbackups/templates/vmbackups/index.html:51 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "Consistency" msgstr "Tutarlılık" -#: vmbackups/templates/vmbackups/index.html:61 +#: vmbackups/templates/vmbackups/index.html:62 msgid "removed" msgstr "kaldırıldı" -#: vmbackups/templates/vmbackups/index.html:62 +#: vmbackups/templates/vmbackups/index.html:63 msgid "Schedule" msgstr "Zamanlama" -#: vmbackups/templates/vmbackups/index.html:77 +#: vmbackups/templates/vmbackups/index.html:78 msgid "No backup matches the filter." msgstr "Süzgece uyan yedek yok." -#: vmbackups/templates/vmbackups/index.html:79 +#: vmbackups/templates/vmbackups/index.html:80 msgid "No backup yet. Back a VM up from its Backups tab." msgstr "Henüz yedek yok. Bir sanal makineyi Yedekler sekmesinden yedekleyin." @@ -10986,10 +10997,6 @@ msgstr "" msgid "Its deletion did not end; delete it again" msgstr "Silinmesi tamamlanmadı; yeniden silin" -#: vmbackups/templates/vmbackups/state.html:1 -msgid "Damaged" -msgstr "Hasarlı" - #: vmbackups/templates/vmbackups/state.html:1 #, python-format msgid "Verified %(time)s" @@ -11189,17 +11196,17 @@ msgstr "%(target)s hedefini artık yalnızca süper kullanıcılar kullanır." msgid "Choose a backup target" msgstr "Bir yedek hedefi seçin" -#: vmbackups/views.py:230 +#: vmbackups/views.py:232 #, python-format msgid "The backup of %(vm)s taken %(time)s is being deleted." msgstr "%(vm)s VM'inin %(time)s tarihli yedeği siliniyor." -#: vmbackups/views.py:345 vmbackups/views.py:366 +#: vmbackups/views.py:347 vmbackups/views.py:368 #, python-format msgid "Backup schedule %(name)s is saved." msgstr "%(name)s yedekleme zamanlaması kaydedildi." -#: vmbackups/views.py:357 +#: vmbackups/views.py:359 #, python-format msgid "Backup schedule %(name)s is deleted; its backups stay." msgstr "%(name)s yedekleme zamanlaması silindi; yedekleri duruyor." diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index bd729ba4..6b6cd13d 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 bcbeb7de..96cfadf9 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-19 19:29+0000\n" +"POT-Creation-Date: 2026-11-20 05:04+0000\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -463,7 +463,7 @@ msgstr "API 令牌 %(name)s 的操作" #: accounts/templates/ssh_key_list.html:13 #: admin/templates/admin/group_list.html:44 #: admin/templates/admin/tag_list.html:38 -#: admin/templates/admin/tombstone_list.html:43 +#: admin/templates/admin/tombstone_list.html:44 #: admin/templates/admin/user_list.html:74 #: admin/templates/admin/user_list.html:76 #: instances/templates/create_flavors.html:11 @@ -687,7 +687,7 @@ msgstr "可以备份虚拟机" msgid "Can clone instances" msgstr "可克隆虚拟机" -#: admin/forms.py:26 instances/models.py:440 +#: admin/forms.py:26 instances/models.py:446 msgid "Can access console without password" msgstr "可无密码访问控制台" @@ -1062,9 +1062,10 @@ msgstr "已移除的虚拟机" #: admin/templates/admin/tombstone_list.html:11 msgid "" -"VMs that vanished from their compute. Their owners and tags come back if the " -"same UUID shows up again before the record expires." -msgstr "从其计算节点上消失的虚拟机。若在记录过期前同一 UUID 再次出现,其所有者和标签将恢复。" +"VMs that vanished from their compute. Their owners, tags, protection and " +"schedules come back if the same UUID shows up again before the record " +"expires; their backups come back with them." +msgstr "从其计算节点上消失的虚拟机。若在记录过期前同一 UUID 再次出现,其所有者、标签、保护和计划将恢复;其备份也随之恢复。" #: admin/templates/admin/tombstone_list.html:14 msgid "No removed VMs" @@ -1079,23 +1080,28 @@ msgstr "搜索已移除的虚拟机" msgid "Template" msgstr "模板" -#: admin/templates/admin/tombstone_list.html:34 +#: admin/templates/admin/tombstone_list.html:29 +#: instances/templates/instances/settings_tab.html:926 +msgid "Protected" +msgstr "受保护" + +#: admin/templates/admin/tombstone_list.html:35 msgid "Left" msgstr "已离开" -#: admin/templates/admin/tombstone_list.html:35 instances/views.py:244 +#: admin/templates/admin/tombstone_list.html:36 instances/views.py:244 msgid "Owners" msgstr "所有者" -#: admin/templates/admin/tombstone_list.html:38 +#: admin/templates/admin/tombstone_list.html:39 msgid "Removed" msgstr "移除时间" -#: admin/templates/admin/tombstone_list.html:39 +#: admin/templates/admin/tombstone_list.html:40 msgid "expires" msgstr "过期" -#: admin/templates/admin/tombstone_list.html:50 +#: admin/templates/admin/tombstone_list.html:51 msgid "No removed VM matches the search." msgstr "没有与搜索匹配的已移除虚拟机。" @@ -1292,8 +1298,10 @@ msgid "Removed VM %(name)s deleted" msgstr "已删除已移除的虚拟机 %(name)s" #: admin/views.py:465 -msgid "Its owners and tags no longer come back if its UUID shows up again." -msgstr "若其 UUID 再次出现,其所有者和标签将不再恢复。" +msgid "" +"Its owners, tags, protection and schedules no longer come back if its UUID " +"shows up again, nor are its backups linked to it again." +msgstr "若其 UUID 再次出现,其所有者、标签、保护和计划将不再恢复,其备份也不会重新关联到它。" #: admin/views.py:512 #, python-format @@ -3027,21 +3035,21 @@ msgid "" "/etc/default/webvirt-gstfsd" msgstr "请输入主机 /etc/default/webvirt-gstfsd 中 GSTFSD_KEY 的 64 个十六进制字符" -#: computes/views.py:168 +#: computes/views.py:188 #, python-format msgid "The host did not answer within %(seconds)s seconds" msgstr "主机未在 %(seconds)s 秒内响应" -#: computes/views.py:396 +#: computes/views.py:417 msgid "No other host has room for it" msgstr "没有其他主机能容纳它" -#: computes/views.py:475 +#: computes/views.py:496 #, python-format msgid "The host was saved, but the panel cannot connect to it: %(error)s" msgstr "主机已保存,但面板无法连接到它:%(error)s" -#: computes/views.py:548 +#: computes/views.py:569 #, python-format msgid "" "Its VMs keep running on the host and leave the panel; their owners are kept " @@ -3664,7 +3672,7 @@ msgstr "磁盘缓存 %(cache)s 与设置中的原生 (native) 磁盘 I/O 不兼 msgid "Create VM" msgstr "创建虚拟机" -#: instances/jobs.py:936 instances/jobs.py:983 instances/views.py:2647 +#: instances/jobs.py:936 instances/jobs.py:983 instances/views.py:2650 msgid "A virtual machine with this name already exists" msgstr "同名虚拟机已存在" @@ -4016,7 +4024,7 @@ msgid "Disk source" msgstr "磁盘来源" #: instances/templates/add_instance_volume.html:21 -#: instances/templates/create_instance_w2.html:134 instances/views.py:2677 +#: instances/templates/create_instance_w2.html:134 instances/views.py:2680 msgid "New disk" msgstr "新磁盘" @@ -4050,7 +4058,7 @@ msgstr "字母、数字、点、短横线和下划线。" #: instances/templates/add_instance_volume.html:44 #: instances/templates/instances/settings_tab.html:851 -#: vmbackups/templates/vmbackups/index.html:51 +#: vmbackups/templates/vmbackups/index.html:52 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "Size" msgstr "大小" @@ -4202,7 +4210,7 @@ msgstr "地址" #: instances/templates/allinstances.html:106 instances/views.py:243 #: interfaces/templates/interface.html:153 networks/templates/network.html:202 #: vmbackups/templates/vmbackups/index.html:18 -#: vmbackups/templates/vmbackups/index.html:49 +#: vmbackups/templates/vmbackups/index.html:50 #: vmbackups/templates/vmbackups/policy.html:30 msgid "VM" msgstr "虚拟机" @@ -4401,7 +4409,7 @@ msgstr "自定义 CPU 型号" msgid "Size (GiB)" msgstr "大小(GiB)" -#: instances/templates/create_instance_w2.html:161 instances/views.py:2678 +#: instances/templates/create_instance_w2.html:161 instances/views.py:2681 msgid "Existing volumes" msgstr "已有卷" @@ -4438,7 +4446,7 @@ msgstr "设备" msgid "Remove" msgstr "移除" -#: instances/templates/create_instance_w2.html:194 instances/views.py:2679 +#: instances/templates/create_instance_w2.html:194 instances/views.py:2682 msgid "Clone from template" msgstr "从模板克隆" @@ -6124,10 +6132,6 @@ msgstr "模板是用于克隆的虚拟机:不计入配额,且无法启动。 msgid "Only administrators and staff can change this." msgstr "只有管理员和工作人员可以更改此项。" -#: instances/templates/instances/settings_tab.html:926 -msgid "Protected" -msgstr "受保护" - #: instances/templates/instances/settings_tab.html:928 msgid "A protected VM is not deleted and no backup is restored over it." msgstr "受保护的虚拟机不会被删除,也不会有备份还原到其上。" @@ -6539,7 +6543,7 @@ msgstr "仍在运行的搜索过多;请稍后再试。" #: operations/templates/operations/jobs.html:62 #: storages/templates/storage.html:91 #: vmbackups/templates/vmbackups/index.html:29 -#: vmbackups/templates/vmbackups/index.html:51 +#: vmbackups/templates/vmbackups/index.html:52 #: vmbackups/templates/vmbackups/policies.html:18 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "State" @@ -6915,7 +6919,7 @@ msgstr "启动顺序已成功更改。" msgid "The XML is empty" msgstr "XML 为空" -#: instances/views.py:1965 instances/views.py:2659 +#: instances/views.py:1965 instances/views.py:2662 #, python-format msgid "The XML is not well-formed: %(error)s" msgstr "XML 格式不正确:%(error)s" @@ -7054,55 +7058,55 @@ msgstr "请关闭虚拟机以更改其是否为模板。" msgid "%(quota)s: '%(instance_name)s' stays a template." msgstr "%(quota)s:“%(instance_name)s”仍为模板。" -#: instances/views.py:2645 +#: instances/views.py:2648 msgid "The XML has no name" msgstr "XML 中没有名称" -#: instances/views.py:2663 webvirtcloud/middleware.py:157 +#: instances/views.py:2666 webvirtcloud/middleware.py:157 #, python-format msgid "libvirt Error - %(exception)s" msgstr "libvirt 错误 - %(exception)s" -#: instances/views.py:2677 +#: instances/views.py:2680 msgid "An empty disk of the size you set" msgstr "按设定大小创建的空磁盘" -#: instances/views.py:2678 +#: instances/views.py:2681 msgid "Volumes already in a pool" msgstr "存储池中已有的卷" -#: instances/views.py:2679 +#: instances/views.py:2682 msgid "A copy of a template volume" msgstr "模板卷的副本" -#: instances/views.py:2769 +#: instances/views.py:2772 msgid "" "This host has no running storage pool for the VM's disks: add or start one on" " its Storage page." msgstr "此主机没有可用于虚拟机磁盘的运行中存储池:请在其“存储”页面添加或启动一个。" -#: instances/views.py:2771 +#: instances/views.py:2774 msgid "This host has no network for the VM: add one on its Networks page." msgstr "此主机没有可供虚拟机使用的网络:请在其“网络”页面添加一个。" -#: instances/views.py:2803 +#: instances/views.py:2806 #, python-format msgid "The machine type is q35, not %(machine)s: UEFI Secure Boot needs it" msgstr "机器类型为 q35,而不是 %(machine)s:UEFI 安全启动需要它" -#: instances/views.py:2832 +#: instances/views.py:2835 msgid "Flavor Created" msgstr "规格已创建" -#: instances/views.py:2840 +#: instances/views.py:2843 msgid "Create Flavor" msgstr "创建规格" -#: instances/views.py:2852 +#: instances/views.py:2855 msgid "Flavor Deleted" msgstr "规格已删除" -#: instances/views.py:2858 +#: instances/views.py:2861 msgid "Only the size template goes; VMs made from it keep their size." msgstr "仅删除此规格;由它创建的虚拟机保持其大小。" @@ -8101,7 +8105,7 @@ msgstr "创建过滤器" #: nwfilters/templates/nwfilter.html:15 nwfilters/templates/nwfilter.html:54 #: operations/templates/operations/jobs.html:46 #: vmbackups/templates/vmbackups/index.html:16 -#: vmbackups/templates/vmbackups/index.html:40 +#: vmbackups/templates/vmbackups/index.html:41 msgid "Filter" msgstr "过滤器" @@ -10100,7 +10104,7 @@ msgid "VM name" msgstr "虚拟机名称" #: vmbackups/templates/vmbackups/index.html:22 -#: vmbackups/templates/vmbackups/index.html:58 +#: vmbackups/templates/vmbackups/index.html:59 #: vmbackups/templates/vmbackups/policies.html:17 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "Target" @@ -10125,29 +10129,34 @@ msgstr "正在创建" msgid "Deleting" msgstr "正在删除" -#: vmbackups/templates/vmbackups/index.html:49 +#: vmbackups/templates/vmbackups/index.html:37 +#: vmbackups/templates/vmbackups/state.html:1 +msgid "Damaged" +msgstr "已损坏" + +#: vmbackups/templates/vmbackups/index.html:50 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "Time" msgstr "时间" -#: vmbackups/templates/vmbackups/index.html:50 +#: vmbackups/templates/vmbackups/index.html:51 #: vmbackups/templates/vmbackups/vm_tab.html:42 msgid "Consistency" msgstr "一致性" -#: vmbackups/templates/vmbackups/index.html:61 +#: vmbackups/templates/vmbackups/index.html:62 msgid "removed" msgstr "已移除" -#: vmbackups/templates/vmbackups/index.html:62 +#: vmbackups/templates/vmbackups/index.html:63 msgid "Schedule" msgstr "计划" -#: vmbackups/templates/vmbackups/index.html:77 +#: vmbackups/templates/vmbackups/index.html:78 msgid "No backup matches the filter." msgstr "没有符合筛选条件的备份。" -#: vmbackups/templates/vmbackups/index.html:79 +#: vmbackups/templates/vmbackups/index.html:80 msgid "No backup yet. Back a VM up from its Backups tab." msgstr "还没有备份。请在虚拟机的备份选项卡中备份虚拟机。" @@ -10338,10 +10347,6 @@ msgstr "将备份恢复到 %(vm)s 上?备份之后虚拟机写入的内容将 msgid "Its deletion did not end; delete it again" msgstr "其删除未完成;请再次删除" -#: vmbackups/templates/vmbackups/state.html:1 -msgid "Damaged" -msgstr "已损坏" - #: vmbackups/templates/vmbackups/state.html:1 #, python-format msgid "Verified %(time)s" @@ -10519,17 +10524,17 @@ msgstr "现在仅超级用户使用 %(target)s。" msgid "Choose a backup target" msgstr "请选择备份目标" -#: vmbackups/views.py:230 +#: vmbackups/views.py:232 #, python-format msgid "The backup of %(vm)s taken %(time)s is being deleted." msgstr "正在删除 %(vm)s 于 %(time)s 的备份。" -#: vmbackups/views.py:345 vmbackups/views.py:366 +#: vmbackups/views.py:347 vmbackups/views.py:368 #, python-format msgid "Backup schedule %(name)s is saved." msgstr "备份计划 %(name)s 已保存。" -#: vmbackups/views.py:357 +#: vmbackups/views.py:359 #, python-format msgid "Backup schedule %(name)s is deleted; its backups stay." msgstr "备份计划 %(name)s 已删除;其备份保留。"