1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-03 17:36:05 +00:00

fix: a backup's files say so on the pool page; Removed VMs names schedules and backups

On a backup target's pool every backup file was "Not used on this host" and
listed with the unused volumes, though its deletion there is refused: it is
deleted with its backup. The column now says "Backup of <VM>" and counts it
as in use. A VM kept on the Removed VMs page for its schedules or backups
alone showed no owner and no reason; its row now names its schedules and
counts its backups.
This commit is contained in:
catborise 2026-11-20 08:50:29 +03:00
parent aeef837afa
commit 981ff7b294
11 changed files with 227 additions and 135 deletions

View file

@ -35,6 +35,12 @@
{% trans "Left" %} <span class="fw-semibold">{{ tombstone.host }}</span> {% trans "Left" %} <span class="fw-semibold">{{ tombstone.host }}</span>
<span class="text-body-secondary">· {% trans "Owners" %}:</span> {{ tombstone.owner_names|join:", "|default:"–" }} <span class="text-body-secondary">· {% trans "Owners" %}:</span> {{ tombstone.owner_names|join:", "|default:"–" }}
</div> </div>
{% if tombstone.policy_names or tombstone.backup_count %}
<div class="mt-1">
{% if tombstone.policy_names %}<span class="text-body-secondary">{% trans "Schedules" %}:</span> {{ tombstone.policy_names|join:", " }}{% endif %}
{% if tombstone.backup_count %}{% if tombstone.policy_names %} · {% endif %}{% blocktrans count counter=tombstone.backup_count %}{{ counter }} backup{% plural %}{{ counter }} backups{% endblocktrans %}{% endif %}
</div>
{% endif %}
<div class="text-body-secondary mt-1"> <div class="text-body-secondary mt-1">
{% trans "Removed" %} <span class="text-nowrap">{{ tombstone.removed|date:"Y-m-d H:i" }}</span> {% trans "Removed" %} <span class="text-nowrap">{{ tombstone.removed|date:"Y-m-d H:i" }}</span>
· {% trans "expires" %} <span class="text-nowrap">{{ tombstone.expires|date:"Y-m-d H:i" }}</span> · {% trans "expires" %} <span class="text-nowrap">{{ tombstone.expires|date:"Y-m-d H:i" }}</span>

View file

@ -1,6 +1,6 @@
"""Superusers list the ownership kept for VMs that vanished and can remove it.""" """Superusers list the ownership kept for VMs that vanished and can remove it."""
from datetime import timedelta from datetime import time, timedelta
from django.contrib.auth.models import User from django.contrib.auth.models import User
from django.test import TestCase, override_settings from django.test import TestCase, override_settings
@ -9,6 +9,9 @@ from django.utils import timezone
from instances.models import InstanceTombstone from instances.models import InstanceTombstone
from logs.models import Logs from logs.models import Logs
from lxml import html
from computes.models import Tag
from vmbackups.models import Backup, BackupPolicy, BackupTarget
UUID = "00000000-0000-4000-8000-000000000001" UUID = "00000000-0000-4000-8000-000000000001"
@ -50,6 +53,22 @@ class TombstoneTests(TestCase):
self.assertEqual(self.client.post(url).status_code, 403) self.assertEqual(self.client.post(url).status_code, 403)
self.assertTrue(InstanceTombstone.objects.exists()) self.assertTrue(InstanceTombstone.objects.exists())
def test_the_list_names_its_schedules_and_counts_its_backups(self):
# a VM kept for its backups or schedules alone has no owner to show; only what would come back is told
target = BackupTarget.objects.create(name="t")
chosen, by_tag = (BackupPolicy.objects.create(name=name, target=target, time=time(2), keep=1)
for name in ("nightly", "by-tag"))
BackupPolicy.objects.filter(pk=by_tag.pk).update(tag=Tag.objects.create(name="web"))
kept = [Backup.objects.create(target=target, vm_uuid=UUID, vm_name="ts-vm", compute_name="ts-host").pk
for _ in range(2)]
InstanceTombstone.objects.filter(pk=self.tombstone.pk).update(
owners=[], tags=[], policies=[chosen.pk, by_tag.pk, 999999], backups=[*kept, 999999])
page = html.fromstring(self.client.get(reverse("admin:tombstone_list")).content)
(row,) = page.xpath("//div[@data-search][contains(@data-search, 'ts-vm')]")
text = " ".join(row.text_content().split())
self.assertIn("Schedules: nightly · 2 backups", text)
self.assertNotIn("by-tag", text)
def test_a_get_only_asks_for_confirmation(self): def test_a_get_only_asks_for_confirmation(self):
response = self.client.get(reverse("admin:tombstone_delete", args=[self.tombstone.pk])) response = self.client.get(reverse("admin:tombstone_delete", args=[self.tombstone.pk]))
self.assertContains(response, "ts-vm") self.assertContains(response, "ts-vm")

View file

@ -27,6 +27,7 @@ from logs.models import Logs
from operations import claims from operations import claims
from operations.utils import busy_message from operations.utils import busy_message
from vrtManager import util from vrtManager import util
from vmbackups.models import Backup, BackupPolicy
from . import forms from . import forms
from .decorators import superuser_only from .decorators import superuser_only
@ -442,8 +443,15 @@ def tombstone_list(request):
ids = {owner["user"] for tombstone in tombstones for owner in tombstone.owners} ids = {owner["user"] for tombstone in tombstones for owner in tombstone.owners}
names = dict(User.objects.filter(id__in=ids).values_list("id", "username")) names = dict(User.objects.filter(id__in=ids).values_list("id", "username"))
retention = timedelta(days=getattr(settings, "INSTANCE_OWNERSHIP_RETENTION_DAYS", 30)) retention = timedelta(days=getattr(settings, "INSTANCE_OWNERSHIP_RETENTION_DAYS", 30))
# what would come back (computes.utils._restore): schedules that choose their VMs one by one, backups unlinked
policies = dict(BackupPolicy.objects.filter(pk__in={pk for t in tombstones for pk in t.policies}, compute=None,
tag=None).values_list("pk", "name"))
backups = set(Backup.objects.filter(pk__in={pk for t in tombstones for pk in t.backups}, instance=None)
.values_list("pk", flat=True))
for tombstone in tombstones: for tombstone in tombstones:
tombstone.owner_names = [names.get(owner["user"], _("deleted user")) for owner in tombstone.owners] tombstone.owner_names = [names.get(owner["user"], _("deleted user")) for owner in tombstone.owners]
tombstone.policy_names = sorted(policies[pk] for pk in tombstone.policies if pk in policies)
tombstone.backup_count = len(backups.intersection(tombstone.backups))
tombstone.expires = tombstone.removed + retention tombstone.expires = tombstone.removed + retention
return render(request, "admin/tombstone_list.html", {"tombstones": tombstones}) return render(request, "admin/tombstone_list.html", {"tombstones": tombstones})

Binary file not shown.

View file

@ -11,7 +11,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: PACKAGE VERSION\n" "Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-20 05:17+0000\n" "POT-Creation-Date: 2026-11-20 05:53+0000\n"
"PO-Revision-Date: 2020-11-04 12:00+0000\n" "PO-Revision-Date: 2020-11-04 12:00+0000\n"
"Last-Translator: catborise <muhammetalisag@gmail.com>, 2020\n" "Last-Translator: catborise <muhammetalisag@gmail.com>, 2020\n"
"Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n" "Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n"
@ -262,7 +262,7 @@ msgstr "Yalnızca güç ve konsol"
#: accounts/templates/account.html:81 computes/templates/computes/list.html:110 #: accounts/templates/account.html:81 computes/templates/computes/list.html:110
#: instances/templates/instance_actions.html:9 #: instances/templates/instance_actions.html:9
#: storages/templates/storage.html:166 #: storages/templates/storage.html:167
#, python-format #, python-format
msgid "Actions for %(name)s" msgid "Actions for %(name)s"
msgstr "%(name)s için işlemler" msgstr "%(name)s için işlemler"
@ -326,7 +326,7 @@ msgstr "Burada oturumunuz açık kalır; diğer oturumlarınız kapanır."
#: storages/templates/create_stg_block.html:183 #: storages/templates/create_stg_block.html:183
#: storages/templates/create_stg_vol_block.html:35 #: storages/templates/create_stg_vol_block.html:35
#: storages/templates/create_stg_vol_block.html:68 #: storages/templates/create_stg_vol_block.html:68
#: storages/templates/storage.html:228 templates/base.html:65 #: storages/templates/storage.html:229 templates/base.html:65
#: templates/common/confirm_delete.html:25 templates/common/form.html:27 #: templates/common/confirm_delete.html:25 templates/common/form.html:27
#: virtsecrets/templates/create_secret_block.html:48 #: virtsecrets/templates/create_secret_block.html:48
#: virtsecrets/templates/secrets.html:106 #: virtsecrets/templates/secrets.html:106
@ -470,7 +470,7 @@ msgstr "%(name)s API anahtarı için işlemler"
#: accounts/templates/ssh_key_list.html:13 #: accounts/templates/ssh_key_list.html:13
#: admin/templates/admin/group_list.html:44 #: admin/templates/admin/group_list.html:44
#: admin/templates/admin/tag_list.html:38 #: admin/templates/admin/tag_list.html:38
#: admin/templates/admin/tombstone_list.html:44 #: admin/templates/admin/tombstone_list.html:50
#: admin/templates/admin/user_list.html:74 #: admin/templates/admin/user_list.html:74
#: admin/templates/admin/user_list.html:76 #: admin/templates/admin/user_list.html:76
#: instances/templates/create_flavors.html:11 #: instances/templates/create_flavors.html:11
@ -478,7 +478,7 @@ msgstr "%(name)s API anahtarı için işlemler"
#: instances/templates/instances/settings_tab.html:315 #: instances/templates/instances/settings_tab.html:315
#: instances/templates/instances/snapshots_tab.html:103 #: instances/templates/instances/snapshots_tab.html:103
#: instances/templates/instances/snapshots_tab.html:117 #: instances/templates/instances/snapshots_tab.html:117
#: networks/templates/network.html:168 storages/templates/storage.html:179 #: networks/templates/network.html:168 storages/templates/storage.html:180
#: templates/common/confirm_delete.html:5 #: templates/common/confirm_delete.html:5
#: templates/common/confirm_delete.html:9 #: templates/common/confirm_delete.html:9
#: templates/common/confirm_delete.html:26 #: templates/common/confirm_delete.html:26
@ -1013,16 +1013,16 @@ msgstr "Sonuç"
msgid "IP" msgid "IP"
msgstr "IP" msgstr "IP"
#: admin/templates/admin/logs.html:56 admin/views.py:397 instances/states.py:19 #: admin/templates/admin/logs.html:56 admin/views.py:398 instances/states.py:19
#: instances/views.py:491 logs/views.py:18 #: instances/views.py:491 logs/views.py:18
msgid "Unknown" msgid "Unknown"
msgstr "Bilinmeyen" msgstr "Bilinmeyen"
#: admin/templates/admin/logs.html:56 admin/views.py:397 logs/views.py:18 #: admin/templates/admin/logs.html:56 admin/views.py:398 logs/views.py:18
msgid "Done" msgid "Done"
msgstr "Tamamlandı" msgstr "Tamamlandı"
#: admin/templates/admin/logs.html:56 admin/views.py:397 logs/views.py:18 #: admin/templates/admin/logs.html:56 admin/views.py:398 logs/views.py:18
#: operations/templates/operations/job.html:110 #: operations/templates/operations/job.html:110
#: vmbackups/templates/vmbackups/index.html:34 #: vmbackups/templates/vmbackups/index.html:34
#: vmbackups/templates/vmbackups/policy.html:39 #: vmbackups/templates/vmbackups/policy.html:39
@ -1127,15 +1127,30 @@ msgstr "Ayrıldığı sunucu"
msgid "Owners" msgid "Owners"
msgstr "Sahipler" msgstr "Sahipler"
#: admin/templates/admin/tombstone_list.html:39 #: admin/templates/admin/tombstone_list.html:40
#: vmbackups/templates/vmbackups/index.html:12
#: vmbackups/templates/vmbackups/policies.html:8
#: vmbackups/templates/vmbackups/policy.html:10
#: vmbackups/templates/vmbackups/policy_new.html:8
msgid "Schedules"
msgstr "Zamanlamalar"
#: admin/templates/admin/tombstone_list.html:41
#, python-format
msgid "%(counter)s backup"
msgid_plural "%(counter)s backups"
msgstr[0] "%(counter)s yedek"
msgstr[1] "%(counter)s yedek"
#: admin/templates/admin/tombstone_list.html:45
msgid "Removed" msgid "Removed"
msgstr "Kaldırılma" msgstr "Kaldırılma"
#: admin/templates/admin/tombstone_list.html:40 #: admin/templates/admin/tombstone_list.html:46
msgid "expires" msgid "expires"
msgstr "sona erer" msgstr "sona erer"
#: admin/templates/admin/tombstone_list.html:51 #: admin/templates/admin/tombstone_list.html:57
msgid "No removed VM matches the search." msgid "No removed VM matches the search."
msgstr "Aramayla eşleşen kaldırılmış sanal makine yok." msgstr "Aramayla eşleşen kaldırılmış sanal makine yok."
@ -1224,7 +1239,7 @@ msgstr "Kullanıcı oluştur"
msgid "New user" msgid "New user"
msgstr "Yeni kullanıcı" msgstr "Yeni kullanıcı"
#: admin/templates/admin/user_list.html:19 admin/views.py:181 #: admin/templates/admin/user_list.html:19 admin/views.py:182
#: instances/templates/instances/settings_tab.html:79 templates/navbar.html:35 #: instances/templates/instances/settings_tab.html:79 templates/navbar.html:35
msgid "Users" msgid "Users"
msgstr "Kullanıcılar" msgstr "Kullanıcılar"
@ -1283,7 +1298,7 @@ msgstr "Burada belirlenen parolayla oturum açar."
msgid "Signs in another way, such as LDAP. The current password is removed." msgid "Signs in another way, such as LDAP. The current password is removed."
msgstr "LDAP gibi başka bir yolla oturum açar. Mevcut parola kaldırılır." msgstr "LDAP gibi başka bir yolla oturum açar. Mevcut parola kaldırılır."
#: admin/views.py:44 #: admin/views.py:45
#, python-format #, python-format
msgid "" msgid ""
"%(name)s was changed meanwhile: here it is as it is now; make your change " "%(name)s was changed meanwhile: here it is as it is now; make your change "
@ -1291,55 +1306,55 @@ msgid ""
msgstr "" msgstr ""
"%(name)s bu arada değişti: güncel hâli aşağıda; değişikliğinizi yeniden yapın" "%(name)s bu arada değişti: güncel hâli aşağıda; değişikliğinizi yeniden yapın"
#: admin/views.py:77 #: admin/views.py:78
msgid "Create Group" msgid "Create Group"
msgstr "Grup Oluştur" msgstr "Grup Oluştur"
#: admin/views.py:119 #: admin/views.py:120
msgid "Update Group" msgid "Update Group"
msgstr "Grubu Güncelle" msgstr "Grubu Güncelle"
#: admin/views.py:135 #: admin/views.py:136
msgid "Its members stay but lose the permissions it gave them." msgid "Its members stay but lose the permissions it gave them."
msgstr "Üyeleri kalır ancak grubun onlara verdiği izinleri kaybeder." msgstr "Üyeleri kalır ancak grubun onlara verdiği izinleri kaybeder."
#: admin/views.py:141 #: admin/views.py:142
msgid "You cannot block, delete or demote your own account" msgid "You cannot block, delete or demote your own account"
msgstr "Kendi hesabınızı engelleyemez, silemez veya yetkisini düşüremezsiniz" msgstr "Kendi hesabınızı engelleyemez, silemez veya yetkisini düşüremezsiniz"
#: admin/views.py:142 #: admin/views.py:143
msgid "This would leave no active superuser" msgid "This would leave no active superuser"
msgstr "Bu işlem hiç etkin süper kullanıcı bırakmaz" msgstr "Bu işlem hiç etkin süper kullanıcı bırakmaz"
#: admin/views.py:216 #: admin/views.py:217
msgid "Create User" msgid "Create User"
msgstr "Kullanıcı Oluştur" msgstr "Kullanıcı Oluştur"
#: admin/views.py:289 #: admin/views.py:290
msgid "Update User" msgid "Update User"
msgstr "Kullanıcı Güncelle" msgstr "Kullanıcı Güncelle"
#: admin/views.py:313 #: admin/views.py:314
#, python-format #, python-format
msgid "Password changed for %(user)s" msgid "Password changed for %(user)s"
msgstr "%(user)s parolası değiştirildi" msgstr "%(user)s parolası değiştirildi"
#: admin/views.py:340 #: admin/views.py:341
msgid "Their access to VMs, SSH keys and settings go; the VMs themselves stay." msgid "Their access to VMs, SSH keys and settings go; the VMs themselves stay."
msgstr "" msgstr ""
"Sanal makinelere erişimi, SSH anahtarları ve ayarları silinir; sanal " "Sanal makinelere erişimi, SSH anahtarları ve ayarları silinir; sanal "
"makinelerin kendisi kalır." "makinelerin kendisi kalır."
#: admin/views.py:446 #: admin/views.py:452
msgid "deleted user" msgid "deleted user"
msgstr "silinmiş kullanıcı" msgstr "silinmiş kullanıcı"
#: admin/views.py:458 #: admin/views.py:466
#, python-format #, python-format
msgid "Removed VM %(name)s deleted" msgid "Removed VM %(name)s deleted"
msgstr "Kaldırılan sanal makine %(name)s silindi" msgstr "Kaldırılan sanal makine %(name)s silindi"
#: admin/views.py:465 #: admin/views.py:473
msgid "" msgid ""
"Its owners, tags, protection and schedules no longer come back if its UUID " "Its owners, tags, protection and schedules no longer come back if its UUID "
"shows up again, nor are its backups linked to it again." "shows up again, nor are its backups linked to it again."
@ -1347,12 +1362,12 @@ msgstr ""
"UUID'si yeniden görünse bile sahipleri, etiketleri, koruması ve zamanlamaları" "UUID'si yeniden görünse bile sahipleri, etiketleri, koruması ve zamanlamaları"
" artık geri gelmez, yedekleri de ona yeniden bağlanmaz." " artık geri gelmez, yedekleri de ona yeniden bağlanmaz."
#: admin/views.py:512 #: admin/views.py:520
#, python-format #, python-format
msgid "Rename tag %(tag)s" msgid "Rename tag %(tag)s"
msgstr "%(tag)s etiketini yeniden adlandır" msgstr "%(tag)s etiketini yeniden adlandır"
#: admin/views.py:517 #: admin/views.py:525
#, python-format #, python-format
msgid "The backup schedule %(schedules)s backs up its VMs: change it first" msgid "The backup schedule %(schedules)s backs up its VMs: change it first"
msgid_plural "" msgid_plural ""
@ -1364,24 +1379,24 @@ msgstr[1] ""
"%(schedules)s yedekleme zamanlamaları bu etiketin sanal makinelerini " "%(schedules)s yedekleme zamanlamaları bu etiketin sanal makinelerini "
"yedekliyor: önce onları değiştirin" "yedekliyor: önce onları değiştirin"
#: admin/views.py:535 #: admin/views.py:543
#, python-format #, python-format
msgid "Tag %(tag)s deleted" msgid "Tag %(tag)s deleted"
msgstr "%(tag)s etiketi silindi" msgstr "%(tag)s etiketi silindi"
#: admin/views.py:543 #: admin/views.py:551
#, python-format #, python-format
msgid "It is taken off %(vms)s and %(hosts)s." msgid "It is taken off %(vms)s and %(hosts)s."
msgstr "%(vms)s ve %(hosts)s üzerinden kaldırılır." msgstr "%(vms)s ve %(hosts)s üzerinden kaldırılır."
#: admin/views.py:544 #: admin/views.py:552
#, python-format #, python-format
msgid "%(count)s VM" msgid "%(count)s VM"
msgid_plural "%(count)s VMs" msgid_plural "%(count)s VMs"
msgstr[0] "%(count)s sanal makine" msgstr[0] "%(count)s sanal makine"
msgstr[1] "%(count)s sanal makine" msgstr[1] "%(count)s sanal makine"
#: admin/views.py:545 #: admin/views.py:553
#, python-format #, python-format
msgid "%(count)s host" msgid "%(count)s host"
msgid_plural "%(count)s hosts" msgid_plural "%(count)s hosts"
@ -3397,7 +3412,7 @@ msgstr "Bağlan"
#: storages/templates/create_stg_block.html:21 #: storages/templates/create_stg_block.html:21
#: storages/templates/create_stg_vol_block.html:16 #: storages/templates/create_stg_vol_block.html:16
#: storages/templates/create_stg_vol_block.html:54 #: storages/templates/create_stg_vol_block.html:54
#: storages/templates/storage.html:201 templates/base.html:61 #: storages/templates/storage.html:202 templates/base.html:61
#: virtsecrets/templates/create_secret_block.html:16 #: virtsecrets/templates/create_secret_block.html:16
#: virtsecrets/templates/secrets.html:97 #: virtsecrets/templates/secrets.html:97
msgid "Close" msgid "Close"
@ -4284,7 +4299,7 @@ msgstr "Depolama havuzu"
#: instances/templates/add_instance_volume.html:41 #: instances/templates/add_instance_volume.html:41
#: instances/templates/create_instance_w2.html:46 storages/forms.py:119 #: instances/templates/create_instance_w2.html:46 storages/forms.py:119
#: storages/templates/storage.html:209 #: storages/templates/storage.html:210
msgid "Letters, digits, dot, dash and underscore." msgid "Letters, digits, dot, dash and underscore."
msgstr "Harf, rakam, nokta, tire ve alt çizgi." msgstr "Harf, rakam, nokta, tire ve alt çizgi."
@ -4297,14 +4312,14 @@ msgstr "Boyut"
#: instances/templates/add_instance_volume.html:51 #: instances/templates/add_instance_volume.html:51
#: instances/templates/instances/edit_instance_volume.html:82 #: instances/templates/instances/edit_instance_volume.html:82
#: storages/templates/storage.html:141 storages/templates/storage.html:216 #: storages/templates/storage.html:141 storages/templates/storage.html:217
msgid "Format" msgid "Format"
msgstr "Biçem" msgstr "Biçem"
#: instances/templates/add_instance_volume.html:61 #: instances/templates/add_instance_volume.html:61
#: instances/templates/create_instance_w2.html:154 #: instances/templates/create_instance_w2.html:154
#: instances/templates/create_instance_w2.html:220 storages/forms.py:125 #: instances/templates/create_instance_w2.html:220 storages/forms.py:125
#: storages/forms.py:145 storages/templates/storage.html:224 #: storages/forms.py:145 storages/templates/storage.html:225
msgid "Preallocate metadata (qcow2)" msgid "Preallocate metadata (qcow2)"
msgstr "Meta veriyi önceden ayır (qcow2)" msgstr "Meta veriyi önceden ayır (qcow2)"
@ -4796,7 +4811,7 @@ msgstr "Ayrıntılar"
#: instances/templates/instances/settings_tab.html:882 #: instances/templates/instances/settings_tab.html:882
#: instances/templates/instances/settings_tab.html:884 #: instances/templates/instances/settings_tab.html:884
#: nwfilters/templates/nwfilters.html:57 nwfilters/templates/nwfilters.html:94 #: nwfilters/templates/nwfilters.html:57 nwfilters/templates/nwfilters.html:94
#: storages/templates/storage.html:169 storages/templates/storage.html:229 #: storages/templates/storage.html:170 storages/templates/storage.html:230
msgid "Clone" msgid "Clone"
msgstr "Klonla" msgstr "Klonla"
@ -4905,7 +4920,7 @@ msgstr "Kapat"
#: instances/templates/instance_actions.html:39 #: instances/templates/instance_actions.html:39
#: interfaces/templates/interface.html:22 networks/templates/network.html:22 #: interfaces/templates/interface.html:22 networks/templates/network.html:22
#: networks/templates/network.html:162 storages/templates/storage.html:26 #: networks/templates/network.html:162 storages/templates/storage.html:26
#: storages/templates/storage.html:173 #: storages/templates/storage.html:174
msgid "More actions" msgid "More actions"
msgstr "Diğer işlemler" msgstr "Diğer işlemler"
@ -8836,7 +8851,7 @@ msgstr "Aramayla eşleşen filtre yok."
msgid "Clone filter" msgid "Clone filter"
msgstr "Filtreyi klonla" msgstr "Filtreyi klonla"
#: nwfilters/templates/nwfilters.html:88 storages/templates/storage.html:207 #: nwfilters/templates/nwfilters.html:88 storages/templates/storage.html:208
msgid "Name of the copy" msgid "Name of the copy"
msgstr "Kopyanın adı" msgstr "Kopyanın adı"
@ -9619,28 +9634,33 @@ msgstr "Birimlerde ara"
msgid "Volume use" msgid "Volume use"
msgstr "Disk kullanımı" msgstr "Disk kullanımı"
#: storages/templates/storage.html:128 storages/templates/storage.html:156 #: storages/templates/storage.html:128 storages/templates/storage.html:157
msgid "In use" msgid "In use"
msgstr "Kullanımda" msgstr "Kullanımda"
#: storages/templates/storage.html:131 storages/templates/storage.html:157 #: storages/templates/storage.html:131 storages/templates/storage.html:158
msgid "Not used on this host" msgid "Not used on this host"
msgstr "Bu sunucuda kullanılmıyor" msgstr "Bu sunucuda kullanılmıyor"
#: storages/templates/storage.html:156 #: storages/templates/storage.html:155
#, python-format
msgid "Backup of %(vm)s"
msgstr "%(vm)s yedeği"
#: storages/templates/storage.html:157
msgid "Another volume is built on it" msgid "Another volume is built on it"
msgstr "Başka bir disk bunun üzerine kurulu" msgstr "Başka bir disk bunun üzerine kurulu"
#: storages/templates/storage.html:163 #: storages/templates/storage.html:164
#, python-format #, python-format
msgid "%(allocated)s allocated" msgid "%(allocated)s allocated"
msgstr "%(allocated)s ayrılmış" msgstr "%(allocated)s ayrılmış"
#: storages/templates/storage.html:175 #: storages/templates/storage.html:176
msgid "Download" msgid "Download"
msgstr "İndir" msgstr "İndir"
#: storages/templates/storage.html:179 #: storages/templates/storage.html:180
#, python-format #, python-format
msgid "" msgid ""
"Delete volume %(name)s? Its file and data are removed; a volume a VM uses is " "Delete volume %(name)s? Its file and data are removed; a volume a VM uses is "
@ -9649,27 +9669,27 @@ msgstr ""
"%(name)s birimi silinsin mi? Dosyası ve verisi kaldırılır; bir sanal " "%(name)s birimi silinsin mi? Dosyası ve verisi kaldırılır; bir sanal "
"makinenin kullandığı birim silinmez." "makinenin kullandığı birim silinmez."
#: storages/templates/storage.html:192 #: storages/templates/storage.html:193
msgid "No volume matches the search." msgid "No volume matches the search."
msgstr "Aramayla eşleşen birim yok." msgstr "Aramayla eşleşen birim yok."
#: storages/templates/storage.html:200 #: storages/templates/storage.html:201
msgid "Clone image" msgid "Clone image"
msgstr "İmaj Klonla" msgstr "İmaj Klonla"
#: storages/templates/storage.html:213 #: storages/templates/storage.html:214
msgid "Convert it to another format" msgid "Convert it to another format"
msgstr "Başka bir biçime dönüştür" msgstr "Başka bir biçime dönüştür"
#: storages/templates/storage.html:218 #: storages/templates/storage.html:219
msgid "raw" msgid "raw"
msgstr "raw" msgstr "raw"
#: storages/templates/storage.html:219 #: storages/templates/storage.html:220
msgid "qcow2" msgid "qcow2"
msgstr "qcow2" msgstr "qcow2"
#: storages/templates/storage.html:236 #: storages/templates/storage.html:237
msgid "This pool has no volumes." msgid "This pool has no volumes."
msgstr "Bu havuzda birim yok." msgstr "Bu havuzda birim yok."
@ -10736,13 +10756,6 @@ msgstr ""
"%(vm)s VM'inin %(time)s tarihli yedeği silinsin mi? Dosyaları %(target)s " "%(vm)s VM'inin %(time)s tarihli yedeği silinsin mi? Dosyaları %(target)s "
"hedefinden kaldırılır; bu geri alınamaz." "hedefinden kaldırılır; bu geri alınamaz."
#: vmbackups/templates/vmbackups/index.html:12
#: vmbackups/templates/vmbackups/policies.html:8
#: vmbackups/templates/vmbackups/policy.html:10
#: vmbackups/templates/vmbackups/policy_new.html:8
msgid "Schedules"
msgstr "Zamanlamalar"
#: vmbackups/templates/vmbackups/index.html:13 #: vmbackups/templates/vmbackups/index.html:13
#: vmbackups/templates/vmbackups/target.html:7 #: vmbackups/templates/vmbackups/target.html:7
#: vmbackups/templates/vmbackups/target.html:9 #: vmbackups/templates/vmbackups/target.html:9
@ -11146,7 +11159,7 @@ msgstr "Zamanlamalar:"
msgid "No backup of this VM yet." msgid "No backup of this VM yet."
msgstr "Bu sanal makinenin henüz yedeği yok." msgstr "Bu sanal makinenin henüz yedeği yok."
#: vmbackups/utils.py:28 #: vmbackups/utils.py:36
#, python-format #, python-format
msgid "" msgid ""
"Volume %(volume)s belongs to a backup of %(vm)s; delete the backup on the " "Volume %(volume)s belongs to a backup of %(vm)s; delete the backup on the "
@ -11154,7 +11167,7 @@ msgid ""
msgstr "" msgstr ""
"%(volume)s birimi %(vm)s yedeğine ait; yedeği Yedekler sayfasından silin" "%(volume)s birimi %(vm)s yedeğine ait; yedeği Yedekler sayfasından silin"
#: vmbackups/utils.py:38 #: vmbackups/utils.py:46
#, python-format #, python-format
msgid "" msgid ""
"Storage pool %(pool)s is backup target %(target)s; remove it from the target " "Storage pool %(pool)s is backup target %(target)s; remove it from the target "
@ -11162,14 +11175,14 @@ msgid ""
msgstr "" msgstr ""
"%(pool)s depolama havuzu %(target)s yedek hedefidir; önce hedeften çıkarın" "%(pool)s depolama havuzu %(target)s yedek hedefidir; önce hedeften çıkarın"
#: vmbackups/utils.py:65 #: vmbackups/utils.py:73
msgid "" msgid ""
"No backup target open to VM owners has a storage pool on this VM's host." "No backup target open to VM owners has a storage pool on this VM's host."
msgstr "" msgstr ""
"VM sahiplerine açık hiçbir yedek hedefinin bu VM'in sunucusunda depolama " "VM sahiplerine açık hiçbir yedek hedefinin bu VM'in sunucusunda depolama "
"havuzu yok." "havuzu yok."
#: vmbackups/utils.py:66 #: vmbackups/utils.py:74
msgid "No backup target has a storage pool on this VM's host." msgid "No backup target has a storage pool on this VM's host."
msgstr "" msgstr ""
"Hiçbir yedek hedefinin bu sanal makinenin sunucusunda depolama havuzu yok." "Hiçbir yedek hedefinin bu sanal makinenin sunucusunda depolama havuzu yok."

Binary file not shown.

View file

@ -7,7 +7,7 @@ msgid ""
msgstr "" msgstr ""
"Project-Id-Version: \n" "Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n" "Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-20 05:17+0000\n" "POT-Creation-Date: 2026-11-20 05:53+0000\n"
"PO-Revision-Date: \n" "PO-Revision-Date: \n"
"Last-Translator: \n" "Last-Translator: \n"
"Language-Team: \n" "Language-Team: \n"
@ -257,7 +257,7 @@ msgstr "仅电源和控制台"
#: accounts/templates/account.html:81 computes/templates/computes/list.html:110 #: accounts/templates/account.html:81 computes/templates/computes/list.html:110
#: instances/templates/instance_actions.html:9 #: instances/templates/instance_actions.html:9
#: storages/templates/storage.html:166 #: storages/templates/storage.html:167
#, python-format #, python-format
msgid "Actions for %(name)s" msgid "Actions for %(name)s"
msgstr "%(name)s 的操作" msgstr "%(name)s 的操作"
@ -321,7 +321,7 @@ msgstr "您在此处保持登录;您的其他会话将结束。"
#: storages/templates/create_stg_block.html:183 #: storages/templates/create_stg_block.html:183
#: storages/templates/create_stg_vol_block.html:35 #: storages/templates/create_stg_vol_block.html:35
#: storages/templates/create_stg_vol_block.html:68 #: storages/templates/create_stg_vol_block.html:68
#: storages/templates/storage.html:228 templates/base.html:65 #: storages/templates/storage.html:229 templates/base.html:65
#: templates/common/confirm_delete.html:25 templates/common/form.html:27 #: templates/common/confirm_delete.html:25 templates/common/form.html:27
#: virtsecrets/templates/create_secret_block.html:48 #: virtsecrets/templates/create_secret_block.html:48
#: virtsecrets/templates/secrets.html:106 #: virtsecrets/templates/secrets.html:106
@ -463,7 +463,7 @@ msgstr "API 令牌 %(name)s 的操作"
#: accounts/templates/ssh_key_list.html:13 #: accounts/templates/ssh_key_list.html:13
#: admin/templates/admin/group_list.html:44 #: admin/templates/admin/group_list.html:44
#: admin/templates/admin/tag_list.html:38 #: admin/templates/admin/tag_list.html:38
#: admin/templates/admin/tombstone_list.html:44 #: admin/templates/admin/tombstone_list.html:50
#: admin/templates/admin/user_list.html:74 #: admin/templates/admin/user_list.html:74
#: admin/templates/admin/user_list.html:76 #: admin/templates/admin/user_list.html:76
#: instances/templates/create_flavors.html:11 #: instances/templates/create_flavors.html:11
@ -471,7 +471,7 @@ msgstr "API 令牌 %(name)s 的操作"
#: instances/templates/instances/settings_tab.html:315 #: instances/templates/instances/settings_tab.html:315
#: instances/templates/instances/snapshots_tab.html:103 #: instances/templates/instances/snapshots_tab.html:103
#: instances/templates/instances/snapshots_tab.html:117 #: instances/templates/instances/snapshots_tab.html:117
#: networks/templates/network.html:168 storages/templates/storage.html:179 #: networks/templates/network.html:168 storages/templates/storage.html:180
#: templates/common/confirm_delete.html:5 #: templates/common/confirm_delete.html:5
#: templates/common/confirm_delete.html:9 #: templates/common/confirm_delete.html:9
#: templates/common/confirm_delete.html:26 #: templates/common/confirm_delete.html:26
@ -985,16 +985,16 @@ msgstr "结果"
msgid "IP" msgid "IP"
msgstr "IP" msgstr "IP"
#: admin/templates/admin/logs.html:56 admin/views.py:397 instances/states.py:19 #: admin/templates/admin/logs.html:56 admin/views.py:398 instances/states.py:19
#: instances/views.py:491 logs/views.py:18 #: instances/views.py:491 logs/views.py:18
msgid "Unknown" msgid "Unknown"
msgstr "未知" msgstr "未知"
#: admin/templates/admin/logs.html:56 admin/views.py:397 logs/views.py:18 #: admin/templates/admin/logs.html:56 admin/views.py:398 logs/views.py:18
msgid "Done" msgid "Done"
msgstr "完成" msgstr "完成"
#: admin/templates/admin/logs.html:56 admin/views.py:397 logs/views.py:18 #: admin/templates/admin/logs.html:56 admin/views.py:398 logs/views.py:18
#: operations/templates/operations/job.html:110 #: operations/templates/operations/job.html:110
#: vmbackups/templates/vmbackups/index.html:34 #: vmbackups/templates/vmbackups/index.html:34
#: vmbackups/templates/vmbackups/policy.html:39 #: vmbackups/templates/vmbackups/policy.html:39
@ -1093,15 +1093,29 @@ msgstr "已离开"
msgid "Owners" msgid "Owners"
msgstr "所有者" msgstr "所有者"
#: admin/templates/admin/tombstone_list.html:39 #: admin/templates/admin/tombstone_list.html:40
#: vmbackups/templates/vmbackups/index.html:12
#: vmbackups/templates/vmbackups/policies.html:8
#: vmbackups/templates/vmbackups/policy.html:10
#: vmbackups/templates/vmbackups/policy_new.html:8
msgid "Schedules"
msgstr "计划"
#: admin/templates/admin/tombstone_list.html:41
#, python-format
msgid "%(counter)s backup"
msgid_plural "%(counter)s backups"
msgstr[0] "%(counter)s 个备份"
#: admin/templates/admin/tombstone_list.html:45
msgid "Removed" msgid "Removed"
msgstr "移除时间" msgstr "移除时间"
#: admin/templates/admin/tombstone_list.html:40 #: admin/templates/admin/tombstone_list.html:46
msgid "expires" msgid "expires"
msgstr "过期" msgstr "过期"
#: admin/templates/admin/tombstone_list.html:51 #: admin/templates/admin/tombstone_list.html:57
msgid "No removed VM matches the search." msgid "No removed VM matches the search."
msgstr "没有与搜索匹配的已移除虚拟机。" msgstr "没有与搜索匹配的已移除虚拟机。"
@ -1186,7 +1200,7 @@ msgstr "创建用户"
msgid "New user" msgid "New user"
msgstr "新建用户" msgstr "新建用户"
#: admin/templates/admin/user_list.html:19 admin/views.py:181 #: admin/templates/admin/user_list.html:19 admin/views.py:182
#: instances/templates/instances/settings_tab.html:79 templates/navbar.html:35 #: instances/templates/instances/settings_tab.html:79 templates/navbar.html:35
msgid "Users" msgid "Users"
msgstr "用户" msgstr "用户"
@ -1244,94 +1258,94 @@ msgstr "使用此处设置的密码登录。"
msgid "Signs in another way, such as LDAP. The current password is removed." msgid "Signs in another way, such as LDAP. The current password is removed."
msgstr "通过其他方式(如 LDAP)登录。当前密码将被移除。" msgstr "通过其他方式(如 LDAP)登录。当前密码将被移除。"
#: admin/views.py:44 #: admin/views.py:45
#, python-format #, python-format
msgid "" msgid ""
"%(name)s was changed meanwhile: here it is as it is now; make your change " "%(name)s was changed meanwhile: here it is as it is now; make your change "
"again" "again"
msgstr "%(name)s 在此期间已更改:以下是其当前状态;请重新进行更改" msgstr "%(name)s 在此期间已更改:以下是其当前状态;请重新进行更改"
#: admin/views.py:77 #: admin/views.py:78
msgid "Create Group" msgid "Create Group"
msgstr "创建用户组" msgstr "创建用户组"
#: admin/views.py:119 #: admin/views.py:120
msgid "Update Group" msgid "Update Group"
msgstr "更新用户组" msgstr "更新用户组"
#: admin/views.py:135 #: admin/views.py:136
msgid "Its members stay but lose the permissions it gave them." msgid "Its members stay but lose the permissions it gave them."
msgstr "其成员仍保留,但会失去该用户组授予的权限。" msgstr "其成员仍保留,但会失去该用户组授予的权限。"
#: admin/views.py:141 #: admin/views.py:142
msgid "You cannot block, delete or demote your own account" msgid "You cannot block, delete or demote your own account"
msgstr "不能禁用、删除或降级你自己的账户" msgstr "不能禁用、删除或降级你自己的账户"
#: admin/views.py:142 #: admin/views.py:143
msgid "This would leave no active superuser" msgid "This would leave no active superuser"
msgstr "这将导致没有可用的超级用户" msgstr "这将导致没有可用的超级用户"
#: admin/views.py:216 #: admin/views.py:217
msgid "Create User" msgid "Create User"
msgstr "创建用户" msgstr "创建用户"
#: admin/views.py:289 #: admin/views.py:290
msgid "Update User" msgid "Update User"
msgstr "更新用户" msgstr "更新用户"
#: admin/views.py:313 #: admin/views.py:314
#, python-format #, python-format
msgid "Password changed for %(user)s" msgid "Password changed for %(user)s"
msgstr "已为 %(user)s 修改密码" msgstr "已为 %(user)s 修改密码"
#: admin/views.py:340 #: admin/views.py:341
msgid "Their access to VMs, SSH keys and settings go; the VMs themselves stay." msgid "Their access to VMs, SSH keys and settings go; the VMs themselves stay."
msgstr "其对虚拟机、SSH 密钥和设置的访问将被移除;虚拟机本身保留。" msgstr "其对虚拟机、SSH 密钥和设置的访问将被移除;虚拟机本身保留。"
#: admin/views.py:446 #: admin/views.py:452
msgid "deleted user" msgid "deleted user"
msgstr "已删除的用户" msgstr "已删除的用户"
#: admin/views.py:458 #: admin/views.py:466
#, python-format #, python-format
msgid "Removed VM %(name)s deleted" msgid "Removed VM %(name)s deleted"
msgstr "已删除已移除的虚拟机 %(name)s" msgstr "已删除已移除的虚拟机 %(name)s"
#: admin/views.py:465 #: admin/views.py:473
msgid "" msgid ""
"Its owners, tags, protection and schedules no longer come back if its UUID " "Its owners, tags, protection and schedules no longer come back if its UUID "
"shows up again, nor are its backups linked to it again." "shows up again, nor are its backups linked to it again."
msgstr "若其 UUID 再次出现,其所有者、标签、保护和计划将不再恢复,其备份也不会重新关联到它。" msgstr "若其 UUID 再次出现,其所有者、标签、保护和计划将不再恢复,其备份也不会重新关联到它。"
#: admin/views.py:512 #: admin/views.py:520
#, python-format #, python-format
msgid "Rename tag %(tag)s" msgid "Rename tag %(tag)s"
msgstr "重命名标签 %(tag)s" msgstr "重命名标签 %(tag)s"
#: admin/views.py:517 #: admin/views.py:525
#, python-format #, python-format
msgid "The backup schedule %(schedules)s backs up its VMs: change it first" msgid "The backup schedule %(schedules)s backs up its VMs: change it first"
msgid_plural "" msgid_plural ""
"The backup schedules %(schedules)s back up its VMs: change them first" "The backup schedules %(schedules)s back up its VMs: change them first"
msgstr[0] "备份计划 %(schedules)s 正在备份该标签的虚拟机:请先修改计划" msgstr[0] "备份计划 %(schedules)s 正在备份该标签的虚拟机:请先修改计划"
#: admin/views.py:535 #: admin/views.py:543
#, python-format #, python-format
msgid "Tag %(tag)s deleted" msgid "Tag %(tag)s deleted"
msgstr "标签 %(tag)s 已删除" msgstr "标签 %(tag)s 已删除"
#: admin/views.py:543 #: admin/views.py:551
#, python-format #, python-format
msgid "It is taken off %(vms)s and %(hosts)s." msgid "It is taken off %(vms)s and %(hosts)s."
msgstr "它将从 %(vms)s 和 %(hosts)s 上移除。" msgstr "它将从 %(vms)s 和 %(hosts)s 上移除。"
#: admin/views.py:544 #: admin/views.py:552
#, python-format #, python-format
msgid "%(count)s VM" msgid "%(count)s VM"
msgid_plural "%(count)s VMs" msgid_plural "%(count)s VMs"
msgstr[0] "%(count)s 个虚拟机" msgstr[0] "%(count)s 个虚拟机"
#: admin/views.py:545 #: admin/views.py:553
#, python-format #, python-format
msgid "%(count)s host" msgid "%(count)s host"
msgid_plural "%(count)s hosts" msgid_plural "%(count)s hosts"
@ -3230,7 +3244,7 @@ msgstr "连接"
#: storages/templates/create_stg_block.html:21 #: storages/templates/create_stg_block.html:21
#: storages/templates/create_stg_vol_block.html:16 #: storages/templates/create_stg_vol_block.html:16
#: storages/templates/create_stg_vol_block.html:54 #: storages/templates/create_stg_vol_block.html:54
#: storages/templates/storage.html:201 templates/base.html:61 #: storages/templates/storage.html:202 templates/base.html:61
#: virtsecrets/templates/create_secret_block.html:16 #: virtsecrets/templates/create_secret_block.html:16
#: virtsecrets/templates/secrets.html:97 #: virtsecrets/templates/secrets.html:97
msgid "Close" msgid "Close"
@ -4052,7 +4066,7 @@ msgstr "存储池"
#: instances/templates/add_instance_volume.html:41 #: instances/templates/add_instance_volume.html:41
#: instances/templates/create_instance_w2.html:46 storages/forms.py:119 #: instances/templates/create_instance_w2.html:46 storages/forms.py:119
#: storages/templates/storage.html:209 #: storages/templates/storage.html:210
msgid "Letters, digits, dot, dash and underscore." msgid "Letters, digits, dot, dash and underscore."
msgstr "字母、数字、点、短横线和下划线。" msgstr "字母、数字、点、短横线和下划线。"
@ -4065,14 +4079,14 @@ msgstr "大小"
#: instances/templates/add_instance_volume.html:51 #: instances/templates/add_instance_volume.html:51
#: instances/templates/instances/edit_instance_volume.html:82 #: instances/templates/instances/edit_instance_volume.html:82
#: storages/templates/storage.html:141 storages/templates/storage.html:216 #: storages/templates/storage.html:141 storages/templates/storage.html:217
msgid "Format" msgid "Format"
msgstr "格式" msgstr "格式"
#: instances/templates/add_instance_volume.html:61 #: instances/templates/add_instance_volume.html:61
#: instances/templates/create_instance_w2.html:154 #: instances/templates/create_instance_w2.html:154
#: instances/templates/create_instance_w2.html:220 storages/forms.py:125 #: instances/templates/create_instance_w2.html:220 storages/forms.py:125
#: storages/forms.py:145 storages/templates/storage.html:224 #: storages/forms.py:145 storages/templates/storage.html:225
msgid "Preallocate metadata (qcow2)" msgid "Preallocate metadata (qcow2)"
msgstr "预分配元数据(qcow2)" msgstr "预分配元数据(qcow2)"
@ -4550,7 +4564,7 @@ msgstr "详情"
#: instances/templates/instances/settings_tab.html:882 #: instances/templates/instances/settings_tab.html:882
#: instances/templates/instances/settings_tab.html:884 #: instances/templates/instances/settings_tab.html:884
#: nwfilters/templates/nwfilters.html:57 nwfilters/templates/nwfilters.html:94 #: nwfilters/templates/nwfilters.html:57 nwfilters/templates/nwfilters.html:94
#: storages/templates/storage.html:169 storages/templates/storage.html:229 #: storages/templates/storage.html:170 storages/templates/storage.html:230
msgid "Clone" msgid "Clone"
msgstr "克隆" msgstr "克隆"
@ -4657,7 +4671,7 @@ msgstr "关机"
#: instances/templates/instance_actions.html:39 #: instances/templates/instance_actions.html:39
#: interfaces/templates/interface.html:22 networks/templates/network.html:22 #: interfaces/templates/interface.html:22 networks/templates/network.html:22
#: networks/templates/network.html:162 storages/templates/storage.html:26 #: networks/templates/network.html:162 storages/templates/storage.html:26
#: storages/templates/storage.html:173 #: storages/templates/storage.html:174
msgid "More actions" msgid "More actions"
msgstr "更多操作" msgstr "更多操作"
@ -8307,7 +8321,7 @@ msgstr "没有与搜索匹配的过滤器。"
msgid "Clone filter" msgid "Clone filter"
msgstr "克隆过滤器" msgstr "克隆过滤器"
#: nwfilters/templates/nwfilters.html:88 storages/templates/storage.html:207 #: nwfilters/templates/nwfilters.html:88 storages/templates/storage.html:208
msgid "Name of the copy" msgid "Name of the copy"
msgstr "副本名称" msgstr "副本名称"
@ -9053,55 +9067,60 @@ msgstr "搜索卷"
msgid "Volume use" msgid "Volume use"
msgstr "卷使用情况" msgstr "卷使用情况"
#: storages/templates/storage.html:128 storages/templates/storage.html:156 #: storages/templates/storage.html:128 storages/templates/storage.html:157
msgid "In use" msgid "In use"
msgstr "使用中" msgstr "使用中"
#: storages/templates/storage.html:131 storages/templates/storage.html:157 #: storages/templates/storage.html:131 storages/templates/storage.html:158
msgid "Not used on this host" msgid "Not used on this host"
msgstr "未在此主机上使用" msgstr "未在此主机上使用"
#: storages/templates/storage.html:156 #: storages/templates/storage.html:155
#, python-format
msgid "Backup of %(vm)s"
msgstr "%(vm)s 的备份"
#: storages/templates/storage.html:157
msgid "Another volume is built on it" msgid "Another volume is built on it"
msgstr "另一个卷基于它" msgstr "另一个卷基于它"
#: storages/templates/storage.html:163 #: storages/templates/storage.html:164
#, python-format #, python-format
msgid "%(allocated)s allocated" msgid "%(allocated)s allocated"
msgstr "已分配 %(allocated)s" msgstr "已分配 %(allocated)s"
#: storages/templates/storage.html:175 #: storages/templates/storage.html:176
msgid "Download" msgid "Download"
msgstr "下载" msgstr "下载"
#: storages/templates/storage.html:179 #: storages/templates/storage.html:180
#, python-format #, python-format
msgid "" msgid ""
"Delete volume %(name)s? Its file and data are removed; a volume a VM uses is " "Delete volume %(name)s? Its file and data are removed; a volume a VM uses is "
"not deleted." "not deleted."
msgstr "删除卷 %(name)s?其文件和数据将被删除;虚拟机正在使用的卷不会被删除。" msgstr "删除卷 %(name)s?其文件和数据将被删除;虚拟机正在使用的卷不会被删除。"
#: storages/templates/storage.html:192 #: storages/templates/storage.html:193
msgid "No volume matches the search." msgid "No volume matches the search."
msgstr "没有与搜索匹配的卷。" msgstr "没有与搜索匹配的卷。"
#: storages/templates/storage.html:200 #: storages/templates/storage.html:201
msgid "Clone image" msgid "Clone image"
msgstr "克隆镜像" msgstr "克隆镜像"
#: storages/templates/storage.html:213 #: storages/templates/storage.html:214
msgid "Convert it to another format" msgid "Convert it to another format"
msgstr "转换为其他格式" msgstr "转换为其他格式"
#: storages/templates/storage.html:218 #: storages/templates/storage.html:219
msgid "raw" msgid "raw"
msgstr "raw" msgstr "raw"
#: storages/templates/storage.html:219 #: storages/templates/storage.html:220
msgid "qcow2" msgid "qcow2"
msgstr "qcow2" msgstr "qcow2"
#: storages/templates/storage.html:236 #: storages/templates/storage.html:237
msgid "This pool has no volumes." msgid "This pool has no volumes."
msgstr "此存储池中没有卷。" msgstr "此存储池中没有卷。"
@ -10099,13 +10118,6 @@ msgid ""
"%(target)s; this cannot be undone." "%(target)s; this cannot be undone."
msgstr "删除 %(vm)s 于 %(time)s 的备份?其文件将从 %(target)s 中移除;此操作无法撤销。" msgstr "删除 %(vm)s 于 %(time)s 的备份?其文件将从 %(target)s 中移除;此操作无法撤销。"
#: vmbackups/templates/vmbackups/index.html:12
#: vmbackups/templates/vmbackups/policies.html:8
#: vmbackups/templates/vmbackups/policy.html:10
#: vmbackups/templates/vmbackups/policy_new.html:8
msgid "Schedules"
msgstr "计划"
#: vmbackups/templates/vmbackups/index.html:13 #: vmbackups/templates/vmbackups/index.html:13
#: vmbackups/templates/vmbackups/target.html:7 #: vmbackups/templates/vmbackups/target.html:7
#: vmbackups/templates/vmbackups/target.html:9 #: vmbackups/templates/vmbackups/target.html:9
@ -10482,26 +10494,26 @@ msgstr "计划:"
msgid "No backup of this VM yet." msgid "No backup of this VM yet."
msgstr "此虚拟机还没有备份。" msgstr "此虚拟机还没有备份。"
#: vmbackups/utils.py:28 #: vmbackups/utils.py:36
#, python-format #, python-format
msgid "" msgid ""
"Volume %(volume)s belongs to a backup of %(vm)s; delete the backup on the " "Volume %(volume)s belongs to a backup of %(vm)s; delete the backup on the "
"Backups page" "Backups page"
msgstr "卷 %(volume)s 属于 %(vm)s 的备份;请在备份页面删除该备份" msgstr "卷 %(volume)s 属于 %(vm)s 的备份;请在备份页面删除该备份"
#: vmbackups/utils.py:38 #: vmbackups/utils.py:46
#, python-format #, python-format
msgid "" msgid ""
"Storage pool %(pool)s is backup target %(target)s; remove it from the target " "Storage pool %(pool)s is backup target %(target)s; remove it from the target "
"first" "first"
msgstr "存储池 %(pool)s 是备份目标 %(target)s;请先将其从目标中移除" msgstr "存储池 %(pool)s 是备份目标 %(target)s;请先将其从目标中移除"
#: vmbackups/utils.py:65 #: vmbackups/utils.py:73
msgid "" msgid ""
"No backup target open to VM owners has a storage pool on this VM's host." "No backup target open to VM owners has a storage pool on this VM's host."
msgstr "没有向虚拟机所有者开放的备份目标在此虚拟机的主机上有存储池。" msgstr "没有向虚拟机所有者开放的备份目标在此虚拟机的主机上有存储池。"
#: vmbackups/utils.py:66 #: vmbackups/utils.py:74
msgid "No backup target has a storage pool on this VM's host." msgid "No backup target has a storage pool on this VM's host."
msgstr "没有备份目标在此虚拟机的主机上有存储池。" msgstr "没有备份目标在此虚拟机的主机上有存储池。"

View file

@ -139,7 +139,7 @@
<tr> <tr>
<th scope="col">{% trans "Name" %}</th> <th scope="col">{% trans "Name" %}</th>
<th scope="col">{% trans "Format" %}</th> <th scope="col">{% trans "Format" %}</th>
{% if users_read %}<th scope="col" data-sort-method="text">{% trans "Used by" %}</th>{% endif %} {% if users_read or has_backups %}<th scope="col" data-sort-method="text">{% trans "Used by" %}</th>{% endif %}
<th scope="col" class="d-none d-sm-table-cell" data-sort-method="number">{% trans "Capacity" %}</th> <th scope="col" class="d-none d-sm-table-cell" data-sort-method="number">{% trans "Capacity" %}</th>
<th scope="col" data-sort-method="none"><span class="visually-hidden">{% trans "Actions" %}</span></th> <th scope="col" data-sort-method="none"><span class="visually-hidden">{% trans "Actions" %}</span></th>
</tr> </tr>
@ -149,12 +149,13 @@
<tr data-search="{{ volume.name }}{% for vm in volume.users %} {{ vm }}{% endfor %}"> <tr data-search="{{ volume.name }}{% for vm in volume.users %} {{ vm }}{% endfor %}">
<td class="text-break">{{ volume.name }}</td> <td class="text-break">{{ volume.name }}</td>
<td><span class="badge text-bg-light border">{{ volume.type }}</span></td> <td><span class="badge text-bg-light border">{{ volume.type }}</span></td>
{% if users_read %} {% if users_read or has_backups %}
{# a delete still asks the other hosts: one sharing this storage may use the volume #} {# a delete still asks the other hosts: one sharing this storage may use the volume #}
<td class="text-break small"> <td class="text-break small">
{% if volume.users %}<span data-state="used">{{ volume.users|join:", " }}</span> {% if volume.backup %}<span data-state="used">{% blocktrans with vm=volume.backup.vm_name %}Backup of {{ vm }}{% endblocktrans %}</span>
{% elif volume.users %}<span data-state="used">{{ volume.users|join:", " }}</span>
{% elif volume.users is not None %}<span data-state="used" title="{% trans "Another volume is built on it" %}">{% trans "In use" %}</span> {% elif volume.users is not None %}<span data-state="used" title="{% trans "Another volume is built on it" %}">{% trans "In use" %}</span>
{% else %}<span class="text-body-secondary" data-state="unused">{% trans "Not used on this host" %}</span>{% endif %} {% elif users_read %}<span class="text-body-secondary" data-state="unused">{% trans "Not used on this host" %}</span>{% endif %}
</td> </td>
{% endif %} {% endif %}
{# capacity: what the guest sees; allocated: what it takes on the storage now #} {# capacity: what the guest sees; allocated: what it takes on the storage now #}

View file

@ -13,6 +13,7 @@ from libvirt import libvirtError
from lxml import html from lxml import html
from storages.forms import CreateVolumeForm from storages.forms import CreateVolumeForm
from vmbackups.models import Backup, BackupTarget, BackupTargetPool
class PoolPageTests(TestCase): class PoolPageTests(TestCase):
@ -138,6 +139,27 @@ class PoolPageTests(TestCase):
self.assertEqual(page.xpath("//tbody/tr/@data-search"), ["a.img vm1 vm2", "b.img", "c.img"]) self.assertEqual(page.xpath("//tbody/tr/@data-search"), ["a.img vm1 vm2", "b.img", "c.img"])
self.assertEqual(page.xpath("//div[@id='state-pills']/button/@data-pill"), ["", "used", "unused"]) self.assertEqual(page.xpath("//div[@id='state-pills']/button/@data-pill"), ["", "used", "unused"])
def test_a_backups_files_say_whose_backup_they_are(self):
# in a backup target's pool: deleted with their backup, not as unused volumes
target = BackupTarget.objects.create(name="t")
BackupTargetPool.objects.create(target=target, compute=self.compute, pool="default", pool_uuid="u")
backup = Backup.objects.create(target=target, vm_uuid="00000000-0000-4000-8000-000000000001", vm_name="web",
compute_name="pp", state=Backup.READY)
self.conn.get_size.return_value = (10, 4)
self.conn.update_volumes.return_value = [
{"name": name, "path": f"/p/{name}", "size": 1, "allocation": 1, "type": "qcow2"}
for name in (f"{backup.prefix}-vda.qcow2", "left.qcow2")]
page = html.fromstring(self.client.get(reverse("storage", args=[self.compute.pk, "default"])).content)
self.assertEqual([" ".join(t.split()) for t in page.xpath("//tbody/tr/td[3]//text()[normalize-space()]")],
["Backup of web", "Not used on this host"])
self.assertEqual(page.xpath("//tbody/tr//@data-state"), ["used", "unused"])
# the VMs' use not read: the backup is still told, the other volume is not called unused
self.conn.volume_users.side_effect = libvirtError("cannot read the domains")
page = html.fromstring(self.client.get(reverse("storage", args=[self.compute.pk, "default"])).content)
self.assertEqual([" ".join(t.split()) for t in page.xpath("//tbody/tr/td[3]//text()[normalize-space()]")],
["Backup of web"])
self.assertFalse(page.xpath("//div[@id='state-pills']"))
def test_volumes_whose_use_cannot_be_read_are_listed(self): def test_volumes_whose_use_cannot_be_read_are_listed(self):
self.conn.get_size.return_value = (10, 4) self.conn.get_size.return_value = (10, 4)
self.conn.update_volumes.return_value = [{"name": "a.img", "path": "/p/a.img", "size": 1, "allocation": 1, self.conn.update_volumes.return_value = [{"name": "a.img", "path": "/p/a.img", "size": 1, "allocation": 1,

View file

@ -23,7 +23,7 @@ from vrtManager.storage import wvmStorage, wvmStorages
from storages.forms import AddStgPool, CloneImage, CreateVolumeForm from storages.forms import AddStgPool, CloneImage, CreateVolumeForm
from storages.jobs import is_iso from storages.jobs import is_iso
from storages.upload import write_chunk from storages.upload import write_chunk
from vmbackups.utils import refuse_backup_volume, refuse_target_pool from vmbackups.utils import backups_of, refuse_backup_volume, refuse_target_pool
from webvirtcloud.gunicorn_worker import request_progressed from webvirtcloud.gunicorn_worker import request_progressed
@ -237,8 +237,10 @@ def storage(request, compute_id, pool):
# which VMs of this host use each volume; the page lists them without it when it cannot be read # which VMs of this host use each volume; the page lists them without it when it cannot be read
with contextlib.suppress(libvirtError): with contextlib.suppress(libvirtError):
users = conn.volume_users() users = conn.volume_users()
backups = backups_of(compute, pool, [volume["name"] for volume in volumes or []])
for volume in volumes or []: for volume in volumes or []:
volume["iso"] = is_iso(volume["name"]) volume["iso"] = is_iso(volume["name"])
volume["backup"] = backups.get(volume["name"])
volume["users"] = users.get(volume["path"]) if users is not None else None volume["users"] = users.get(volume["path"]) if users is not None else None
try: try:
size, free = conn.get_size() size, free = conn.get_size()
@ -258,6 +260,7 @@ def storage(request, compute_id, pool):
"state": state, "state": state,
"volumes": volumes, "volumes": volumes,
"users_read": users is not None, "users_read": users is not None,
"has_backups": bool(backups),
"size": size, "size": size,
"free": free, "free": free,
"used": used, "used": used,

View file

@ -20,15 +20,23 @@ def inside_vm_pool(conn, pool):
return None return None
def backups_of(compute, pool, volumes):
"""{volume name: its backup} for those of volumes that are files of a backup in the compute's pool."""
if not volumes:
return {}
backups = list(Backup.objects.filter(target__pools__compute=compute, target__pools__pool=pool)
.only("prefix", "vm_name"))
return {volume: backup for volume in volumes for backup in backups if backup.owns(volume)}
def refuse_backup_volume(compute, pool, volume): def refuse_backup_volume(compute, pool, volume):
"""A volume of a backup is deleted with its backup, on the Backups pages.""" """A volume of a backup is deleted with its backup, on the Backups pages."""
for backup in Backup.objects.filter(target__pools__compute=compute, target__pools__pool=pool): if backup := backups_of(compute, pool, [volume]).get(volume):
if backup.owns(volume): raise InUse(
raise InUse( gettext_noop("Volume %(volume)s belongs to a backup of %(vm)s; delete the backup on the Backups page"),
gettext_noop("Volume %(volume)s belongs to a backup of %(vm)s; delete the backup on the Backups page"), volume=volume,
volume=volume, vm=backup.vm_name,
vm=backup.vm_name, )
)
def refuse_target_pool(compute, pool): def refuse_target_pool(compute, pool):