1
0
Fork 0
mirror of https://github.com/retspen/webvirtcloud synced 2026-12-02 08:56:07 +00:00

feat(backups): verify a backup's files on demand

The daily target check only finds files that are gone. Verify (a ready
backup's Restore menu, superusers) runs backup.verify: it reads the
backup's files and those of the backups it builds on whole from the
target through a libvirt stream: each there, a disk at its size and in
its format on its base's file, the small files with their SHA-256, and
a disk with the SHA-256 recorded at its first verification. What is
wrong is kept on the backup and shown as Damaged; a target that cannot
be read fails the job and leaves the backup as it was. Progress in
bytes, cancellable.
This commit is contained in:
catborise 2026-11-19 15:25:20 +03:00
parent eeae606d08
commit 2cf7dbe577
14 changed files with 891 additions and 231 deletions

View file

@ -600,6 +600,8 @@ VMs with a TPM of their own settings (encryption, a state path), host devices, s
**Backups → Schedules** backs VMs up every day: chosen VMs, every VM of a compute or every VM with a chosen tag (not templates), into a target, at a time in the panel's time zone (`TZ`), keeping the newest backups of each VM up to a number. The job worker starts each VM's backup within 6 hours of the time, one copy at a time per target, and waits for a host in maintenance; a VM not started in that window waits for the next day. Older backups of a schedule are deleted; backups taken by hand are not. With "A full backup every N backups" above 1, a schedule's backups of a running VM with qcow2 disks between two full ones copy only what changed since the previous one; each is restored like a full one, and a chain of them is deleted once all of it is beyond the number kept. A migration, a restore over the VM or a shut-off VM's backup makes the next one full. Each target is checked once a day: a backup whose files are gone is marked missing.
**Verify** (a ready backup's Restore menu, superusers) reads the backup's files whole from the target, with those of the backups it builds on: each must be there at its size and format, an incremental disk on its base's file, and every file with the SHA-256 it had when written or, for a disk, at its first verification (recorded then; a disk changed since is reported). What is wrong marks the backup **Damaged**; the job can be cancelled.
The target must be:
- on storage apart from the VMs' disks: a target on the same storage is lost with it;

Binary file not shown.

View file

@ -11,7 +11,7 @@ msgid ""
msgstr ""
"Project-Id-Version: PACKAGE VERSION\n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-19 12:17+0000\n"
"POT-Creation-Date: 2026-11-19 13:08+0000\n"
"PO-Revision-Date: 2020-11-04 12:00+0000\n"
"Last-Translator: catborise <muhammetalisag@gmail.com>, 2020\n"
"Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n"
@ -3450,7 +3450,7 @@ msgstr ""
msgid "The name of the virtual machine must not contain any special characters"
msgstr "Sanal makine adı özel karakterler içeremez"
#: instances/jobs.py:73 vmbackups/jobs.py:141
#: instances/jobs.py:73 vmbackups/jobs.py:142
msgid "The VM moved to another compute after the job was queued"
msgstr "İş kuyruğa alındıktan sonra sanal makine başka bir sunucuya taşındı"
@ -3471,17 +3471,17 @@ msgstr "Klonun adını boş adlar listesinden seçin"
msgid "%(quota)s: cannot create '%(clone_name)s'."
msgstr "%(quota)s: '%(clone_name)s' oluşturulamıyor."
#: instances/jobs.py:206 instances/jobs.py:646 vmbackups/jobs.py:706
#: instances/jobs.py:206 instances/jobs.py:646 vmbackups/jobs.py:885
#, python-format
msgid "Instance '%(clone_name)s' already exists!"
msgstr "'%(clone_name)s' sanal makinesi zaten mevcut!"
#: instances/jobs.py:208 vmbackups/jobs.py:708
#: instances/jobs.py:208 vmbackups/jobs.py:887
#, python-format
msgid "Instance name '%(clone_name)s' is longer than 64 characters"
msgstr "'%(clone_name)s' sanal makine adı 64 karakterden uzun"
#: instances/jobs.py:211 vmbackups/jobs.py:710
#: instances/jobs.py:211 vmbackups/jobs.py:889
#, python-format
msgid "Instance name '%(clone_name)s' contains invalid characters!"
msgstr "Sanal makine adı '%(clone_name)s' geçersiz karakterler içermektedir!"
@ -3638,12 +3638,12 @@ msgid "Clone VM"
msgstr "Sanal makineyi klonla"
#: instances/jobs.py:656 instances/jobs.py:663 instances/jobs.py:1005
#: vmbackups/jobs.py:366 vmbackups/jobs.py:873 vmbackups/jobs.py:1075
#: vmbackups/jobs.py:1250
#: vmbackups/jobs.py:368 vmbackups/jobs.py:1052 vmbackups/jobs.py:1254
#: vmbackups/jobs.py:1429
msgid "Copying disks"
msgstr "Diskler kopyalanıyor"
#: instances/jobs.py:715 vmbackups/jobs.py:450
#: instances/jobs.py:715 vmbackups/jobs.py:452
msgid "libvirt has no result of the copy"
msgstr "libvirt'te kopyanın sonucu yok"
@ -3656,7 +3656,7 @@ msgstr ""
"Kopyalama başarısız oldu: %(error)s. Konuğun dosya sistemleri çözülemedi "
"(%(thaw)s); şununla çözün: virsh domfsthaw %(vm)s"
#: instances/jobs.py:729 instances/jobs.py:821 vmbackups/jobs.py:458
#: instances/jobs.py:729 instances/jobs.py:821 vmbackups/jobs.py:460
msgid "The copy failed"
msgstr "Kopyalama başarısız oldu"
@ -3678,11 +3678,11 @@ msgstr ""
"Klonun bir birimi oluşturuluyordu; şu birimleri kontrol edin, sonra bu işi "
"çözün: %(volumes)s"
#: instances/jobs.py:801 vmbackups/jobs.py:495
#: instances/jobs.py:801 vmbackups/jobs.py:497
msgid "The job stopped before the copy started"
msgstr "İş, kopyalama başlamadan durdu"
#: instances/jobs.py:808 vmbackups/jobs.py:543
#: instances/jobs.py:808 vmbackups/jobs.py:545
msgid "libvirt is still copying the disks"
msgstr "libvirt diskleri hâlâ kopyalıyor"
@ -3723,12 +3723,12 @@ msgstr ""
msgid "Each network card needs a network"
msgstr "Her ağ kartının bir ağı olmalı"
#: instances/jobs.py:868 vrtManager/backup.py:367 vrtManager/instance.py:2905
#: instances/jobs.py:868 vrtManager/backup.py:387 vrtManager/instance.py:2905
#, python-format
msgid "This host has no network %(name)s"
msgstr "Bu sunucuda %(name)s ağı yok"
#: instances/jobs.py:870 vrtManager/backup.py:371 vrtManager/instance.py:2907
#: instances/jobs.py:870 vrtManager/backup.py:391 vrtManager/instance.py:2907
#, python-format
msgid "This host has no network filter %(name)s"
msgstr "Bu sunucuda %(name)s ağ filtresi yok"
@ -10012,7 +10012,7 @@ msgstr ""
msgid "Choose a compute, VMs or a tag: one of them"
msgstr "Bir sunucu, sanal makineler ya da bir etiket seçin: yalnız birini"
#: vmbackups/forms.py:113 vmbackups/jobs.py:113
#: vmbackups/forms.py:113 vmbackups/jobs.py:114
#, python-format
msgid "Backup target %(target)s has no storage pool on %(compute)s"
msgstr "%(target)s yedek hedefinin %(compute)s üzerinde depolama havuzu yok"
@ -10021,17 +10021,17 @@ msgstr "%(target)s yedek hedefinin %(compute)s üzerinde depolama havuzu yok"
msgid "Keep one backup at least"
msgstr "En az bir yedek tutun"
#: vmbackups/jobs.py:75
#: vmbackups/jobs.py:76
#, python-format
msgid "Backup target %(target)s is not open to VM owners"
msgstr "%(target)s yedek hedefi VM sahiplerine açık değil"
#: vmbackups/jobs.py:89
#: vmbackups/jobs.py:90
msgid ""
"You have no backup quota; an administrator sets it with your user's quota"
msgstr "Yedek kotanız yok; bir yönetici bunu kullanıcı kotanızda ayarlar"
#: vmbackups/jobs.py:93
#: vmbackups/jobs.py:94
#, python-format
msgid ""
"The backup needs about %(needed)s GiB; %(used)s GiB of your %(limit)d GiB "
@ -10040,12 +10040,12 @@ msgstr ""
"Yedek yaklaşık %(needed)s GiB gerektiriyor; %(limit)d GiB yedek kotanızın "
"%(used)s GiB'ı kullanılıyor"
#: vmbackups/jobs.py:123
#: vmbackups/jobs.py:124
msgid "The VM must be running, paused or shut off to be backed up"
msgstr ""
"Yedeklenmek için sanal makine çalışıyor, duraklatılmış ya da kapalı olmalı"
#: vmbackups/jobs.py:127
#: vmbackups/jobs.py:128
msgid ""
"A running VM's backup needs libvirt 11.10 or later; shut the VM down to back "
"it up"
@ -10053,49 +10053,49 @@ msgstr ""
"Çalışan bir sanal makinenin yedeği libvirt 11.10 veya sonrasını gerektirir; "
"yedeklemek için sanal makineyi kapatın"
#: vmbackups/jobs.py:129
#: vmbackups/jobs.py:130
msgid "A paused VM's file systems cannot be frozen"
msgstr "Duraklatılmış bir sanal makinenin dosya sistemleri dondurulamaz"
#: vmbackups/jobs.py:131
#: vmbackups/jobs.py:132
msgid "The guest agent does not answer: the file systems cannot be frozen"
msgstr "Konuk ajanı yanıt vermiyor: dosya sistemleri dondurulamaz"
#: vmbackups/jobs.py:187
#: vmbackups/jobs.py:188
msgid ""
"The VM's NVRAM file changed while it was backed up; back the VM up again"
msgstr ""
"Sanal makinenin NVRAM dosyası yedeklenirken değişti; sanal makineyi yeniden "
"yedekleyin"
#: vmbackups/jobs.py:237
#: vmbackups/jobs.py:239
msgid "The VM started while its disks were copied; back it up again"
msgstr "VM, diskleri kopyalanırken başlatıldı; yeniden yedekleyin"
#: vmbackups/jobs.py:303
#: vmbackups/jobs.py:305
msgid "Back up VM"
msgstr "Sanal makineyi yedekle"
#: vmbackups/jobs.py:342
#: vmbackups/jobs.py:344
msgid "The schedule's window ended before the backup could start"
msgstr "Yedek başlayamadan zamanlamanın penceresi bitti"
#: vmbackups/jobs.py:344
#: vmbackups/jobs.py:346
#, python-format
msgid ""
"%(compute)s went into maintenance before the scheduled backup could start"
msgstr "Zamanlanmış yedek başlayamadan %(compute)s bakıma alındı"
#: vmbackups/jobs.py:386 vmbackups/jobs.py:459
#: vmbackups/jobs.py:388 vmbackups/jobs.py:461
msgid "Writing the backup's files"
msgstr "Yedeğin dosyaları yazılıyor"
#: vmbackups/jobs.py:471
#: vmbackups/jobs.py:473
msgid "The guest's file systems could not be thawed; trying again"
msgstr ""
"Konuğun dosya sistemlerinin dondurulması kaldırılamadı; yeniden deneniyor"
#: vmbackups/jobs.py:520
#: vmbackups/jobs.py:522
#, python-format
msgid ""
"The VM is no longer on the compute the job ran on; check these volumes of the"
@ -10104,7 +10104,7 @@ msgstr ""
"Sanal makine artık işin çalıştığı sunucuda değil; yedek hedefindeki şu "
"birimleri kontrol edin, sonra bu işi çözün: %(volumes)s"
#: vmbackups/jobs.py:537
#: vmbackups/jobs.py:539
#, python-format
msgid ""
"A disk was being copied when the job stopped; check these volumes of the "
@ -10113,7 +10113,7 @@ msgstr ""
"İş durduğunda bir disk kopyalanıyordu; yedek hedefindeki şu birimleri kontrol"
" edin, sonra bu işi çözün: %(volumes)s"
#: vmbackups/jobs.py:547
#: vmbackups/jobs.py:549
#, python-format
msgid ""
"Another backup runs on the VM; check these volumes of the backup target, then"
@ -10122,7 +10122,7 @@ msgstr ""
"Sanal makinede başka bir yedekleme çalışıyor; yedek hedefindeki şu birimleri "
"kontrol edin, sonra bu işi çözün: %(volumes)s"
#: vmbackups/jobs.py:553
#: vmbackups/jobs.py:555
#, python-format
msgid ""
"libvirt has no result of the copy; check these volumes of the backup target, "
@ -10131,95 +10131,138 @@ msgstr ""
"libvirt'te kopyanın sonucu yok; yedek hedefindeki şu birimleri kontrol edin, "
"sonra bu işi çözün: %(volumes)s"
#: vmbackups/jobs.py:561
#: vmbackups/jobs.py:563
msgid "The job stopped before the copy ended"
msgstr "İş, kopyalama bitmeden durdu"
#: vmbackups/jobs.py:568
#: vmbackups/jobs.py:570
#, python-format
msgid "The backup's files could not be written: %(error)s"
msgstr "Yedeğin dosyaları yazılamadı: %(error)s"
#: vmbackups/jobs.py:588
#: vmbackups/jobs.py:590
#, python-format
msgid "No compute of backup target %(target)s reaches its storage pool"
msgstr ""
"%(target)s yedek hedefinin hiçbir sunucusu depolama havuzuna erişemiyor"
#: vmbackups/jobs.py:631 vmbackups/templates/vmbackups/delete_form.html:11
#: vmbackups/jobs.py:633 vmbackups/templates/vmbackups/delete_form.html:15
msgid "Delete backup"
msgstr "Yedeği sil"
#: vmbackups/jobs.py:651
#: vmbackups/jobs.py:653
msgid "This backup is being made; cancel its job to stop it"
msgstr "Bu yedek alınıyor; durdurmak için işini iptal edin"
#: vmbackups/jobs.py:653 vmbackups/jobs.py:670
#: vmbackups/jobs.py:655 vmbackups/jobs.py:672
msgid "Later backups depend on this one; delete them first"
msgstr "Sonraki yedekler buna dayanıyor; önce onları silin"
#: vmbackups/jobs.py:668
#: vmbackups/jobs.py:670
msgid "The backup is no longer beyond what its schedule keeps; it is kept"
msgstr "Yedek artık zamanlamasının tuttuğu sayının dışında değil; tutuluyor"
#: vmbackups/jobs.py:687
#: vmbackups/jobs.py:689
msgid "The job stopped before the deletion began"
msgstr "İş, silme başlamadan durdu"
#: vmbackups/jobs.py:723
#, python-format
msgid "The backup's file %(name)s is missing from the target"
msgstr "Yedeğin %(name)s dosyası hedefte yok"
#: vmbackups/jobs.py:726 vmbackups/jobs.py:728
#, python-format
msgid "The backup's file %(name)s differs from the one written"
msgstr "Yedeğin %(name)s dosyası yazılandan farklı"
#: vmbackups/jobs.py:739
#: vmbackups/jobs.py:712 vmbackups/jobs.py:918
#, python-format
msgid "The backup taken %(time)s builds on a backup that is gone"
msgstr "%(time)s tarihli yedek artık olmayan bir yedeğe dayanıyor"
#: vmbackups/jobs.py:753
#: vmbackups/jobs.py:729
msgid "Verify backup"
msgstr "Yedeği doğrula"
#: vmbackups/jobs.py:740
msgid "Only a ready backup can be verified"
msgstr "Yalnızca hazır bir yedek doğrulanabilir"
#: vmbackups/jobs.py:771
msgid "Reading the backup's files"
msgstr "Yedeğin dosyaları okunuyor"
#: vmbackups/jobs.py:796 vmbackups/jobs.py:859
#, python-format
msgid "The backup is damaged: %(damage)s"
msgstr "Yedek hasarlı: %(damage)s"
#: vmbackups/jobs.py:803 vmbackups/jobs.py:838 vmbackups/jobs.py:902
#, python-format
msgid "The backup's file %(name)s is missing from the target"
msgstr "Yedeğin %(name)s dosyası hedefte yok"
#: vmbackups/jobs.py:807 vmbackups/jobs.py:809 vmbackups/jobs.py:813
#: vmbackups/jobs.py:840 vmbackups/jobs.py:845 vmbackups/jobs.py:905
#: vmbackups/jobs.py:907
#, python-format
msgid "The backup's file %(name)s differs from the one written"
msgstr "Yedeğin %(name)s dosyası yazılandan farklı"
#: vmbackups/jobs.py:816
#, python-format
msgid "The backup's file %(name)s is not a %(format)s file"
msgstr "Yedeğin %(name)s dosyası bir %(format)s dosyası değil"
#: vmbackups/jobs.py:823
#, python-format
msgid "The backup's file %(name)s builds on another file"
msgstr "Yedeğin %(name)s dosyası başka bir dosya üzerine kurulu"
#: vmbackups/jobs.py:824
#, python-format
msgid "The backup's file %(name)s does not build on %(base)s"
msgstr "Yedeğin %(name)s dosyası %(base)s üzerine kurulu değil"
#: vmbackups/jobs.py:829
#, python-format
msgid "The backup's file %(name)s changed since its first verification"
msgstr "Yedeğin %(name)s dosyası ilk doğrulamasından bu yana değişmiş"
#: vmbackups/jobs.py:861
msgid "The verification stopped before it ended; verify the backup again"
msgstr "Doğrulama bitmeden durdu; yedeği yeniden doğrulayın"
#: vmbackups/jobs.py:932
#, python-format
msgid "The backup's TPM state file %(name)s is not a plain file name"
msgstr "Yedeğin TPM durum dosyası %(name)s düz bir dosya adı değil"
#: vmbackups/jobs.py:765 vmbackups/templates/vmbackups/restore.html:7
#: vmbackups/jobs.py:944 vmbackups/templates/vmbackups/restore.html:7
msgid "Restore backup"
msgstr "Yedeği geri yükle"
#: vmbackups/jobs.py:799
#: vmbackups/jobs.py:978
#, python-format
msgid "%(quota)s: cannot restore %(name)s"
msgstr "%(quota)s: %(name)s geri yüklenemiyor"
#: vmbackups/jobs.py:806 vmbackups/jobs.py:1028 vmbackups/jobs.py:1216
#: vmbackups/jobs.py:985 vmbackups/jobs.py:1207 vmbackups/jobs.py:1395
msgid "Only a ready backup is restored"
msgstr "Yalnızca hazır bir yedek geri yüklenir"
#: vmbackups/jobs.py:843
#: vmbackups/jobs.py:1022
#, python-format
msgid "A VM named %(name)s exists on %(compute)s"
msgstr "%(compute)s üzerinde %(name)s adlı bir sanal makine var"
#: vmbackups/jobs.py:851 vmbackups/jobs.py:1068 vmbackups/jobs.py:1246
#: vmbackups/jobs.py:1030 vmbackups/jobs.py:1247 vmbackups/jobs.py:1425
#, python-format
msgid "This host has no active directory storage pool %(pool)s"
msgstr "Bu sunucuda %(pool)s adlı etkin bir dizin depolama havuzu yok"
#: vmbackups/jobs.py:869
#: vmbackups/jobs.py:1048
#, python-format
msgid "The NVRAM file %(path)s exists already"
msgstr "%(path)s NVRAM dosyası zaten var"
#: vmbackups/jobs.py:909 vmbackups/jobs.py:935
#: vmbackups/jobs.py:1088 vmbackups/jobs.py:1114
#, python-format
msgid "The VM was restored; it did not start: %(error)s"
msgstr "Sanal makine geri yüklendi; başlamadı: %(error)s"
#: vmbackups/jobs.py:939 vmbackups/jobs.py:1175
#: vmbackups/jobs.py:1118 vmbackups/jobs.py:1354
#, python-format
msgid ""
"A disk was being copied when the job stopped; check this volume, then resolve"
@ -10228,7 +10271,7 @@ msgstr ""
"İş durduğunda bir disk kopyalanıyordu; bu birimi kontrol edin, sonra bu işi "
"çözün: %(volumes)s"
#: vmbackups/jobs.py:944 vmbackups/jobs.py:1181
#: vmbackups/jobs.py:1123 vmbackups/jobs.py:1360
#, python-format
msgid ""
"Storage pool %(pool)s is not active; the restore's copies in it are removed "
@ -10237,20 +10280,20 @@ msgstr ""
"%(pool)s depolama havuzu etkin değil; geri yüklemenin içindeki kopyaları "
"havuz etkin olunca kaldırılır"
#: vmbackups/jobs.py:958
#: vmbackups/jobs.py:1137
msgid "The VM was not defined; its copies were removed"
msgstr "Sanal makine tanımlanmadı; kopyaları kaldırıldı"
#: vmbackups/jobs.py:971
#: vmbackups/jobs.py:1150
msgid "Shut the VM down to restore a backup over it"
msgstr "Üzerine yedek geri yüklemek için VM'i kapatın"
#: vmbackups/jobs.py:974
#: vmbackups/jobs.py:1153
msgid "The VM has snapshots; delete them to restore a backup over it"
msgstr ""
"VM'in anlık görüntüleri var; üzerine yedek geri yüklemek için onları silin"
#: vmbackups/jobs.py:979
#: vmbackups/jobs.py:1158
#, python-format
msgid ""
"The VM's disks (%(now)s) are not the backup's (%(then)s); restore it as a new"
@ -10259,7 +10302,7 @@ msgstr ""
"VM'in diskleri (%(now)s) yedeğinkiler (%(then)s) değil; yeni bir VM olarak ya"
" da tek disk olarak geri yükleyin"
#: vmbackups/jobs.py:983
#: vmbackups/jobs.py:1162
#, python-format
msgid ""
"The backup's disk %(dev)s is larger than the VM's now; restore it as a new VM"
@ -10267,37 +10310,37 @@ msgstr ""
"Yedeğin %(dev)s diski VM'in şimdiki diskinden büyük; yeni bir VM olarak geri "
"yükleyin"
#: vmbackups/jobs.py:986
#: vmbackups/jobs.py:1165
msgid "The VM's UEFI firmware changed since the backup; restore it as a new VM"
msgstr ""
"VM'in UEFI donanım yazılımı yedekten sonra değişti; yeni bir VM olarak geri "
"yükleyin"
#: vmbackups/jobs.py:988
#: vmbackups/jobs.py:1167
msgid "The VM's TPM changed since the backup; restore it as a new VM"
msgstr "VM'in TPM'i yedekten sonra değişti; yeni bir VM olarak geri yükleyin"
#: vmbackups/jobs.py:1019
#: vmbackups/jobs.py:1198
msgid "Restore backup over the VM"
msgstr "Yedeği VM'in üzerine geri yükle"
#: vmbackups/jobs.py:1032
#: vmbackups/jobs.py:1211
msgid "The backup's VM is no longer in the panel; restore it as a new VM"
msgstr "Yedeğin VM'i artık panelde yok; yeni bir VM olarak geri yükleyin"
#: vmbackups/jobs.py:1058
#: vmbackups/jobs.py:1237
msgid "The VM's disks changed after the job was queued"
msgstr "İş kuyruğa alındıktan sonra VM'in diskleri değişti"
#: vmbackups/jobs.py:1092
#: vmbackups/jobs.py:1271
msgid "The VM changed while its backup was copied; it keeps its disks"
msgstr "Yedeği kopyalanırken VM değişti; VM disklerini koruyor"
#: vmbackups/jobs.py:1095
#: vmbackups/jobs.py:1274
msgid "Replacing the VM's disks"
msgstr "VM'in diskleri değiştiriliyor"
#: vmbackups/jobs.py:1155
#: vmbackups/jobs.py:1334
msgid ""
"The VM moved to another compute; check its disks and the restore's copies, "
"then resolve this job"
@ -10305,7 +10348,7 @@ msgstr ""
"VM başka bir sunucuya taşındı; disklerini ve geri yüklemenin kopyalarını "
"denetleyin, sonra bu işi çözümleyin"
#: vmbackups/jobs.py:1168
#: vmbackups/jobs.py:1347
msgid ""
"The VM was started while its disks were being replaced; check its disks, then"
" resolve this job"
@ -10313,25 +10356,25 @@ msgstr ""
"VM'in diskleri değiştirilirken VM başlatıldı; disklerini denetleyin, sonra bu"
" işi çözümleyin"
#: vmbackups/jobs.py:1186
#: vmbackups/jobs.py:1365
msgid "The VM keeps its disks; the restore's copies were removed"
msgstr "VM disklerini koruyor; geri yüklemenin kopyaları silindi"
#: vmbackups/jobs.py:1198
#: vmbackups/jobs.py:1377
msgid "Restore a disk of a backup"
msgstr "Yedeğin bir diskini geri yükle"
#: vmbackups/jobs.py:1209
#: vmbackups/jobs.py:1388
#, python-format
msgid "The backup has no disk %(dev)s"
msgstr "Yedekte %(dev)s diski yok"
#: vmbackups/jobs.py:1219
#: vmbackups/jobs.py:1398
#, python-format
msgid "%(name)s is not a volume name"
msgstr "%(name)s bir birim adı değil"
#: vmbackups/jobs.py:1278
#: vmbackups/jobs.py:1457
#, python-format
msgid ""
"The disk was being copied when the job stopped; check this volume, then "
@ -10340,15 +10383,15 @@ msgstr ""
"İş durduğunda disk kopyalanıyordu; bu birimi denetleyin, sonra bu işi "
"çözümleyin: %(volume)s"
#: vmbackups/jobs.py:1281
#: vmbackups/jobs.py:1460
msgid "The disk was not restored"
msgstr "Disk geri yüklenmedi"
#: vmbackups/jobs.py:1302 vmbackups/templates/vmbackups/target.html:23
#: vmbackups/jobs.py:1481 vmbackups/templates/vmbackups/target.html:23
msgid "Read backups from target"
msgstr "Yedekleri hedeften oku"
#: vmbackups/jobs.py:1371
#: vmbackups/jobs.py:1550
#, python-format
msgid ""
"Not read, as a file of the backup is missing, changed or unreadable: "
@ -10357,24 +10400,24 @@ msgstr ""
"Yedeğin bir dosyası eksik, değişmiş ya da okunamaz olduğu için okunmadı: "
"%(names)s"
#: vmbackups/jobs.py:1387
#: vmbackups/jobs.py:1566
msgid "Check backup target"
msgstr "Yedek hedefini denetle"
#: vmbackups/jobs.py:1421
#: vmbackups/jobs.py:1600
#, python-format
msgid "Files of these backups are missing from the target: %(backups)s"
msgstr "Şu yedeklerin dosyaları hedefte yok: %(backups)s"
#: vmbackups/schedule.py:29
#: vmbackups/schedule.py:30
msgid "Not started within 6 hours of its time"
msgstr "Zamanından sonraki 6 saat içinde başlatılmadı"
#: vmbackups/schedule.py:30
#: vmbackups/schedule.py:31
msgid "The host was in maintenance"
msgstr "Sunucu bakımdaydı"
#: vmbackups/schedule.py:31
#: vmbackups/schedule.py:32
msgid "The schedule's owner is no longer an active superuser"
msgstr "Zamanlamanın sahibi artık etkin bir süper kullanıcı değil"
@ -10418,6 +10461,10 @@ msgid "One disk"
msgstr "Tek disk"
#: vmbackups/templates/vmbackups/delete_form.html:12
msgid "Verify"
msgstr "Doğrula"
#: vmbackups/templates/vmbackups/delete_form.html:16
#, python-format
msgid ""
"Delete the backup of %(vm)s taken %(time)s? Its files are removed from "
@ -10689,6 +10736,19 @@ 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"
msgstr "%(time)s tarihinde doğrulandı"
#: vmbackups/templates/vmbackups/state.html:1
msgid "verified"
msgstr "doğrulandı"
#: vmbackups/templates/vmbackups/state.html:1
msgid "Files of the backup are missing from the target"
msgstr "Yedeğin dosyaları hedefte yok"
@ -10884,17 +10944,17 @@ msgstr "Bir yedek hedefi seçin"
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:328 vmbackups/views.py:349
#: vmbackups/views.py:344 vmbackups/views.py:365
#, python-format
msgid "Backup schedule %(name)s is saved."
msgstr "%(name)s yedekleme zamanlaması kaydedildi."
#: vmbackups/views.py:340
#: vmbackups/views.py:356
#, python-format
msgid "Backup schedule %(name)s is deleted; its backups stay."
msgstr "%(name)s yedekleme zamanlaması silindi; yedekleri duruyor."
#: vrtManager/backup.py:36
#: vrtManager/backup.py:37
#, python-format
msgid ""
"Storage pool %(pool)s is not an active directory or NFS pool of this host, or"
@ -10903,14 +10963,14 @@ msgstr ""
"%(pool)s depolama havuzu bu sunucuda etkin bir dizin veya NFS havuzu değil ya"
" da yedek hedefinin kaydettiği havuz değil"
#: vrtManager/backup.py:64
#: vrtManager/backup.py:65
#, python-format
msgid "%(vm)s has a saved state; start it or remove the saved state first"
msgstr ""
"%(vm)s kaydedilmiş bir durum taşıyor; önce başlatın veya kaydedilmiş durumu "
"kaldırın"
#: vrtManager/backup.py:67
#: vrtManager/backup.py:68
#, python-format
msgid ""
"%(vm)s has a TPM of its own settings (encryption, a state path or another "
@ -10919,61 +10979,61 @@ msgstr ""
"%(vm)s kendi ayarlarına sahip bir TPM taşıyor (şifreleme, durum yolu ya da "
"başka bir arka uç); yedeklenemez"
#: vrtManager/backup.py:70
#: vrtManager/backup.py:71
#, python-format
msgid "%(vm)s has TPM state; shut it down to back it up"
msgstr "%(vm)s TPM durumu taşıyor; yedeklemek için kapatın"
#: vrtManager/backup.py:72
#: vrtManager/backup.py:73
#, python-format
msgid "%(vm)s shares a host directory (filesystem); it cannot be backed up"
msgstr "%(vm)s bir sunucu dizinini paylaşıyor (filesystem); yedeklenemez"
#: vrtManager/backup.py:74
#: vrtManager/backup.py:75
#, python-format
msgid ""
"%(vm)s has a persistent memory device (a host file); it cannot be backed up"
msgstr "%(vm)s kalıcı bellek aygıtına (bir host dosyası) sahip; yedeklenemez"
#: vrtManager/backup.py:77
#: vrtManager/backup.py:78
#, python-format
msgid "%(vm)s boots a kernel file of the host; it cannot be backed up"
msgstr "%(vm)s sunucudaki bir çekirdek dosyasıyla açılıyor; yedeklenemez"
#: vrtManager/backup.py:79
#: vrtManager/backup.py:80
#, python-format
msgid "%(vm)s has a host device; it cannot be backed up"
msgstr "%(vm)s bir sunucu aygıtı kullanıyor; yedeklenemez"
#: vrtManager/backup.py:85
#: vrtManager/backup.py:86
msgid "CD-ROM: not copied"
msgstr "CD-ROM: kopyalanmaz"
#: vrtManager/backup.py:85
#: vrtManager/backup.py:86
msgid "Floppy: not copied"
msgstr "Disket: kopyalanmaz"
#: vrtManager/backup.py:89
#: vrtManager/backup.py:90
#, python-format
msgid "Disk %(dev)s is encrypted; it cannot be backed up"
msgstr "%(dev)s diski şifreli; yedeklenemez"
#: vrtManager/backup.py:92
#: vrtManager/backup.py:93
#, python-format
msgid "Disk %(dev)s is not a file; it cannot be backed up"
msgstr "%(dev)s diski bir dosya değil; yedeklenemez"
#: vrtManager/backup.py:94
#: vrtManager/backup.py:95
#, python-format
msgid "Disk %(dev)s is shareable; it cannot be backed up"
msgstr "%(dev)s diski paylaşılabilir; yedeklenemez"
#: vrtManager/backup.py:97
#: vrtManager/backup.py:98
#, python-format
msgid "Disk %(dev)s is %(format)s; only qcow2 and raw disks are backed up"
msgstr "%(dev)s diski %(format)s; yalnızca qcow2 ve raw diskler yedeklenir"
#: vrtManager/backup.py:104
#: vrtManager/backup.py:105
#, python-format
msgid ""
"Disk %(dev)s (%(path)s) is in no storage pool of the host; it cannot be "
@ -10982,7 +11042,7 @@ msgstr ""
"%(dev)s diski (%(path)s) sunucunun hiçbir depolama havuzunda değil; "
"yedeklenemez"
#: vrtManager/backup.py:119
#: vrtManager/backup.py:120
#, python-format
msgid ""
"Disks %(devs)s change at the next start; back the VM up after it restarts"
@ -10990,7 +11050,7 @@ msgstr ""
"%(devs)s diskleri sonraki başlatmada değişiyor; sanal makineyi yeniden "
"başladıktan sonra yedekleyin"
#: vrtManager/backup.py:126 vrtManager/instance.py:502
#: vrtManager/backup.py:127 vrtManager/instance.py:502
#, python-format
msgid ""
"The NVRAM file %(path)s is not in libvirt's NVRAM directory %(dir)s and "
@ -10999,7 +11059,7 @@ msgstr ""
"%(path)s NVRAM dosyası libvirt'in NVRAM dizini %(dir)s içinde değil ve "
"kopyalanamaz"
#: vrtManager/backup.py:244
#: vrtManager/backup.py:245
#, python-format
msgid ""
"Storage pool %(pool)s has %(free).1f GiB free; the backup needs %(size).1f "
@ -11009,14 +11069,14 @@ msgstr ""
" gerektiriyor (kopyalanan diskler, artı bunların %%%(percent)g kadarı, en az "
"%(minimum)g GiB)"
#: vrtManager/backup.py:257
#: vrtManager/backup.py:258
#, python-format
msgid ""
"The file %(name)s read back from the backup target differs from the one "
"written"
msgstr "Yedek hedefinden geri okunan %(name)s dosyası yazılandan farklı"
#: vrtManager/backup.py:354
#: vrtManager/backup.py:374
#, python-format
msgid ""
"This host cannot run the VM's emulator %(emulator)s with machine type "
@ -11025,17 +11085,17 @@ msgstr ""
"Bu sunucu sanal makinenin %(emulator)s öykünücüsünü %(machine)s makine "
"türüyle çalıştıramıyor: %(error)s"
#: vrtManager/backup.py:358
#: vrtManager/backup.py:378
#, python-format
msgid "This host has no firmware %(loader)s"
msgstr "Bu sunucuda %(loader)s firmware'i yok"
#: vrtManager/backup.py:364
#: vrtManager/backup.py:384
#, python-format
msgid "This host offers no TPM 2.0 %(model)s: install swtpm on it"
msgstr "Bu ana makine TPM 2.0 %(model)s sunmuyor: üzerine swtpm kurun"
#: vrtManager/backup.py:369
#: vrtManager/backup.py:389
#, python-format
msgid "This host has no bridge %(name)s"
msgstr "Bu sunucuda %(name)s köprüsü yok"

Binary file not shown.

View file

@ -7,7 +7,7 @@ msgid ""
msgstr ""
"Project-Id-Version: \n"
"Report-Msgid-Bugs-To: \n"
"POT-Creation-Date: 2026-11-19 12:17+0000\n"
"POT-Creation-Date: 2026-11-19 13:08+0000\n"
"PO-Revision-Date: \n"
"Last-Translator: \n"
"Language-Team: \n"
@ -3276,7 +3276,7 @@ msgstr "控制台监听的不只是 localhost;只有管理员可以移除其
msgid "The name of the virtual machine must not contain any special characters"
msgstr "虚拟机名称不能包含任何特殊字符"
#: instances/jobs.py:73 vmbackups/jobs.py:141
#: instances/jobs.py:73 vmbackups/jobs.py:142
msgid "The VM moved to another compute after the job was queued"
msgstr "任务排队后,虚拟机已移到另一个计算节点"
@ -3297,17 +3297,17 @@ msgstr "请从可用名称列表中选择克隆的名称"
msgid "%(quota)s: cannot create '%(clone_name)s'."
msgstr "%(quota)s:无法创建“%(clone_name)s”。"
#: instances/jobs.py:206 instances/jobs.py:646 vmbackups/jobs.py:706
#: instances/jobs.py:206 instances/jobs.py:646 vmbackups/jobs.py:885
#, python-format
msgid "Instance '%(clone_name)s' already exists!"
msgstr "虚拟机 '%(clone_name)s' 已存在!"
#: instances/jobs.py:208 vmbackups/jobs.py:708
#: instances/jobs.py:208 vmbackups/jobs.py:887
#, python-format
msgid "Instance name '%(clone_name)s' is longer than 64 characters"
msgstr "虚拟机名称“%(clone_name)s”超过 64 个字符"
#: instances/jobs.py:211 vmbackups/jobs.py:710
#: instances/jobs.py:211 vmbackups/jobs.py:889
#, python-format
msgid "Instance name '%(clone_name)s' contains invalid characters!"
msgstr "虚拟机名称 '%(clone_name)s' 包含无效字符!"
@ -3449,12 +3449,12 @@ msgid "Clone VM"
msgstr "克隆虚拟机"
#: instances/jobs.py:656 instances/jobs.py:663 instances/jobs.py:1005
#: vmbackups/jobs.py:366 vmbackups/jobs.py:873 vmbackups/jobs.py:1075
#: vmbackups/jobs.py:1250
#: vmbackups/jobs.py:368 vmbackups/jobs.py:1052 vmbackups/jobs.py:1254
#: vmbackups/jobs.py:1429
msgid "Copying disks"
msgstr "正在复制磁盘"
#: instances/jobs.py:715 vmbackups/jobs.py:450
#: instances/jobs.py:715 vmbackups/jobs.py:452
msgid "libvirt has no result of the copy"
msgstr "libvirt 没有复制的结果"
@ -3465,7 +3465,7 @@ msgid ""
"(%(thaw)s); thaw them with: virsh domfsthaw %(vm)s"
msgstr "复制失败:%(error)s。无法解冻客户机的文件系统(%(thaw)s);请用以下命令解冻:virsh domfsthaw %(vm)s"
#: instances/jobs.py:729 instances/jobs.py:821 vmbackups/jobs.py:458
#: instances/jobs.py:729 instances/jobs.py:821 vmbackups/jobs.py:460
msgid "The copy failed"
msgstr "复制失败"
@ -3483,11 +3483,11 @@ msgid ""
"this job: %(volumes)s"
msgstr "克隆的一个卷正在创建中;请检查这些卷,然后处理此任务:%(volumes)s"
#: instances/jobs.py:801 vmbackups/jobs.py:495
#: instances/jobs.py:801 vmbackups/jobs.py:497
msgid "The job stopped before the copy started"
msgstr "任务在复制开始前停止"
#: instances/jobs.py:808 vmbackups/jobs.py:543
#: instances/jobs.py:808 vmbackups/jobs.py:545
msgid "libvirt is still copying the disks"
msgstr "libvirt 仍在复制磁盘"
@ -3520,12 +3520,12 @@ msgstr "镜像已存在。请检查卷或更改虚拟机名称"
msgid "Each network card needs a network"
msgstr "每个网卡都需要一个网络"
#: instances/jobs.py:868 vrtManager/backup.py:367 vrtManager/instance.py:2905
#: instances/jobs.py:868 vrtManager/backup.py:387 vrtManager/instance.py:2905
#, python-format
msgid "This host has no network %(name)s"
msgstr "此主机没有网络 %(name)s"
#: instances/jobs.py:870 vrtManager/backup.py:371 vrtManager/instance.py:2907
#: instances/jobs.py:870 vrtManager/backup.py:391 vrtManager/instance.py:2907
#, python-format
msgid "This host has no network filter %(name)s"
msgstr "此主机没有网络过滤器 %(name)s"
@ -9432,7 +9432,7 @@ msgstr "1:每次备份都是完整备份。大于 1 时,中间的备份只
msgid "Choose a compute, VMs or a tag: one of them"
msgstr "选择一个计算节点、若干虚拟机或一个标签:只选其一"
#: vmbackups/forms.py:113 vmbackups/jobs.py:113
#: vmbackups/forms.py:113 vmbackups/jobs.py:114
#, python-format
msgid "Backup target %(target)s has no storage pool on %(compute)s"
msgstr "备份目标 %(target)s 在 %(compute)s 上没有存储池"
@ -9441,324 +9441,367 @@ msgstr "备份目标 %(target)s 在 %(compute)s 上没有存储池"
msgid "Keep one backup at least"
msgstr "至少保留一个备份"
#: vmbackups/jobs.py:75
#: vmbackups/jobs.py:76
#, python-format
msgid "Backup target %(target)s is not open to VM owners"
msgstr "备份目标 %(target)s 未向虚拟机所有者开放"
#: vmbackups/jobs.py:89
#: vmbackups/jobs.py:90
msgid ""
"You have no backup quota; an administrator sets it with your user's quota"
msgstr "您没有备份配额;管理员可在您的用户配额中设置"
#: vmbackups/jobs.py:93
#: vmbackups/jobs.py:94
#, python-format
msgid ""
"The backup needs about %(needed)s GiB; %(used)s GiB of your %(limit)d GiB "
"backup quota is used"
msgstr "备份大约需要 %(needed)s GiB;您的 %(limit)d GiB 备份配额已使用 %(used)s GiB"
#: vmbackups/jobs.py:123
#: vmbackups/jobs.py:124
msgid "The VM must be running, paused or shut off to be backed up"
msgstr "虚拟机必须处于运行、暂停或关闭状态才能备份"
#: vmbackups/jobs.py:127
#: vmbackups/jobs.py:128
msgid ""
"A running VM's backup needs libvirt 11.10 or later; shut the VM down to back "
"it up"
msgstr "运行中虚拟机的备份需要 libvirt 11.10 或更高版本;请关闭虚拟机后再备份"
#: vmbackups/jobs.py:129
#: vmbackups/jobs.py:130
msgid "A paused VM's file systems cannot be frozen"
msgstr "无法冻结已暂停虚拟机的文件系统"
#: vmbackups/jobs.py:131
#: vmbackups/jobs.py:132
msgid "The guest agent does not answer: the file systems cannot be frozen"
msgstr "客户机代理没有响应:无法冻结文件系统"
#: vmbackups/jobs.py:187
#: vmbackups/jobs.py:188
msgid ""
"The VM's NVRAM file changed while it was backed up; back the VM up again"
msgstr "虚拟机的 NVRAM 文件在备份期间发生了变化;请重新备份该虚拟机"
#: vmbackups/jobs.py:237
#: vmbackups/jobs.py:239
msgid "The VM started while its disks were copied; back it up again"
msgstr "虚拟机在复制磁盘期间被启动;请重新备份"
#: vmbackups/jobs.py:303
#: vmbackups/jobs.py:305
msgid "Back up VM"
msgstr "备份虚拟机"
#: vmbackups/jobs.py:342
#: vmbackups/jobs.py:344
msgid "The schedule's window ended before the backup could start"
msgstr "备份开始前计划的时间窗口已结束"
#: vmbackups/jobs.py:344
#: vmbackups/jobs.py:346
#, python-format
msgid ""
"%(compute)s went into maintenance before the scheduled backup could start"
msgstr "计划的备份开始前 %(compute)s 已进入维护"
#: vmbackups/jobs.py:386 vmbackups/jobs.py:459
#: vmbackups/jobs.py:388 vmbackups/jobs.py:461
msgid "Writing the backup's files"
msgstr "正在写入备份文件"
#: vmbackups/jobs.py:471
#: vmbackups/jobs.py:473
msgid "The guest's file systems could not be thawed; trying again"
msgstr "无法解冻客户机的文件系统;正在重试"
#: vmbackups/jobs.py:520
#: vmbackups/jobs.py:522
#, python-format
msgid ""
"The VM is no longer on the compute the job ran on; check these volumes of the"
" backup target, then resolve this job: %(volumes)s"
msgstr "虚拟机已不在作业运行的计算节点上;请检查备份目标中的这些卷,然后解决此作业:%(volumes)s"
#: vmbackups/jobs.py:537
#: vmbackups/jobs.py:539
#, python-format
msgid ""
"A disk was being copied when the job stopped; check these volumes of the "
"backup target, then resolve this job: %(volumes)s"
msgstr "作业停止时正在复制磁盘;请检查备份目标中的这些卷,然后解决此作业:%(volumes)s"
#: vmbackups/jobs.py:547
#: vmbackups/jobs.py:549
#, python-format
msgid ""
"Another backup runs on the VM; check these volumes of the backup target, then"
" resolve this job: %(volumes)s"
msgstr "虚拟机上正在运行另一个备份;请检查备份目标中的这些卷,然后解决此作业:%(volumes)s"
#: vmbackups/jobs.py:553
#: vmbackups/jobs.py:555
#, python-format
msgid ""
"libvirt has no result of the copy; check these volumes of the backup target, "
"then resolve this job: %(volumes)s"
msgstr "libvirt 没有复制的结果;请检查备份目标中的这些卷,然后解决此作业:%(volumes)s"
#: vmbackups/jobs.py:561
#: vmbackups/jobs.py:563
msgid "The job stopped before the copy ended"
msgstr "作业在复制结束前停止"
#: vmbackups/jobs.py:568
#: vmbackups/jobs.py:570
#, python-format
msgid "The backup's files could not be written: %(error)s"
msgstr "无法写入备份文件:%(error)s"
#: vmbackups/jobs.py:588
#: vmbackups/jobs.py:590
#, python-format
msgid "No compute of backup target %(target)s reaches its storage pool"
msgstr "备份目标 %(target)s 的计算节点都无法访问其存储池"
#: vmbackups/jobs.py:631 vmbackups/templates/vmbackups/delete_form.html:11
#: vmbackups/jobs.py:633 vmbackups/templates/vmbackups/delete_form.html:15
msgid "Delete backup"
msgstr "删除备份"
#: vmbackups/jobs.py:651
#: vmbackups/jobs.py:653
msgid "This backup is being made; cancel its job to stop it"
msgstr "此备份正在创建;要停止它,请取消其作业"
#: vmbackups/jobs.py:653 vmbackups/jobs.py:670
#: vmbackups/jobs.py:655 vmbackups/jobs.py:672
msgid "Later backups depend on this one; delete them first"
msgstr "后续备份依赖于此备份;请先删除它们"
#: vmbackups/jobs.py:668
#: vmbackups/jobs.py:670
msgid "The backup is no longer beyond what its schedule keeps; it is kept"
msgstr "该备份已不再超出其计划保留的数量;予以保留"
#: vmbackups/jobs.py:687
#: vmbackups/jobs.py:689
msgid "The job stopped before the deletion began"
msgstr "任务在删除开始前已停止"
#: vmbackups/jobs.py:723
#, python-format
msgid "The backup's file %(name)s is missing from the target"
msgstr "目标中缺少备份文件 %(name)s"
#: vmbackups/jobs.py:726 vmbackups/jobs.py:728
#, python-format
msgid "The backup's file %(name)s differs from the one written"
msgstr "备份文件 %(name)s 与写入的不同"
#: vmbackups/jobs.py:739
#: vmbackups/jobs.py:712 vmbackups/jobs.py:918
#, python-format
msgid "The backup taken %(time)s builds on a backup that is gone"
msgstr "%(time)s 的备份所依赖的备份已不存在"
#: vmbackups/jobs.py:753
#: vmbackups/jobs.py:729
msgid "Verify backup"
msgstr "验证备份"
#: vmbackups/jobs.py:740
msgid "Only a ready backup can be verified"
msgstr "只能验证就绪的备份"
#: vmbackups/jobs.py:771
msgid "Reading the backup's files"
msgstr "正在读取备份文件"
#: vmbackups/jobs.py:796 vmbackups/jobs.py:859
#, python-format
msgid "The backup is damaged: %(damage)s"
msgstr "备份已损坏:%(damage)s"
#: vmbackups/jobs.py:803 vmbackups/jobs.py:838 vmbackups/jobs.py:902
#, python-format
msgid "The backup's file %(name)s is missing from the target"
msgstr "目标中缺少备份文件 %(name)s"
#: vmbackups/jobs.py:807 vmbackups/jobs.py:809 vmbackups/jobs.py:813
#: vmbackups/jobs.py:840 vmbackups/jobs.py:845 vmbackups/jobs.py:905
#: vmbackups/jobs.py:907
#, python-format
msgid "The backup's file %(name)s differs from the one written"
msgstr "备份文件 %(name)s 与写入的不同"
#: vmbackups/jobs.py:816
#, python-format
msgid "The backup's file %(name)s is not a %(format)s file"
msgstr "备份文件 %(name)s 不是 %(format)s 文件"
#: vmbackups/jobs.py:823
#, python-format
msgid "The backup's file %(name)s builds on another file"
msgstr "备份文件 %(name)s 基于另一个文件"
#: vmbackups/jobs.py:824
#, python-format
msgid "The backup's file %(name)s does not build on %(base)s"
msgstr "备份文件 %(name)s 不是基于 %(base)s"
#: vmbackups/jobs.py:829
#, python-format
msgid "The backup's file %(name)s changed since its first verification"
msgstr "备份文件 %(name)s 自首次验证以来已更改"
#: vmbackups/jobs.py:861
msgid "The verification stopped before it ended; verify the backup again"
msgstr "验证在完成前停止;请重新验证备份"
#: vmbackups/jobs.py:932
#, python-format
msgid "The backup's TPM state file %(name)s is not a plain file name"
msgstr "备份的 TPM 状态文件 %(name)s 不是普通文件名"
#: vmbackups/jobs.py:765 vmbackups/templates/vmbackups/restore.html:7
#: vmbackups/jobs.py:944 vmbackups/templates/vmbackups/restore.html:7
msgid "Restore backup"
msgstr "恢复备份"
#: vmbackups/jobs.py:799
#: vmbackups/jobs.py:978
#, python-format
msgid "%(quota)s: cannot restore %(name)s"
msgstr "%(quota)s:无法恢复 %(name)s"
#: vmbackups/jobs.py:806 vmbackups/jobs.py:1028 vmbackups/jobs.py:1216
#: vmbackups/jobs.py:985 vmbackups/jobs.py:1207 vmbackups/jobs.py:1395
msgid "Only a ready backup is restored"
msgstr "只能恢复就绪的备份"
#: vmbackups/jobs.py:843
#: vmbackups/jobs.py:1022
#, python-format
msgid "A VM named %(name)s exists on %(compute)s"
msgstr "%(compute)s 上已存在名为 %(name)s 的虚拟机"
#: vmbackups/jobs.py:851 vmbackups/jobs.py:1068 vmbackups/jobs.py:1246
#: vmbackups/jobs.py:1030 vmbackups/jobs.py:1247 vmbackups/jobs.py:1425
#, python-format
msgid "This host has no active directory storage pool %(pool)s"
msgstr "此主机没有名为 %(pool)s 的活动目录存储池"
#: vmbackups/jobs.py:869
#: vmbackups/jobs.py:1048
#, python-format
msgid "The NVRAM file %(path)s exists already"
msgstr "NVRAM 文件 %(path)s 已存在"
#: vmbackups/jobs.py:909 vmbackups/jobs.py:935
#: vmbackups/jobs.py:1088 vmbackups/jobs.py:1114
#, python-format
msgid "The VM was restored; it did not start: %(error)s"
msgstr "虚拟机已恢复;但未能启动:%(error)s"
#: vmbackups/jobs.py:939 vmbackups/jobs.py:1175
#: vmbackups/jobs.py:1118 vmbackups/jobs.py:1354
#, python-format
msgid ""
"A disk was being copied when the job stopped; check this volume, then resolve"
" this job: %(volumes)s"
msgstr "作业停止时正在复制磁盘;请检查此卷,然后解决此作业:%(volumes)s"
#: vmbackups/jobs.py:944 vmbackups/jobs.py:1181
#: vmbackups/jobs.py:1123 vmbackups/jobs.py:1360
#, python-format
msgid ""
"Storage pool %(pool)s is not active; the restore's copies in it are removed "
"when it is"
msgstr "存储池 %(pool)s 未激活;其中恢复的副本将在其激活后删除"
#: vmbackups/jobs.py:958
#: vmbackups/jobs.py:1137
msgid "The VM was not defined; its copies were removed"
msgstr "虚拟机未定义;其副本已删除"
#: vmbackups/jobs.py:971
#: vmbackups/jobs.py:1150
msgid "Shut the VM down to restore a backup over it"
msgstr "请先将虚拟机关机,再将备份恢复到其上"
#: vmbackups/jobs.py:974
#: vmbackups/jobs.py:1153
msgid "The VM has snapshots; delete them to restore a backup over it"
msgstr "虚拟机有快照;请删除它们后再将备份恢复到其上"
#: vmbackups/jobs.py:979
#: vmbackups/jobs.py:1158
#, python-format
msgid ""
"The VM's disks (%(now)s) are not the backup's (%(then)s); restore it as a new"
" VM or one disk"
msgstr "虚拟机的磁盘(%(now)s)与备份的(%(then)s)不同;请恢复为新虚拟机或恢复单个磁盘"
#: vmbackups/jobs.py:983
#: vmbackups/jobs.py:1162
#, python-format
msgid ""
"The backup's disk %(dev)s is larger than the VM's now; restore it as a new VM"
msgstr "备份的磁盘 %(dev)s 比虚拟机当前的磁盘大;请恢复为新虚拟机"
#: vmbackups/jobs.py:986
#: vmbackups/jobs.py:1165
msgid "The VM's UEFI firmware changed since the backup; restore it as a new VM"
msgstr "备份之后虚拟机的 UEFI 固件已更改;请恢复为新虚拟机"
#: vmbackups/jobs.py:988
#: vmbackups/jobs.py:1167
msgid "The VM's TPM changed since the backup; restore it as a new VM"
msgstr "备份之后虚拟机的 TPM 已更改;请恢复为新虚拟机"
#: vmbackups/jobs.py:1019
#: vmbackups/jobs.py:1198
msgid "Restore backup over the VM"
msgstr "将备份恢复到虚拟机上"
#: vmbackups/jobs.py:1032
#: vmbackups/jobs.py:1211
msgid "The backup's VM is no longer in the panel; restore it as a new VM"
msgstr "备份的虚拟机已不在面板中;请恢复为新虚拟机"
#: vmbackups/jobs.py:1058
#: vmbackups/jobs.py:1237
msgid "The VM's disks changed after the job was queued"
msgstr "任务排队后虚拟机的磁盘已更改"
#: vmbackups/jobs.py:1092
#: vmbackups/jobs.py:1271
msgid "The VM changed while its backup was copied; it keeps its disks"
msgstr "复制备份期间虚拟机发生了变化;虚拟机保留其磁盘"
#: vmbackups/jobs.py:1095
#: vmbackups/jobs.py:1274
msgid "Replacing the VM's disks"
msgstr "正在替换虚拟机的磁盘"
#: vmbackups/jobs.py:1155
#: vmbackups/jobs.py:1334
msgid ""
"The VM moved to another compute; check its disks and the restore's copies, "
"then resolve this job"
msgstr "虚拟机已迁移到另一台计算节点;请检查其磁盘和恢复的副本,然后处理此任务"
#: vmbackups/jobs.py:1168
#: vmbackups/jobs.py:1347
msgid ""
"The VM was started while its disks were being replaced; check its disks, then"
" resolve this job"
msgstr "替换磁盘期间虚拟机被启动;请检查其磁盘,然后处理此任务"
#: vmbackups/jobs.py:1186
#: vmbackups/jobs.py:1365
msgid "The VM keeps its disks; the restore's copies were removed"
msgstr "虚拟机保留其磁盘;恢复的副本已删除"
#: vmbackups/jobs.py:1198
#: vmbackups/jobs.py:1377
msgid "Restore a disk of a backup"
msgstr "恢复备份的一个磁盘"
#: vmbackups/jobs.py:1209
#: vmbackups/jobs.py:1388
#, python-format
msgid "The backup has no disk %(dev)s"
msgstr "备份中没有磁盘 %(dev)s"
#: vmbackups/jobs.py:1219
#: vmbackups/jobs.py:1398
#, python-format
msgid "%(name)s is not a volume name"
msgstr "%(name)s 不是有效的卷名"
#: vmbackups/jobs.py:1278
#: vmbackups/jobs.py:1457
#, python-format
msgid ""
"The disk was being copied when the job stopped; check this volume, then "
"resolve this job: %(volume)s"
msgstr "任务停止时磁盘正在复制;请检查此卷,然后处理此任务:%(volume)s"
#: vmbackups/jobs.py:1281
#: vmbackups/jobs.py:1460
msgid "The disk was not restored"
msgstr "磁盘未恢复"
#: vmbackups/jobs.py:1302 vmbackups/templates/vmbackups/target.html:23
#: vmbackups/jobs.py:1481 vmbackups/templates/vmbackups/target.html:23
msgid "Read backups from target"
msgstr "从目标读取备份"
#: vmbackups/jobs.py:1371
#: vmbackups/jobs.py:1550
#, python-format
msgid ""
"Not read, as a file of the backup is missing, changed or unreadable: "
"%(names)s"
msgstr "由于备份的某个文件缺失、已更改或无法读取,未读取:%(names)s"
#: vmbackups/jobs.py:1387
#: vmbackups/jobs.py:1566
msgid "Check backup target"
msgstr "检查备份目标"
#: vmbackups/jobs.py:1421
#: vmbackups/jobs.py:1600
#, python-format
msgid "Files of these backups are missing from the target: %(backups)s"
msgstr "以下备份的文件在目标中缺失:%(backups)s"
#: vmbackups/schedule.py:29
#: vmbackups/schedule.py:30
msgid "Not started within 6 hours of its time"
msgstr "未在计划时间后的 6 小时内启动"
#: vmbackups/schedule.py:30
#: vmbackups/schedule.py:31
msgid "The host was in maintenance"
msgstr "主机处于维护中"
#: vmbackups/schedule.py:31
#: vmbackups/schedule.py:32
msgid "The schedule's owner is no longer an active superuser"
msgstr "该计划的所有者已不再是活动的超级用户"
@ -9802,6 +9845,10 @@ msgid "One disk"
msgstr "单个磁盘"
#: vmbackups/templates/vmbackups/delete_form.html:12
msgid "Verify"
msgstr "验证"
#: vmbackups/templates/vmbackups/delete_form.html:16
#, python-format
msgid ""
"Delete the backup of %(vm)s taken %(time)s? Its files are removed from "
@ -10058,6 +10105,19 @@ 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"
msgstr "于 %(time)s 验证"
#: vmbackups/templates/vmbackups/state.html:1
msgid "verified"
msgstr "已验证"
#: vmbackups/templates/vmbackups/state.html:1
msgid "Files of the backup are missing from the target"
msgstr "备份的文件在目标中缺失"
@ -10231,110 +10291,110 @@ msgstr "请选择备份目标"
msgid "The backup of %(vm)s taken %(time)s is being deleted."
msgstr "正在删除 %(vm)s 于 %(time)s 的备份。"
#: vmbackups/views.py:328 vmbackups/views.py:349
#: vmbackups/views.py:344 vmbackups/views.py:365
#, python-format
msgid "Backup schedule %(name)s is saved."
msgstr "备份计划 %(name)s 已保存。"
#: vmbackups/views.py:340
#: vmbackups/views.py:356
#, python-format
msgid "Backup schedule %(name)s is deleted; its backups stay."
msgstr "备份计划 %(name)s 已删除;其备份保留。"
#: vrtManager/backup.py:36
#: vrtManager/backup.py:37
#, python-format
msgid ""
"Storage pool %(pool)s is not an active directory or NFS pool of this host, or"
" not the one the backup target registered"
msgstr "存储池 %(pool)s 不是此主机上活动的目录或 NFS 存储池,或不是备份目标登记的那个存储池"
#: vrtManager/backup.py:64
#: vrtManager/backup.py:65
#, python-format
msgid "%(vm)s has a saved state; start it or remove the saved state first"
msgstr "%(vm)s 有已保存的状态;请先启动它或删除已保存的状态"
#: vrtManager/backup.py:67
#: vrtManager/backup.py:68
#, python-format
msgid ""
"%(vm)s has a TPM of its own settings (encryption, a state path or another "
"backend); it cannot be backed up"
msgstr "%(vm)s 的 TPM 有自己的设置(加密、状态路径或其他后端);无法备份"
#: vrtManager/backup.py:70
#: vrtManager/backup.py:71
#, python-format
msgid "%(vm)s has TPM state; shut it down to back it up"
msgstr "%(vm)s 有 TPM 状态;请将其关机后再备份"
#: vrtManager/backup.py:72
#: vrtManager/backup.py:73
#, python-format
msgid "%(vm)s shares a host directory (filesystem); it cannot be backed up"
msgstr "%(vm)s 共享主机目录(filesystem);无法备份"
#: vrtManager/backup.py:74
#: vrtManager/backup.py:75
#, python-format
msgid ""
"%(vm)s has a persistent memory device (a host file); it cannot be backed up"
msgstr "%(vm)s 有持久内存设备(主机文件);无法备份"
#: vrtManager/backup.py:77
#: vrtManager/backup.py:78
#, python-format
msgid "%(vm)s boots a kernel file of the host; it cannot be backed up"
msgstr "%(vm)s 从主机上的内核文件启动;无法备份"
#: vrtManager/backup.py:79
#: vrtManager/backup.py:80
#, python-format
msgid "%(vm)s has a host device; it cannot be backed up"
msgstr "%(vm)s 有主机设备;无法备份"
#: vrtManager/backup.py:85
#: vrtManager/backup.py:86
msgid "CD-ROM: not copied"
msgstr "CD-ROM:不复制"
#: vrtManager/backup.py:85
#: vrtManager/backup.py:86
msgid "Floppy: not copied"
msgstr "软盘:不复制"
#: vrtManager/backup.py:89
#: vrtManager/backup.py:90
#, python-format
msgid "Disk %(dev)s is encrypted; it cannot be backed up"
msgstr "磁盘 %(dev)s 已加密;无法备份"
#: vrtManager/backup.py:92
#: vrtManager/backup.py:93
#, python-format
msgid "Disk %(dev)s is not a file; it cannot be backed up"
msgstr "磁盘 %(dev)s 不是文件;无法备份"
#: vrtManager/backup.py:94
#: vrtManager/backup.py:95
#, python-format
msgid "Disk %(dev)s is shareable; it cannot be backed up"
msgstr "磁盘 %(dev)s 可共享;无法备份"
#: vrtManager/backup.py:97
#: vrtManager/backup.py:98
#, python-format
msgid "Disk %(dev)s is %(format)s; only qcow2 and raw disks are backed up"
msgstr "磁盘 %(dev)s 是 %(format)s 格式;只备份 qcow2 和 raw 磁盘"
#: vrtManager/backup.py:104
#: vrtManager/backup.py:105
#, python-format
msgid ""
"Disk %(dev)s (%(path)s) is in no storage pool of the host; it cannot be "
"backed up"
msgstr "磁盘 %(dev)s(%(path)s)不在主机的任何存储池中;无法备份"
#: vrtManager/backup.py:119
#: vrtManager/backup.py:120
#, python-format
msgid ""
"Disks %(devs)s change at the next start; back the VM up after it restarts"
msgstr "磁盘 %(devs)s 将在下次启动时更改;请在虚拟机重启后再备份"
#: vrtManager/backup.py:126 vrtManager/instance.py:502
#: vrtManager/backup.py:127 vrtManager/instance.py:502
#, python-format
msgid ""
"The NVRAM file %(path)s is not in libvirt's NVRAM directory %(dir)s and "
"cannot be copied"
msgstr "NVRAM 文件 %(path)s 不在 libvirt 的 NVRAM 目录 %(dir)s 中,无法复制"
#: vrtManager/backup.py:244
#: vrtManager/backup.py:245
#, python-format
msgid ""
"Storage pool %(pool)s has %(free).1f GiB free; the backup needs %(size).1f "
@ -10343,31 +10403,31 @@ msgstr ""
"存储池 %(pool)s 有 %(free).1f GiB 可用空间;备份需要 %(size).1f GiB(复制的磁盘,加上其 "
"%(percent)g%%,至少 %(minimum)g GiB)"
#: vrtManager/backup.py:257
#: vrtManager/backup.py:258
#, python-format
msgid ""
"The file %(name)s read back from the backup target differs from the one "
"written"
msgstr "从备份目标读回的文件 %(name)s 与写入的不同"
#: vrtManager/backup.py:354
#: vrtManager/backup.py:374
#, python-format
msgid ""
"This host cannot run the VM's emulator %(emulator)s with machine type "
"%(machine)s: %(error)s"
msgstr "此主机无法以机器类型 %(machine)s 运行虚拟机的模拟器 %(emulator)s:%(error)s"
#: vrtManager/backup.py:358
#: vrtManager/backup.py:378
#, python-format
msgid "This host has no firmware %(loader)s"
msgstr "此主机没有固件 %(loader)s"
#: vrtManager/backup.py:364
#: vrtManager/backup.py:384
#, python-format
msgid "This host offers no TPM 2.0 %(model)s: install swtpm on it"
msgstr "此主机不提供 TPM 2.0 %(model)s:请在其上安装 swtpm"
#: vrtManager/backup.py:369
#: vrtManager/backup.py:389
#, python-format
msgid "This host has no bridge %(name)s"
msgstr "此主机没有网桥 %(name)s"

View file

@ -18,7 +18,8 @@ from django.utils import timezone
from django.utils.dateparse import parse_datetime
from django.utils.translation import gettext_noop as _
from lxml import etree
from libvirt import VIR_DOMAIN_PAUSED, VIR_DOMAIN_RUNNING, VIR_DOMAIN_SHUTOFF, VIR_ERR_NO_DOMAIN, VIR_ERR_NO_STORAGE_VOL, libvirtError
from libvirt import (VIR_DOMAIN_PAUSED, VIR_DOMAIN_RUNNING, VIR_DOMAIN_SHUTOFF, VIR_ERR_NO_DOMAIN, VIR_ERR_NO_STORAGE_VOL,
VIR_STORAGE_VOL_GET_PHYSICAL, libvirtError)
from accounts.models import UserAttributes
from appsettings.settings import app_settings
@ -31,7 +32,7 @@ from operations.jobs import Cancelled, Kind, Outcome, Plan, register, register_p
from operations.models import Claim, Operation
from operations.utils import safe_text, say
from vrtManager import util
from vrtManager.backup import (backup_file_names, backup_prefix, check_restore_host, check_target_space, get_file, manifest_names, put_file,
from vrtManager.backup import (backup_file_names, backup_prefix, check_restore_host, check_target_space, get_file, manifest_names, put_file, read_sha256,
remove_files, restore_definition, restore_over_definition, target_pool, volume_exists,
wvmBackup)
from vrtManager.connection import NVRAM_DIR, wvmConnect
@ -199,7 +200,8 @@ def _chain_parent(policy, instance, target, plan, proxy, pool):
while backup is not None:
chain.append(backup)
backup = backup.parent
if not chain or len(chain) >= policy.full_every or any(b.state != Backup.READY for b in chain):
# a verification found damage: the next one is full
if not chain or len(chain) >= policy.full_every or any(b.state != Backup.READY or b.damage for b in chain):
return None, None
if chain[-1].manifest.get("parent"): # its base's row is gone: the chain cannot be read whole
return None, None
@ -696,6 +698,183 @@ class DeleteBackup(Kind):
return op.intent["compute"], op.intent["vm"], op.intent["uuid"], message
VERIFY_STEP = 64 << 20 # bytes read between two progress writes and cancel checks
MANIFEST_LIMIT = 16 << 20 # a manifest is a few kB
def _chain(backup):
"""The backup and those it builds on, itself first; a chain whose base's row is gone is refused."""
chain = [backup]
while backup.parent_id is not None:
backup = backup.parent
chain.append(backup)
if backup.manifest.get("parent"):
raise util.OperationError(_("The backup taken %(time)s builds on a backup that is gone"),
time=timezone.localtime(backup.created_at).strftime("%Y-%m-%d %H:%M"))
return chain
@register
class VerifyBackup(Kind):
"""A ready backup's files read whole from its target, with those of the
backups it builds on: each there, a disk at its size, in its format and on
the file it builds on, every file with the SHA-256 it had when written or,
for a disk, at its first verification (recorded then). What is wrong goes
on the backup (Backup.damage) and fails the job; a target that cannot be
read fails it and leaves the backup as it was. A cancel is seen between
two reads of VERIFY_STEP bytes: a read the target holds up waits for it,
as any libvirt call."""
name = "backup.verify"
label = _("Verify backup")
cancellable = True
progress_bytes = True
def normalize(self, raw):
return {"backup": str(UUID(str(raw["backup"])))}
def plan(self, user, params):
_superuser(user)
backup = _backup(params)
if backup.state != Backup.READY:
raise util.OperationError(_("Only a ready backup can be verified"))
chain = _chain(backup)
keys = {claims.compute_key(compute_id): Claim.SHARED
for compute_id in backup.target.pools.values_list("compute_id", flat=True)}
# not deleted while read; backups go on being made into the target meanwhile
keys.update({claims.backup_key(b.uuid): Claim.SHARED for b in chain})
return Plan(
claims=keys,
resource=claims.backup_key(backup.uuid),
label=f"{backup.vm_name} {timezone.localtime(backup.created_at):%Y-%m-%d %H:%M}",
intent={"compute": backup.compute_name, "vm": backup.vm_name, "uuid": backup.vm_uuid,
"time": timezone.localtime(backup.created_at).strftime("%Y-%m-%d %H:%M")},
)
def run(self, op, ctx):
_superuser(op.user)
backup = _backup(op.params)
conn, pool = _target_pool(backup.target)
stale = None
try:
pool.refresh(0) # another compute may have written the files
except libvirtError as err: # refused while a volume is copied into the pool here: its list as it is
stale = err
files = [(b, f) for b in _chain(backup) for f in b.files.order_by("role", "dev")]
volumes = {f.volume: _volume(pool, f.volume) for _b, f in files}
if stale is not None and None in volumes.values():
raise stale # a file another compute wrote may be missing from the list only: no damage told
disks = [volumes[f.volume] for _b, f in files if f.role == BackupFile.DISK and volumes[f.volume] is not None]
total = sum(vol.infoFlags(VIR_STORAGE_VOL_GET_PHYSICAL)[2] for vol in disks)
read = {"done": 0, "step": 0}
ctx.record_intent(done=0, total=total)
ctx.set_phase(_("Reading the backup's files"))
def cancelled():
op.refresh_from_db(fields=["cancel_requested"])
if op.cancel_requested:
raise Cancelled
def on_read(size):
read["done"] += size
read["step"] += size
if read["step"] >= VERIFY_STEP:
read["step"] = 0
ctx.record_intent(done=read["done"])
cancelled()
damage = []
for b, f in files:
cancelled()
damage += self._damage(conn, b, f, volumes[f.volume], on_read)
for b in _chain(backup):
damage += self._manifest_damage(conn, pool, b)
cancelled()
Backup.objects.filter(pk=backup.pk).update(verified_at=timezone.now(), damage=damage)
ctx.record_intent(recorded=True) # its own result: recovery tells it from another verification's
if damage:
raise util.OperationError(_("The backup is damaged: %(damage)s"), damage=damage)
return {}
@staticmethod
def _damage(conn, backup, f, vol, on_read):
"""What is wrong with the file f of backup (vol: its volume, None when missing): messages."""
if vol is None:
return say(_("The backup's file %(name)s is missing from the target"), name=f.volume)
if f.role != BackupFile.DISK:
# its length first: another file in its place is not read into memory
if vol.infoFlags(VIR_STORAGE_VOL_GET_PHYSICAL)[2] != f.capacity:
return say(_("The backup's file %(name)s differs from the one written"), name=f.volume)
if hashlib.sha256(conn.download_volume(vol)).hexdigest() != f.sha256:
return say(_("The backup's file %(name)s differs from the one written"), name=f.volume)
return []
tree = etree.fromstring(vol.XMLDesc(0))
if vol.info()[1] != f.capacity:
return say(_("The backup's file %(name)s differs from the one written"), name=f.volume)
fmt = tree.find("target/format") # as libvirt reads it from the file's header
if f.format and fmt is not None and fmt.get("type") != f.format:
return say(_("The backup's file %(name)s is not a %(format)s file"), name=f.volume, format=f.format)
base = backup.parent.files.filter(role=BackupFile.DISK, dev=f.dev).first() if backup.parent_id else None
# the file beside it in the target, as libvirt resolves the backing file it names; a full backup's none
below = os.path.normpath(tree.findtext("backingStore/path") or "")
expected = os.path.join(os.path.dirname(vol.path()), base.volume) if base is not None else "."
if below != expected:
if base is None:
return say(_("The backup's file %(name)s builds on another file"), name=f.volume)
return say(_("The backup's file %(name)s does not build on %(base)s"), name=f.volume, base=base.volume)
sha256 = read_sha256(conn, vol, on_read)
# its first verification records it, unless another one did meanwhile: then that one's counts
if not BackupFile.objects.filter(pk=f.pk, sha256="").update(sha256=sha256) \
and sha256 != BackupFile.objects.get(pk=f.pk).sha256:
return say(_("The backup's file %(name)s changed since its first verification"), name=f.volume)
return []
@staticmethod
def _manifest_damage(conn, pool, backup):
"""What is wrong with the backup's manifest in the target, which an import reads."""
name = f"{backup.prefix}-manifest.json"
vol = _volume(pool, name)
if vol is None:
return say(_("The backup's file %(name)s is missing from the target"), name=name)
if vol.infoFlags(VIR_STORAGE_VOL_GET_PHYSICAL)[2] > MANIFEST_LIMIT: # another file in its place: not read
return say(_("The backup's file %(name)s differs from the one written"), name=name)
try:
same = json.loads(conn.download_volume(vol)) == backup.manifest
except ValueError:
same = False
return [] if same else say(_("The backup's file %(name)s differs from the one written"), name=name)
def progress(self, op):
return (op.intent["done"], op.intent["total"]) if "total" in op.intent else None
def cancel(self, op):
pass # run stops at its next step
def reconcile(self, op):
if op.cancel_requested:
return Outcome(Operation.CANCELLED)
backup = Backup.objects.filter(uuid=op.params["backup"]).first()
if backup is not None and op.intent.get("recorded"): # it ended: what it found
if backup.damage:
return Outcome(Operation.FAILED, error=say(_("The backup is damaged: %(damage)s"), damage=backup.damage))
return Outcome(Operation.SUCCEEDED)
return Outcome(Operation.FAILED, error=say(_("The verification stopped before it ended; verify the backup again")))
def log_entry(self, op, state):
backup = f"Backup {op.intent['time']} of {op.intent['vm']}"
message = f"{backup} verified" if state == Operation.SUCCEEDED else f"{backup}: verify ({state})"
return op.intent["compute"], op.intent["vm"], op.intent["uuid"], message
def _volume(pool, name):
try:
return pool.storageVolLookupByName(name)
except libvirtError as err:
if err.get_error_code() != VIR_ERR_NO_STORAGE_VOL:
raise
return None
def _connect(compute):
return wvmConnect(compute.hostname, compute.login, compute.password, compute.type)

View file

@ -0,0 +1,23 @@
# Generated by Django 5.2.18 on 2026-11-19 12:21
from django.db import migrations, models
class Migration(migrations.Migration):
dependencies = [
('vmbackups', '0008_policy_tag'),
]
operations = [
migrations.AddField(
model_name='backup',
name='damage',
field=models.JSONField(default=list),
),
migrations.AddField(
model_name='backup',
name='verified_at',
field=models.DateTimeField(null=True),
),
]

View file

@ -122,6 +122,10 @@ class Backup(models.Model):
# whose job made it: a VM owner's own backups count in their backup quota
taken_by = models.ForeignKey(settings.AUTH_USER_MODEL, on_delete=models.SET_NULL, null=True, related_name="+")
prefix = models.CharField(max_length=128) # every file of the backup in the target begins with it and "-"
# its last verification (backup.verify) that read the files: when, and what it found wrong with them or
# with those of the backups it builds on (messages, operations.utils.say); empty: nothing
verified_at = models.DateTimeField(null=True)
damage = models.JSONField(default=list)
class Meta:
ordering = ["-created_at"]

View file

@ -5,7 +5,11 @@
<ul class="dropdown-menu dropdown-menu-end shadow">
<li><a class="dropdown-item" href="{% url 'vmbackups:restore' backup.uuid %}">{% trans "As a new VM" %}</a></li>
{% if backup.instance_id %}<li><a class="dropdown-item" href="{% url 'vmbackups:restore_over' backup.uuid %}">{% trans "Over the VM" %}</a></li>{% endif %}
{% if user.is_superuser %}<li><a class="dropdown-item" href="{% url 'vmbackups:restore_disk' backup.uuid %}">{% trans "One disk" %}</a></li>{% endif %}
{% if user.is_superuser %}<li><a class="dropdown-item" href="{% url 'vmbackups:restore_disk' backup.uuid %}">{% trans "One disk" %}</a></li>
<li><hr class="dropdown-divider"></li>
{# reads its files whole: they are there and as written #}
<li><form method="post" action="{% url 'vmbackups:verify' backup.uuid %}">{% csrf_token %}{% submission_key %}
<button type="submit" class="dropdown-item">{% bs_icon 'check-circle' %} {% trans "Verify" %}</button></form></li>{% endif %}
</ul>
</div>{% endif %}{% if not backup.being_made %}{% if user.is_superuser or backup.taken_by_id == user.id and not backup.policy_id %}<form method="post" action="{% url 'vmbackups:delete' backup.uuid %}" class="d-inline">{% csrf_token %}{% submission_key %}
<button type="submit" class="btn btn-sm btn-outline-danger" aria-label="{% trans "Delete backup" %}" title="{% trans "Delete backup" %}"

View file

@ -1 +1 @@
{% load i18n %}{% if backup.uuid|stringformat:"s" in pending_deletes %}<span class="badge text-bg-warning" data-backup-pending>{% trans "Deleting" %}</span>{% elif backup.state == "deleting" %}<span class="badge text-bg-warning" title="{% trans "Its deletion did not end; delete it again" %}">{% trans "Deleting" %}</span>{% elif backup.state == "ready" %}<span class="badge text-bg-success">{% trans "Ready" %}</span>{% elif backup.being_made %}<span class="badge text-bg-info" data-backup-pending>{% trans "Creating" %}</span>{% if backup.operation_id %}{% if user.is_superuser or backup.operation.user_id == user.id %} <a class="small" href="{% url 'operations:job' backup.operation_id %}">{% trans "Progress" %}</a>{% endif %}{% endif %}{% elif backup.state == "missing" %}<span class="badge text-bg-danger" title="{% trans "Files of the backup are missing from the target" %}">{% trans "Missing" %}</span>{% else %}<span class="badge text-bg-danger">{% trans "Failed" %}</span>{% if backup.operation_id %}{% if user.is_superuser or backup.operation.user_id == user.id %} <a class="small" href="{% url 'operations:job' backup.operation_id %}">{% trans "Why?" %}</a>{% endif %}{% endif %}{% endif %}
{% load i18n %}{% load operations %}{% if backup.uuid|stringformat:"s" in pending_deletes %}<span class="badge text-bg-warning" data-backup-pending>{% trans "Deleting" %}</span>{% elif backup.state == "deleting" %}<span class="badge text-bg-warning" title="{% trans "Its deletion did not end; delete it again" %}">{% trans "Deleting" %}</span>{% elif backup.state == "ready" and backup.damage %}<span class="badge text-bg-danger" title="{{ backup.damage|words }}">{% trans "Damaged" %}</span>{% elif backup.state == "ready" %}<span class="badge text-bg-success"{% if backup.verified_at %} title="{% blocktrans with time=backup.verified_at|date:"Y-m-d H:i" %}Verified {{ time }}{% endblocktrans %}"{% endif %}>{% trans "Ready" %}</span>{% if backup.verified_at %} <span class="small text-body-secondary">{% trans "verified" %}</span>{% endif %}{% elif backup.being_made %}<span class="badge text-bg-info" data-backup-pending>{% trans "Creating" %}</span>{% if backup.operation_id %}{% if user.is_superuser or backup.operation.user_id == user.id %} <a class="small" href="{% url 'operations:job' backup.operation_id %}">{% trans "Progress" %}</a>{% endif %}{% endif %}{% elif backup.state == "missing" %}<span class="badge text-bg-danger" title="{% trans "Files of the backup are missing from the target" %}">{% trans "Missing" %}</span>{% else %}<span class="badge text-bg-danger">{% trans "Failed" %}</span>{% if backup.operation_id %}{% if user.is_superuser or backup.operation.user_id == user.id %} <a class="small" href="{% url 'operations:job' backup.operation_id %}">{% trans "Why?" %}</a>{% endif %}{% endif %}{% endif %}

View file

@ -0,0 +1,291 @@
"""backup.verify: a backup's files and those of the backups it builds on read
whole from the target; what is wrong goes on the backup and fails the job."""
import hashlib
import json
from datetime import timedelta
from types import SimpleNamespace
from unittest.mock import MagicMock, patch
from uuid import uuid4
import libvirt
from django.contrib.auth import get_user_model
from django.core.exceptions import PermissionDenied
from django.test import TransactionTestCase
from django.urls import reverse
from appsettings.settings import get_settings
from computes.models import Compute
from instances.models import Instance
from operations import jobs
from operations.jobs import Cancelled, Context
from operations.models import Operation, acquire
from operations.utils import words
from vmbackups.jobs import VerifyBackup
from vmbackups.models import Backup, BackupFile, BackupTarget, BackupTargetPool
from vrtManager.util import OperationError
WORKER = "wvc-test:1:v"
DOMAIN = b"<domain/>"
def missing(name):
err = libvirt.libvirtError(f"Storage volume not found: {name}")
err.err = (libvirt.VIR_ERR_NO_STORAGE_VOL, 0, str(err), 2, None, None, None, 0, 0)
return err
class FakePool:
"""The target's volumes: {name: (capacity, format, backing file name, bytes)}."""
def __init__(self):
self.volumes = {}
def refresh(self, flags):
pass
def storageVolLookupByName(self, name):
if name not in self.volumes:
raise missing(name)
capacity, fmt, backing, data = self.volumes[name]
vol = MagicMock()
vol.name.return_value = name
vol.path.return_value = f"/backups/{name}"
vol.info.return_value = [0, capacity, len(data)]
vol.infoFlags.return_value = [0, capacity, len(data)] # physical: the file's length
below = f"<backingStore><path>/backups/{backing}</path></backingStore>" if backing else ""
vol.XMLDesc.return_value = f"<volume><target><format type='{fmt}'/></target>{below}</volume>"
vol.data = data
return vol
def read_sha256(conn, vol, on_read):
on_read(len(vol.data))
return hashlib.sha256(vol.data).hexdigest()
class VerifyBackupTests(TransactionTestCase):
def setUp(self):
get_settings()
self.admin = get_user_model().objects.create_superuser("ver_admin", "v@example.com", "pw")
compute = Compute.objects.create(name="h1", hostname="192.0.2.41", login="u", password="p", type=1)
self.vm = Instance.objects.create(compute=compute, name="vm1", uuid="41414141-0000-4000-8000-000000000001")
self.target = BackupTarget.objects.create(name="nfs1")
BackupTargetPool.objects.create(target=self.target, compute=compute, pool="b1", pool_uuid="u")
self.pool = FakePool()
self.full = self.backup()
self.incremental = self.backup(parent=self.full)
conn = MagicMock()
conn.download_volume.side_effect = lambda vol: vol.data
for name, value in (("vmbackups.jobs.wvmConnect", MagicMock(return_value=conn)),
("vmbackups.jobs.target_pool", MagicMock(return_value=self.pool)),
("vmbackups.jobs.read_sha256", read_sha256)):
patcher = patch(name, value)
patcher.start()
self.addCleanup(patcher.stop)
def backup(self, parent=None):
backup = Backup.objects.create(target=self.target, instance=self.vm, vm_uuid=self.vm.uuid, vm_name="vm1",
compute_name="h1", state=Backup.READY, parent=parent,
manifest={"parent": str(parent.uuid)} if parent else {})
disk = f"{backup.prefix}-vda.qcow2"
self.pool.volumes[disk] = (1 << 20, "qcow2", f"{parent.prefix}-vda.qcow2" if parent else None, b"disk " + disk.encode())
BackupFile.objects.create(backup=backup, role=BackupFile.DISK, dev="vda", volume=disk, format="qcow2", capacity=1 << 20)
domain = f"{backup.prefix}-domain.xml"
self.pool.volumes[domain] = (len(DOMAIN), "raw", None, DOMAIN)
BackupFile.objects.create(backup=backup, role=BackupFile.DOMAIN, volume=domain, capacity=len(DOMAIN),
sha256=hashlib.sha256(DOMAIN).hexdigest())
manifest = json.dumps(backup.manifest).encode()
self.pool.volumes[f"{backup.prefix}-manifest.json"] = (len(manifest), "raw", None, manifest)
return backup
def verify(self, backup=None):
backup = backup or self.incremental
op = jobs.submit("backup.verify", self.admin, {"backup": str(backup.uuid)}, f"key-{uuid4().hex[:12]}")
acquire(WORKER, "wvc-test")
Operation.objects.filter(pk=op.pk).update(state=Operation.RUNNING, worker=WORKER)
op.refresh_from_db()
return VerifyBackup().run(op, Context(op, SimpleNamespace(identity=WORKER)))
def damage(self):
with self.assertRaises(OperationError) as raised:
self.verify()
self.incremental.refresh_from_db()
self.assertTrue(self.incremental.verified_at)
return str(raised.exception), self.incremental.damage
def test_a_sound_chain_is_verified_and_its_disks_hashes_are_recorded(self):
self.verify()
self.incremental.refresh_from_db()
self.assertTrue(self.incremental.verified_at)
self.assertEqual(self.incremental.damage, [])
for backup in (self.full, self.incremental):
disk = backup.files.get(role=BackupFile.DISK)
self.assertEqual(disk.sha256, hashlib.sha256(self.pool.volumes[disk.volume][3]).hexdigest())
def test_a_disk_changed_since_its_first_verification(self):
self.verify()
name = f"{self.full.prefix}-vda.qcow2"
self.pool.volumes[name] = (*self.pool.volumes[name][:3], b"bit rot")
text, damage = self.damage()
self.assertIn(f"The backup's file {name} changed since its first verification", text)
self.assertEqual(len(damage), 1)
# verified again once it is sound: the damage goes
self.pool.volumes[name] = (*self.pool.volumes[name][:3], b"disk " + name.encode())
self.verify()
self.incremental.refresh_from_db()
self.assertEqual(self.incremental.damage, [])
def test_a_file_missing_from_the_base(self):
name = f"{self.full.prefix}-vda.qcow2"
del self.pool.volumes[name]
text, _damage = self.damage()
self.assertIn(f"The backup's file {name} is missing from the target", text)
def test_an_incremental_disk_on_another_file(self):
name = f"{self.incremental.prefix}-vda.qcow2"
self.pool.volumes[name] = (1 << 20, "qcow2", "other.qcow2", b"x")
text, _damage = self.damage()
self.assertIn(f"The backup's file {name} does not build on {self.full.prefix}-vda.qcow2", text)
def test_a_disk_of_another_size_or_format(self):
name = f"{self.incremental.prefix}-vda.qcow2"
backing = f"{self.full.prefix}-vda.qcow2"
self.pool.volumes[name] = (1 << 20, "raw", backing, b"x")
self.assertIn(f"The backup's file {name} is not a qcow2 file", self.damage()[0])
self.pool.volumes[name] = (2 << 20, "qcow2", backing, b"x")
self.assertIn(f"The backup's file {name} differs from the one written", self.damage()[0])
def test_an_incremental_disk_on_a_file_of_another_directory(self):
name = f"{self.incremental.prefix}-vda.qcow2"
self.pool.volumes[name] = (1 << 20, "qcow2", f"../elsewhere/{self.full.prefix}-vda.qcow2", b"x")
self.assertIn(f"The backup's file {name} does not build on", self.damage()[0])
def test_a_full_backup_s_disk_on_a_backing_file(self):
name = f"{self.full.prefix}-vda.qcow2"
self.pool.volumes[name] = (1 << 20, "qcow2", "unrelated.qcow2", b"x")
self.assertIn(f"The backup's file {name} builds on another file", self.damage()[0])
def test_a_pool_refresh_refused_meanwhile_does_not_stop_it_nor_tell_a_file_missing(self):
busy = libvirt.libvirtError("pool has asynchronous jobs running")
with patch.object(FakePool, "refresh", side_effect=busy):
self.verify()
self.incremental.refresh_from_db()
self.assertEqual(self.incremental.damage, [])
# a file the list does not have yet: perhaps written through another compute
del self.pool.volumes[f"{self.full.prefix}-vda.qcow2"]
with self.assertRaises(libvirt.libvirtError):
self.verify()
self.incremental.refresh_from_db()
self.assertEqual(self.incremental.damage, [])
def test_recovery_of_a_verification_that_found_damage_adds_nothing_to_it(self):
del self.pool.volumes[f"{self.full.prefix}-vda.qcow2"]
self.damage()
op = Operation.objects.get(kind="backup.verify")
outcome = VerifyBackup().reconcile(op)
self.assertEqual(outcome.state, Operation.FAILED)
self.assertIn("is missing from the target", words(outcome.error))
Backup.objects.filter(pk=self.incremental.pk).update(damage=[])
self.assertEqual(VerifyBackup().reconcile(op).state, Operation.SUCCEEDED)
# another verification of the backup that ended: not this one's result
other = jobs.submit("backup.verify", self.admin, {"backup": str(self.incremental.uuid)}, "key-verify0010")
self.assertEqual(VerifyBackup().reconcile(other).state, Operation.FAILED)
def test_a_small_file_of_another_length_is_not_read(self):
name = f"{self.full.prefix}-domain.xml"
self.pool.volumes[name] = (len(DOMAIN), "raw", None, b"x" * 100)
conn_reads = []
with patch("vmbackups.jobs.wvmConnect") as connect:
connect.return_value.download_volume.side_effect = lambda vol: conn_reads.append(vol.name()) or vol.data
self.assertIn(f"The backup's file {name} differs from the one written", self.damage()[0])
self.assertNotIn(name, conn_reads)
def test_a_manifest_missing_or_changed(self):
name = f"{self.full.prefix}-manifest.json"
self.pool.volumes[name] = (8, "raw", None, b"{\"x\": 1}")
self.assertIn(f"The backup's file {name} differs from the one written", self.damage()[0])
del self.pool.volumes[name]
self.assertIn(f"The backup's file {name} is missing from the target", self.damage()[0])
def test_another_verification_s_first_hash_counts(self):
disk = self.full.files.get(role=BackupFile.DISK)
def other_first(conn, vol, on_read):
BackupFile.objects.filter(pk=disk.pk).update(sha256="0" * 64) # recorded meanwhile, of another read
return read_sha256(conn, vol, on_read)
with patch("vmbackups.jobs.read_sha256", other_first):
text, _damage = self.damage()
self.assertIn(f"The backup's file {disk.volume} changed since its first verification", text)
disk.refresh_from_db()
self.assertEqual(disk.sha256, "0" * 64)
def test_a_small_file_that_differs(self):
name = f"{self.full.prefix}-domain.xml"
self.pool.volumes[name] = (9, "raw", None, b"<changed/>")
self.assertIn(f"The backup's file {name} differs from the one written", self.damage()[0])
def test_a_target_that_cannot_be_read_leaves_the_backup_as_it_was(self):
with patch("vmbackups.jobs.read_sha256", side_effect=libvirt.libvirtError("stream broke")):
with self.assertRaises(libvirt.libvirtError):
self.verify()
self.incremental.refresh_from_db()
self.assertIsNone(self.incremental.verified_at)
def test_a_cancel_stops_the_read_also_of_a_small_backup_and_after_a_crash(self):
def cancel_then_read(conn, vol, on_read):
Operation.objects.filter(kind="backup.verify").update(cancel_requested=True)
return read_sha256(conn, vol, on_read)
for step in (1, 64 << 20): # within a file, or between files
with self.subTest(step=step), patch("vmbackups.jobs.VERIFY_STEP", step), \
patch("vmbackups.jobs.read_sha256", cancel_then_read), self.assertRaises(Cancelled):
self.verify()
self.incremental.refresh_from_db()
self.assertIsNone(self.incremental.verified_at)
op = Operation.objects.filter(kind="backup.verify").first()
self.assertEqual(VerifyBackup().reconcile(op).state, Operation.CANCELLED)
def test_a_superuser_demoted_while_it_waited(self):
op = jobs.submit("backup.verify", self.admin, {"backup": str(self.full.uuid)}, "key-verify0009")
get_user_model().objects.filter(pk=self.admin.pk).update(is_superuser=False)
op.refresh_from_db()
with self.assertRaises(PermissionDenied):
VerifyBackup().run(op, Context(op, SimpleNamespace(identity=WORKER)))
def test_a_damaged_backup_is_no_base_of_the_next_scheduled_one(self):
from vmbackups.jobs import _chain_parent
from vmbackups.models import BackupPolicy
policy = BackupPolicy.objects.create(name="n", target=self.target, time="02:00", keep=5, full_every=7, owner=self.admin)
Backup.objects.filter(pk__in=[self.full.pk, self.incremental.pk]).update(policy=policy, checkpoint="c")
Backup.objects.filter(pk=self.incremental.pk).update(created_at=self.full.created_at + timedelta(minutes=1))
plan = {"disks": [{"dev": "vda"}]}
proxy = MagicMock()
proxy.checkpoint_sizes.return_value = {"vda": 1}
pool = MagicMock()
pool.listVolumes.return_value = list(self.pool.volumes)
self.assertEqual(_chain_parent(policy, self.vm, self.target, plan, proxy, pool)[0], self.incremental)
Backup.objects.filter(pk=self.full.pk).update(damage=[{"text": "x", "values": {}}])
self.assertEqual(_chain_parent(policy, self.vm, self.target, plan, proxy, pool), (None, None))
def test_only_a_superuser_verifies_and_only_a_ready_backup(self):
owner = get_user_model().objects.create_user("ver_owner", password="pw")
with self.assertRaises(PermissionDenied):
jobs.submit("backup.verify", owner, {"backup": str(self.full.uuid)}, "key-verify0001")
Backup.objects.filter(pk=self.full.pk).update(state=Backup.MISSING)
with self.assertRaisesRegex(OperationError, "Only a ready backup can be verified"):
jobs.submit("backup.verify", self.admin, {"backup": str(self.full.uuid)}, "key-verify0002")
def test_the_page_offers_it_and_shows_what_was_found(self):
self.client.force_login(self.admin)
page = self.client.get(reverse("vmbackups:index"))
self.assertContains(page, reverse("vmbackups:verify", args=[self.full.uuid]))
response = self.client.post(reverse("vmbackups:verify", args=[self.full.uuid]), {"submission_key": "key-verify0003"})
op = Operation.objects.get(kind="backup.verify")
self.assertRedirects(response, reverse("operations:job", args=[op.pk]), fetch_redirect_response=False)
Backup.objects.filter(pk=self.full.pk).update(
damage=[{"text": "The backup's file %(name)s is missing from the target", "values": {"name": "f"}}])
page = self.client.get(reverse("vmbackups:index"))
self.assertContains(page, "Damaged")
self.assertContains(page, "The backup&#x27;s file f is missing from the target")

View file

@ -7,6 +7,7 @@ app_name = "vmbackups"
urlpatterns = [
path("", views.index, name="index"),
path("<uuid:uuid>/delete/", views.delete, name="delete"),
path("<uuid:uuid>/verify/", views.verify, name="verify"),
path("<uuid:uuid>/restore/", views.restore, name="restore"),
path("<uuid:uuid>/restore-over/", views.restore_over, name="restore_over"),
path("<uuid:uuid>/restore-disk/", views.restore_disk, name="restore_disk"),

View file

@ -231,6 +231,22 @@ def delete(request, uuid):
return redirect(same_origin_referer(request, reverse("vmbackups:index")))
@require_POST
@superuser_only
def verify(request, uuid):
"""Verify a backup: a backup.verify job, followed on its page."""
backup = get_object_or_404(Backup, uuid=uuid)
try:
op = jobs.submit("backup.verify", request.user, {"backup": str(backup.uuid)}, request.POST.get("submission_key", ""))
except claims.Busy as busy:
messages.error(request, busy_message(busy, request.user))
except (jobs.SubmissionConflict, libvirtError) as err:
messages.error(request, error_text(request, err))
else:
return redirect("operations:job", op.pk)
return redirect(same_origin_referer(request, reverse("vmbackups:index")))
@login_required
def restore(request, uuid):
"""Restore a ready backup as a new VM: a backup.restore job, followed on

View file

@ -1,5 +1,6 @@
"""VM backups: the target pools and what a VM's backup holds (app vmbackups)."""
import contextlib
import hashlib
import os
import re
@ -262,6 +263,25 @@ def get_file(conn, pool, name):
return conn.download_volume(pool.storageVolLookupByName(name))
def read_sha256(conn, vol, on_read):
"""The SHA-256 of the file of vol, read whole through a libvirt stream
(holes as zeros); on_read(bytes) after each chunk, which may raise to
stop the read."""
digest = hashlib.sha256()
stream = conn.wvm.newStream(0)
try:
vol.download(stream, 0, 0, 0)
while data := stream.recv(1 << 20):
digest.update(data)
on_read(len(data))
stream.finish()
except BaseException:
with contextlib.suppress(libvirt.libvirtError):
stream.abort()
raise
return digest.hexdigest()
def remove_files(pool, names):
"""Deletes the volumes names of pool; missing ones are passed over."""
for name in names: