diff --git a/README.md b/README.md index 93f8e774..9e14b612 100644 --- a/README.md +++ b/README.md @@ -592,6 +592,8 @@ Superusers back a VM up from its **Backups** tab into a backup target: a `dir` o VMs with TPM state, host devices, shared host directories, or encrypted or non-file disks are not backed up; CD-ROMs are left out. +**Backups → Schedules** backs VMs up every day: chosen VMs or every VM of a compute, 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. Each target is checked once a day: a backup whose files are gone is marked missing. + The target must be: - on storage apart from the VMs' disks: a target on the same storage is lost with it; diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo index 0bc9c6c3..81cf4373 100644 Binary files a/locale/tr/LC_MESSAGES/django.mo and b/locale/tr/LC_MESSAGES/django.mo differ diff --git a/locale/tr/LC_MESSAGES/django.po b/locale/tr/LC_MESSAGES/django.po index b175442b..1c2d2818 100644 --- a/locale/tr/LC_MESSAGES/django.po +++ b/locale/tr/LC_MESSAGES/django.po @@ -75,7 +75,8 @@ msgstr "Geçersiz anahtar" #: interfaces/templates/interface.html:119 networks/templates/network.html:145 #: networks/templates/network.html:373 nwfilters/templates/nwfilters.html:29 #: storages/templates/storage.html:123 virtsecrets/forms.py:34 -#: virtsecrets/forms.py:36 vmbackups/forms.py:22 vmbackups/forms.py:35 +#: virtsecrets/forms.py:36 vmbackups/forms.py:23 vmbackups/forms.py:36 +#: vmbackups/forms.py:57 vmbackups/templates/vmbackups/policies.html:16 #: vmbackups/templates/vmbackups/targets.html:17 msgid "Name" msgstr "Ad" @@ -220,7 +221,7 @@ msgstr "Kullanıcı bölümleri" #: accounts/templates/account.html:50 accounts/templates/account.html:58 #: admin/forms.py:207 computes/templates/computes/list.html:33 #: computes/templates/computes/list.html:60 computes/templates/overview.html:90 -#: instances/views.py:263 +#: instances/views.py:263 vmbackups/templates/vmbackups/policies.html:16 msgid "VMs" msgstr "Sanal makineler" @@ -965,6 +966,7 @@ msgstr "Mesaj" #: admin/templates/admin/logs.html:43 #: instances/templates/instances/stats_tab.html:72 +#: vmbackups/templates/vmbackups/policy.html:29 msgid "Result" msgstr "Sonuç" @@ -983,7 +985,8 @@ msgstr "Tamamlandı" #: admin/templates/admin/logs.html:56 admin/views.py:395 logs/views.py:18 #: operations/templates/operations/job.html:107 -#: vmbackups/templates/vmbackups/index.html:31 +#: vmbackups/templates/vmbackups/index.html:32 +#: vmbackups/templates/vmbackups/policy.html:38 #: vmbackups/templates/vmbackups/state.html:1 msgid "Failed" msgstr "Başarısız" @@ -2461,6 +2464,7 @@ msgstr "hiçbiri" #: networks/templates/network.html:337 networks/templates/network.html:379 #: networks/templates/network.html:406 networks/templates/network.html:445 #: nwfilters/templates/nwfilter.html:157 templates/common/form.html:28 +#: vmbackups/templates/vmbackups/policy_form.html:18 msgid "Save" msgstr "Kaydet" @@ -3949,7 +3953,7 @@ msgstr "Sunucunun bir havuzunda zaten bulunan bir birim." #: instances/templates/create_instance_w2.html:137 #: instances/templates/create_instance_w2.html:165 #: instances/templates/instances/move_disk.html:16 -#: instances/templates/instances/settings_tab.html:223 vmbackups/forms.py:13 +#: instances/templates/instances/settings_tab.html:223 vmbackups/forms.py:14 msgid "Storage pool" msgstr "Depolama havuzu" @@ -3961,8 +3965,8 @@ msgstr "Harf, rakam, nokta, tire ve alt çizgi." #: instances/templates/add_instance_volume.html:44 #: instances/templates/instances/settings_tab.html:851 -#: vmbackups/templates/vmbackups/index.html:45 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:47 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "Size" msgstr "Boyut" @@ -4121,8 +4125,9 @@ msgstr "Adres" #: instances/templates/allinstances.html:105 instances/views.py:240 #: interfaces/templates/interface.html:153 networks/templates/network.html:202 -#: vmbackups/templates/vmbackups/index.html:15 -#: vmbackups/templates/vmbackups/index.html:44 +#: vmbackups/templates/vmbackups/index.html:16 +#: vmbackups/templates/vmbackups/index.html:46 +#: vmbackups/templates/vmbackups/policy.html:29 msgid "VM" msgstr "VM" @@ -4142,6 +4147,7 @@ msgstr "%(name)s öğesini daralt veya genişlet" #: instances/templates/allinstances_index_grouped.html:40 #: nwfilters/templates/nwfilters.html:48 +#: vmbackups/templates/vmbackups/policies.html:23 #, python-format msgid "%(counter)s VM" msgid_plural "%(counter)s VMs" @@ -4556,6 +4562,7 @@ msgstr "İstatistikler" #: instances/templates/instance.html:112 templates/navbar.html:21 #: vmbackups/templates/vmbackups/index.html:6 #: vmbackups/templates/vmbackups/index.html:8 +#: vmbackups/templates/vmbackups/policies.html:9 #: vmbackups/templates/vmbackups/restore.html:9 #: vmbackups/templates/vmbackups/targets.html:17 msgid "Backups" @@ -6620,9 +6627,10 @@ msgstr "Çok fazla arama hâlâ çalışıyor; birazdan yeniden deneyin." #: operations/templates/operations/jobs.html:38 #: operations/templates/operations/jobs.html:62 #: storages/templates/storage.html:91 -#: vmbackups/templates/vmbackups/index.html:26 -#: vmbackups/templates/vmbackups/index.html:45 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:27 +#: vmbackups/templates/vmbackups/index.html:47 +#: vmbackups/templates/vmbackups/policies.html:17 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "State" msgstr "Durum" @@ -8286,8 +8294,8 @@ msgstr "Filtre oluştur" #: nwfilters/templates/nwfilter.html:15 nwfilters/templates/nwfilter.html:54 #: operations/templates/operations/jobs.html:46 -#: vmbackups/templates/vmbackups/index.html:13 -#: vmbackups/templates/vmbackups/index.html:36 +#: vmbackups/templates/vmbackups/index.html:14 +#: vmbackups/templates/vmbackups/index.html:38 msgid "Filter" msgstr "Filtre" @@ -8325,6 +8333,8 @@ msgid "Parameters" msgstr "Parametreler" #: nwfilters/templates/nwfilter.html:64 +#: vmbackups/templates/vmbackups/index.html:34 +#: vmbackups/templates/vmbackups/state.html:1 msgid "Missing" msgstr "Eksik" @@ -8568,6 +8578,7 @@ msgid "Resolution" msgstr "Çözüm" #: operations/templates/operations/job.html:81 +#: vmbackups/templates/vmbackups/policy.html:36 msgid "Started" msgstr "Başlangıç" @@ -8630,7 +8641,7 @@ msgid "All kinds" msgstr "Tüm türler" #: operations/templates/operations/jobs.html:39 -#: vmbackups/templates/vmbackups/index.html:28 +#: vmbackups/templates/vmbackups/index.html:29 msgid "All states" msgstr "Tüm durumlar" @@ -9724,23 +9735,23 @@ msgstr "" "Eski değerin yerini hemen alır; bir parolanın şifrelediği veriler yeniden " "şifrelenmez." -#: vmbackups/forms.py:12 vmbackups/forms.py:36 +#: vmbackups/forms.py:13 vmbackups/forms.py:37 msgid "Compute" msgstr "Sunucu" -#: vmbackups/forms.py:28 +#: vmbackups/forms.py:29 msgid "A backup target with this name exists" msgstr "Bu adla bir yedek hedefi zaten var" -#: vmbackups/forms.py:37 +#: vmbackups/forms.py:38 msgid "Storage pool for the disks" msgstr "Diskler için depolama havuzu" -#: vmbackups/forms.py:38 +#: vmbackups/forms.py:39 msgid "Connect the network" msgstr "Ağı bağla" -#: vmbackups/forms.py:39 +#: vmbackups/forms.py:40 msgid "" "The restored guest keeps the VM's addresses and host name: connected beside " "the VM, they clash." @@ -9748,15 +9759,51 @@ msgstr "" "Geri yüklenen konuk, sanal makinenin adreslerini ve ana bilgisayar adını " "taşır: sanal makinenin yanında ağa bağlanırsa çakışırlar." -#: vmbackups/forms.py:41 +#: vmbackups/forms.py:42 msgid "Start after restore" msgstr "Geri yüklendikten sonra başlat" -#: vmbackups/jobs.py:57 +#: vmbackups/forms.py:57 vmbackups/templates/vmbackups/vm_tab.html:13 +msgid "Backup target" +msgstr "Yedek hedefi" + +#: vmbackups/forms.py:57 +msgid "Every VM of a compute" +msgstr "Bir sunucunun bütün sanal makineleri" + +#: vmbackups/forms.py:58 +msgid "Or these VMs" +msgstr "Ya da bu sanal makineler" + +#: vmbackups/forms.py:58 vmbackups/templates/vmbackups/policies.html:16 +msgid "Daily at" +msgstr "Her gün saat" + +#: vmbackups/forms.py:58 +msgid "Backups to keep of each VM" +msgstr "Her sanal makineden tutulacak yedek sayısı" + +#: vmbackups/forms.py:59 vmbackups/templates/vmbackups/vm_tab.html:21 +msgid "Require frozen file systems" +msgstr "Dosya sistemlerinin dondurulmasını zorunlu kıl" + +#: vmbackups/forms.py:59 vmbackups/templates/vmbackups/policies.html:27 +msgid "Enabled" +msgstr "Etkin" + +#: vmbackups/forms.py:75 +msgid "Choose a compute or VMs, not both" +msgstr "Bir sunucu ya da sanal makineler seçin, ikisini birden değil" + +#: vmbackups/forms.py:80 vmbackups/jobs.py:57 #, 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" +#: vmbackups/forms.py:87 +msgid "Keep one backup at least" +msgstr "En az bir yedek tutun" + #: vmbackups/jobs.py:67 msgid "The VM must be running, paused or shut off to be backed up" msgstr "" @@ -9993,6 +10040,12 @@ msgstr "" "hedeften kaldırılır." #: vmbackups/templates/vmbackups/index.html:10 +#: vmbackups/templates/vmbackups/policies.html:9 +#: vmbackups/templates/vmbackups/policy.html:9 +msgid "Schedules" +msgstr "Zamanlamalar" + +#: vmbackups/templates/vmbackups/index.html:11 #: vmbackups/templates/vmbackups/target.html:7 #: vmbackups/templates/vmbackups/target.html:9 #: vmbackups/templates/vmbackups/targets.html:6 @@ -10000,57 +10053,141 @@ msgstr "" msgid "Backup targets" msgstr "Yedek hedefleri" -#: vmbackups/templates/vmbackups/index.html:16 +#: vmbackups/templates/vmbackups/index.html:17 msgid "VM name" msgstr "Sanal makine adı" -#: vmbackups/templates/vmbackups/index.html:19 -#: vmbackups/templates/vmbackups/index.html:44 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:20 +#: vmbackups/templates/vmbackups/index.html:46 +#: vmbackups/templates/vmbackups/policies.html:16 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "Target" msgstr "Hedef" -#: vmbackups/templates/vmbackups/index.html:21 +#: vmbackups/templates/vmbackups/index.html:22 msgid "All targets" msgstr "Tüm hedefler" -#: vmbackups/templates/vmbackups/index.html:29 +#: vmbackups/templates/vmbackups/index.html:30 #: vmbackups/templates/vmbackups/state.html:1 msgid "Ready" msgstr "Hazır" -#: vmbackups/templates/vmbackups/index.html:30 +#: vmbackups/templates/vmbackups/index.html:31 #: vmbackups/templates/vmbackups/state.html:1 msgid "Creating" msgstr "Oluşturuluyor" -#: vmbackups/templates/vmbackups/index.html:32 +#: vmbackups/templates/vmbackups/index.html:33 #: vmbackups/templates/vmbackups/state.html:1 msgid "Deleting" msgstr "Siliniyor" -#: vmbackups/templates/vmbackups/index.html:44 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:46 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "Time" msgstr "Zaman" -#: vmbackups/templates/vmbackups/index.html:44 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:46 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "Consistency" msgstr "Tutarlılık" -#: vmbackups/templates/vmbackups/index.html:53 +#: vmbackups/templates/vmbackups/index.html:46 +msgid "Schedule" +msgstr "Zamanlama" + +#: vmbackups/templates/vmbackups/index.html:55 msgid "removed" msgstr "kaldırıldı" -#: vmbackups/templates/vmbackups/index.html:67 +#: vmbackups/templates/vmbackups/index.html:60 +msgid "By hand" +msgstr "Elle" + +#: vmbackups/templates/vmbackups/index.html:70 msgid "No backup matches the filter." msgstr "Süzgece uyan yedek yok." -#: vmbackups/templates/vmbackups/index.html:69 +#: vmbackups/templates/vmbackups/index.html:72 msgid "No backup yet. Back a VM up from its Backups tab." msgstr "Henüz yedek yok. Bir sanal makineyi Yedekler sekmesinden yedekleyin." +#: vmbackups/templates/vmbackups/policies.html:6 +#: vmbackups/templates/vmbackups/policy.html:6 +msgid "Backup schedules" +msgstr "Yedekleme zamanlamaları" + +#: vmbackups/templates/vmbackups/policies.html:17 +msgid "Backups kept" +msgstr "Tutulan yedek" + +#: vmbackups/templates/vmbackups/policies.html:23 +#, python-format +msgid "Every VM of %(compute)s" +msgstr "%(compute)s üzerindeki bütün sanal makineler" + +#: vmbackups/templates/vmbackups/policies.html:27 +#: vmbackups/templates/vmbackups/vm_tab.html:34 +msgid "Disabled" +msgstr "Devre dışı" + +#: vmbackups/templates/vmbackups/policies.html:34 +msgid "No backup schedule yet." +msgstr "Henüz yedekleme zamanlaması yok." + +#: vmbackups/templates/vmbackups/policies.html:38 +msgid "Add a backup schedule" +msgstr "Yedekleme zamanlaması ekle" + +#: vmbackups/templates/vmbackups/policy.html:12 +#, python-format +msgid "Its jobs run as %(owner)s, who saved it last." +msgstr "İşleri, onu en son kaydeden %(owner)s olarak çalışır." + +#: vmbackups/templates/vmbackups/policy.html:21 +msgid "Delete this schedule? Its backups are kept." +msgstr "Bu zamanlama silinsin mi? Yedekleri tutulur." + +#: vmbackups/templates/vmbackups/policy.html:21 +msgid "Delete schedule" +msgstr "Zamanlamayı sil" + +#: vmbackups/templates/vmbackups/policy.html:25 +msgid "Runs" +msgstr "Çalışmalar" + +#: vmbackups/templates/vmbackups/policy.html:29 +msgid "Day" +msgstr "Gün" + +#: vmbackups/templates/vmbackups/policy.html:36 +msgid "Backup job" +msgstr "Yedekleme işi" + +#: vmbackups/templates/vmbackups/policy.html:37 +msgid "Skipped" +msgstr "Atlandı" + +#: vmbackups/templates/vmbackups/policy.html:47 +msgid "No run yet." +msgstr "Henüz çalışma yok." + +#: vmbackups/templates/vmbackups/policy_form.html:12 +#, python-format +msgid "Time zone: %(time_zone)s" +msgstr "Saat dilimi: %(time_zone)s" + +#: vmbackups/templates/vmbackups/policy_form.html:17 +msgid "" +"Each VM is backed up once a day, starting at the time; a VM that has not " +"started within 6 hours waits for the next day. Older backups of each VM " +"beyond the number kept are deleted; backups taken by hand are not." +msgstr "" +"Her sanal makine günde bir kez, bu saatten başlayarak yedeklenir; 6 saat " +"içinde başlamayan bir sanal makine ertesi günü bekler. Her sanal makinenin " +"tutulan sayıyı aşan eski yedekleri silinir; elle alınan yedekler silinmez." + #: vmbackups/templates/vmbackups/restore.html:12 #, python-format msgid "" @@ -10060,6 +10197,10 @@ msgstr "" "%(vm)s sanal makinesinin %(time)s tarihli, %(target)s hedefindeki yedeği " "kendi UUID'si ve MAC adresleriyle yeni bir sanal makine olarak geri yüklenir." +#: vmbackups/templates/vmbackups/state.html:1 +msgid "Files of the backup are missing from the target" +msgstr "Yedeğin dosyaları hedefte yok" + #: vmbackups/templates/vmbackups/target.html:13 #, python-format msgid "%(counter)s backup." @@ -10138,14 +10279,6 @@ msgstr "Yedek hedefi ekle" msgid "Back up now" msgstr "Şimdi yedekle" -#: vmbackups/templates/vmbackups/vm_tab.html:13 -msgid "Backup target" -msgstr "Yedek hedefi" - -#: vmbackups/templates/vmbackups/vm_tab.html:21 -msgid "Require frozen file systems" -msgstr "Dosya sistemlerinin dondurulmasını zorunlu kıl" - #: vmbackups/templates/vmbackups/vm_tab.html:28 msgid "" "A running VM keeps running: its disks are copied from one instant, its file " @@ -10156,11 +10289,15 @@ msgstr "" " konuk ajanı yanıt verirse dosya sistemleri o an için dondurulur, vermezse " "yedek çökme tutarlıdır. Bellek saklanmaz." -#: vmbackups/templates/vmbackups/vm_tab.html:53 +#: vmbackups/templates/vmbackups/vm_tab.html:33 +msgid "Schedules:" +msgstr "Zamanlamalar:" + +#: vmbackups/templates/vmbackups/vm_tab.html:58 msgid "No backup of this VM yet." msgstr "Bu sanal makinenin henüz yedeği yok." -#: vmbackups/utils.py:27 +#: vmbackups/utils.py:28 #, python-format msgid "" "Volume %(volume)s belongs to a backup of %(vm)s; delete the backup on the " @@ -10168,7 +10305,7 @@ msgid "" msgstr "" "%(volume)s birimi %(vm)s yedeğine ait; yedeği Yedekler sayfasından silin" -#: vmbackups/utils.py:37 +#: vmbackups/utils.py:38 #, python-format msgid "" "Storage pool %(pool)s is backup target %(target)s; remove it from the target " @@ -10176,17 +10313,22 @@ msgid "" msgstr "" "%(pool)s depolama havuzu %(target)s yedek hedefidir; önce hedeften çıkarın" -#: vmbackups/utils.py:49 +#: vmbackups/utils.py:50 msgid "No backup target has a storage pool on this VM's host." msgstr "" "Hiçbir yedek hedefinin bu sanal makinenin sunucusunda depolama havuzu yok." -#: vmbackups/views.py:67 vmbackups/views.py:85 +#: vmbackups/views.py:68 vmbackups/views.py:89 #, python-format msgid "Backup target %(target)s has backups; delete them first" msgstr "%(target)s yedek hedefinde yedekler var; önce onları silin" -#: vmbackups/views.py:102 +#: vmbackups/views.py:71 +#, python-format +msgid "Backup target %(target)s has schedules; delete them first" +msgstr "%(target)s yedek hedefinin zamanlamaları var; önce onları silin" + +#: vmbackups/views.py:106 #, python-format msgid "" "Storage pool %(pool)s of %(compute)s is not the same directory as storage " @@ -10195,7 +10337,7 @@ msgstr "" "%(compute)s sunucusunun %(pool)s depolama havuzu, %(other_compute)s " "sunucusunun %(other)s depolama havuzuyla aynı dizin değil" -#: vmbackups/views.py:134 +#: vmbackups/views.py:138 msgid "Choose a backup target" msgstr "Bir yedek hedefi seçin" diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index 68d96aa1..8915b281 100644 Binary files a/locale/zh/LC_MESSAGES/django.mo and b/locale/zh/LC_MESSAGES/django.mo differ diff --git a/locale/zh/LC_MESSAGES/django.po b/locale/zh/LC_MESSAGES/django.po index bf688f3c..fb70e7b5 100644 --- a/locale/zh/LC_MESSAGES/django.po +++ b/locale/zh/LC_MESSAGES/django.po @@ -72,7 +72,8 @@ msgstr "无效的密钥" #: interfaces/templates/interface.html:119 networks/templates/network.html:145 #: networks/templates/network.html:373 nwfilters/templates/nwfilters.html:29 #: storages/templates/storage.html:123 virtsecrets/forms.py:34 -#: virtsecrets/forms.py:36 vmbackups/forms.py:22 vmbackups/forms.py:35 +#: virtsecrets/forms.py:36 vmbackups/forms.py:23 vmbackups/forms.py:36 +#: vmbackups/forms.py:57 vmbackups/templates/vmbackups/policies.html:16 #: vmbackups/templates/vmbackups/targets.html:17 msgid "Name" msgstr "名称" @@ -215,7 +216,7 @@ msgstr "用户页面导航" #: accounts/templates/account.html:50 accounts/templates/account.html:58 #: admin/forms.py:207 computes/templates/computes/list.html:33 #: computes/templates/computes/list.html:60 computes/templates/overview.html:90 -#: instances/views.py:263 +#: instances/views.py:263 vmbackups/templates/vmbackups/policies.html:16 msgid "VMs" msgstr "虚拟机" @@ -940,6 +941,7 @@ msgstr "消息" #: admin/templates/admin/logs.html:43 #: instances/templates/instances/stats_tab.html:72 +#: vmbackups/templates/vmbackups/policy.html:29 msgid "Result" msgstr "结果" @@ -958,7 +960,8 @@ msgstr "完成" #: admin/templates/admin/logs.html:56 admin/views.py:395 logs/views.py:18 #: operations/templates/operations/job.html:107 -#: vmbackups/templates/vmbackups/index.html:31 +#: vmbackups/templates/vmbackups/index.html:32 +#: vmbackups/templates/vmbackups/policy.html:38 #: vmbackups/templates/vmbackups/state.html:1 msgid "Failed" msgstr "失败" @@ -2353,6 +2356,7 @@ msgstr "无" #: networks/templates/network.html:337 networks/templates/network.html:379 #: networks/templates/network.html:406 networks/templates/network.html:445 #: nwfilters/templates/nwfilter.html:157 templates/common/form.html:28 +#: vmbackups/templates/vmbackups/policy_form.html:18 msgid "Save" msgstr "保存" @@ -3750,7 +3754,7 @@ msgstr "主机存储池中已有的卷。" #: instances/templates/create_instance_w2.html:137 #: instances/templates/create_instance_w2.html:165 #: instances/templates/instances/move_disk.html:16 -#: instances/templates/instances/settings_tab.html:223 vmbackups/forms.py:13 +#: instances/templates/instances/settings_tab.html:223 vmbackups/forms.py:14 msgid "Storage pool" msgstr "存储池" @@ -3762,8 +3766,8 @@ msgstr "字母、数字、点、短横线和下划线。" #: instances/templates/add_instance_volume.html:44 #: instances/templates/instances/settings_tab.html:851 -#: vmbackups/templates/vmbackups/index.html:45 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:47 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "Size" msgstr "大小" @@ -3917,8 +3921,9 @@ msgstr "地址" #: instances/templates/allinstances.html:105 instances/views.py:240 #: interfaces/templates/interface.html:153 networks/templates/network.html:202 -#: vmbackups/templates/vmbackups/index.html:15 -#: vmbackups/templates/vmbackups/index.html:44 +#: vmbackups/templates/vmbackups/index.html:16 +#: vmbackups/templates/vmbackups/index.html:46 +#: vmbackups/templates/vmbackups/policy.html:29 msgid "VM" msgstr "虚拟机" @@ -3938,6 +3943,7 @@ msgstr "折叠或展开 %(name)s" #: instances/templates/allinstances_index_grouped.html:40 #: nwfilters/templates/nwfilters.html:48 +#: vmbackups/templates/vmbackups/policies.html:23 #, python-format msgid "%(counter)s VM" msgid_plural "%(counter)s VMs" @@ -4341,6 +4347,7 @@ msgstr "统计" #: instances/templates/instance.html:112 templates/navbar.html:21 #: vmbackups/templates/vmbackups/index.html:6 #: vmbackups/templates/vmbackups/index.html:8 +#: vmbackups/templates/vmbackups/policies.html:9 #: vmbackups/templates/vmbackups/restore.html:9 #: vmbackups/templates/vmbackups/targets.html:17 msgid "Backups" @@ -6239,9 +6246,10 @@ msgstr "仍在运行的搜索过多;请稍后再试。" #: operations/templates/operations/jobs.html:38 #: operations/templates/operations/jobs.html:62 #: storages/templates/storage.html:91 -#: vmbackups/templates/vmbackups/index.html:26 -#: vmbackups/templates/vmbackups/index.html:45 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:27 +#: vmbackups/templates/vmbackups/index.html:47 +#: vmbackups/templates/vmbackups/policies.html:17 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "State" msgstr "状态" @@ -7800,8 +7808,8 @@ msgstr "创建过滤器" #: nwfilters/templates/nwfilter.html:15 nwfilters/templates/nwfilter.html:54 #: operations/templates/operations/jobs.html:46 -#: vmbackups/templates/vmbackups/index.html:13 -#: vmbackups/templates/vmbackups/index.html:36 +#: vmbackups/templates/vmbackups/index.html:14 +#: vmbackups/templates/vmbackups/index.html:38 msgid "Filter" msgstr "过滤器" @@ -7839,6 +7847,8 @@ msgid "Parameters" msgstr "参数" #: nwfilters/templates/nwfilter.html:64 +#: vmbackups/templates/vmbackups/index.html:34 +#: vmbackups/templates/vmbackups/state.html:1 msgid "Missing" msgstr "缺失" @@ -8072,6 +8082,7 @@ msgid "Resolution" msgstr "处理结论" #: operations/templates/operations/job.html:81 +#: vmbackups/templates/vmbackups/policy.html:36 msgid "Started" msgstr "开始时间" @@ -8132,7 +8143,7 @@ msgid "All kinds" msgstr "所有类型" #: operations/templates/operations/jobs.html:39 -#: vmbackups/templates/vmbackups/index.html:28 +#: vmbackups/templates/vmbackups/index.html:29 msgid "All states" msgstr "所有状态" @@ -9169,37 +9180,73 @@ msgid "" "encrypted anew." msgstr "新值会立即替换旧值;之前用口令加密的内容不会重新加密。" -#: vmbackups/forms.py:12 vmbackups/forms.py:36 +#: vmbackups/forms.py:13 vmbackups/forms.py:37 msgid "Compute" msgstr "计算节点" -#: vmbackups/forms.py:28 +#: vmbackups/forms.py:29 msgid "A backup target with this name exists" msgstr "已存在同名的备份目标" -#: vmbackups/forms.py:37 +#: vmbackups/forms.py:38 msgid "Storage pool for the disks" msgstr "磁盘的存储池" -#: vmbackups/forms.py:38 +#: vmbackups/forms.py:39 msgid "Connect the network" msgstr "连接网络" -#: vmbackups/forms.py:39 +#: vmbackups/forms.py:40 msgid "" "The restored guest keeps the VM's addresses and host name: connected beside " "the VM, they clash." msgstr "恢复的客户机保留虚拟机的地址和主机名:与原虚拟机同时联网会发生冲突。" -#: vmbackups/forms.py:41 +#: vmbackups/forms.py:42 msgid "Start after restore" msgstr "恢复后启动" -#: vmbackups/jobs.py:57 +#: vmbackups/forms.py:57 vmbackups/templates/vmbackups/vm_tab.html:13 +msgid "Backup target" +msgstr "备份目标" + +#: vmbackups/forms.py:57 +msgid "Every VM of a compute" +msgstr "某计算节点的所有虚拟机" + +#: vmbackups/forms.py:58 +msgid "Or these VMs" +msgstr "或这些虚拟机" + +#: vmbackups/forms.py:58 vmbackups/templates/vmbackups/policies.html:16 +msgid "Daily at" +msgstr "每天时间" + +#: vmbackups/forms.py:58 +msgid "Backups to keep of each VM" +msgstr "每台虚拟机保留的备份数" + +#: vmbackups/forms.py:59 vmbackups/templates/vmbackups/vm_tab.html:21 +msgid "Require frozen file systems" +msgstr "要求冻结文件系统" + +#: vmbackups/forms.py:59 vmbackups/templates/vmbackups/policies.html:27 +msgid "Enabled" +msgstr "已启用" + +#: vmbackups/forms.py:75 +msgid "Choose a compute or VMs, not both" +msgstr "请选择一个计算节点或若干虚拟机,不能同时选择" + +#: vmbackups/forms.py:80 vmbackups/jobs.py:57 #, python-format msgid "Backup target %(target)s has no storage pool on %(compute)s" msgstr "备份目标 %(target)s 在 %(compute)s 上没有存储池" +#: vmbackups/forms.py:87 +msgid "Keep one backup at least" +msgstr "至少保留一个备份" + #: vmbackups/jobs.py:67 msgid "The VM must be running, paused or shut off to be backed up" msgstr "虚拟机必须处于运行、暂停或关闭状态才能备份" @@ -9413,6 +9460,12 @@ msgid "" msgstr "要删除 %(vm)s 在 %(time)s 的备份吗?其文件将从目标中移除。" #: vmbackups/templates/vmbackups/index.html:10 +#: vmbackups/templates/vmbackups/policies.html:9 +#: vmbackups/templates/vmbackups/policy.html:9 +msgid "Schedules" +msgstr "计划" + +#: vmbackups/templates/vmbackups/index.html:11 #: vmbackups/templates/vmbackups/target.html:7 #: vmbackups/templates/vmbackups/target.html:9 #: vmbackups/templates/vmbackups/targets.html:6 @@ -9420,57 +9473,138 @@ msgstr "要删除 %(vm)s 在 %(time)s 的备份吗?其文件将从目标中移 msgid "Backup targets" msgstr "备份目标" -#: vmbackups/templates/vmbackups/index.html:16 +#: vmbackups/templates/vmbackups/index.html:17 msgid "VM name" msgstr "虚拟机名称" -#: vmbackups/templates/vmbackups/index.html:19 -#: vmbackups/templates/vmbackups/index.html:44 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:20 +#: vmbackups/templates/vmbackups/index.html:46 +#: vmbackups/templates/vmbackups/policies.html:16 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "Target" msgstr "目标" -#: vmbackups/templates/vmbackups/index.html:21 +#: vmbackups/templates/vmbackups/index.html:22 msgid "All targets" msgstr "所有目标" -#: vmbackups/templates/vmbackups/index.html:29 +#: vmbackups/templates/vmbackups/index.html:30 #: vmbackups/templates/vmbackups/state.html:1 msgid "Ready" msgstr "就绪" -#: vmbackups/templates/vmbackups/index.html:30 +#: vmbackups/templates/vmbackups/index.html:31 #: vmbackups/templates/vmbackups/state.html:1 msgid "Creating" msgstr "正在创建" -#: vmbackups/templates/vmbackups/index.html:32 +#: vmbackups/templates/vmbackups/index.html:33 #: vmbackups/templates/vmbackups/state.html:1 msgid "Deleting" msgstr "正在删除" -#: vmbackups/templates/vmbackups/index.html:44 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:46 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "Time" msgstr "时间" -#: vmbackups/templates/vmbackups/index.html:44 -#: vmbackups/templates/vmbackups/vm_tab.html:36 +#: vmbackups/templates/vmbackups/index.html:46 +#: vmbackups/templates/vmbackups/vm_tab.html:41 msgid "Consistency" msgstr "一致性" -#: vmbackups/templates/vmbackups/index.html:53 +#: vmbackups/templates/vmbackups/index.html:46 +msgid "Schedule" +msgstr "计划" + +#: vmbackups/templates/vmbackups/index.html:55 msgid "removed" msgstr "已移除" -#: vmbackups/templates/vmbackups/index.html:67 +#: vmbackups/templates/vmbackups/index.html:60 +msgid "By hand" +msgstr "手动" + +#: vmbackups/templates/vmbackups/index.html:70 msgid "No backup matches the filter." msgstr "没有符合筛选条件的备份。" -#: vmbackups/templates/vmbackups/index.html:69 +#: vmbackups/templates/vmbackups/index.html:72 msgid "No backup yet. Back a VM up from its Backups tab." msgstr "还没有备份。请在虚拟机的备份选项卡中备份虚拟机。" +#: vmbackups/templates/vmbackups/policies.html:6 +#: vmbackups/templates/vmbackups/policy.html:6 +msgid "Backup schedules" +msgstr "备份计划" + +#: vmbackups/templates/vmbackups/policies.html:17 +msgid "Backups kept" +msgstr "保留的备份数" + +#: vmbackups/templates/vmbackups/policies.html:23 +#, python-format +msgid "Every VM of %(compute)s" +msgstr "%(compute)s 的所有虚拟机" + +#: vmbackups/templates/vmbackups/policies.html:27 +#: vmbackups/templates/vmbackups/vm_tab.html:34 +msgid "Disabled" +msgstr "已禁用" + +#: vmbackups/templates/vmbackups/policies.html:34 +msgid "No backup schedule yet." +msgstr "还没有备份计划。" + +#: vmbackups/templates/vmbackups/policies.html:38 +msgid "Add a backup schedule" +msgstr "添加备份计划" + +#: vmbackups/templates/vmbackups/policy.html:12 +#, python-format +msgid "Its jobs run as %(owner)s, who saved it last." +msgstr "其作业以最后保存它的 %(owner)s 的身份运行。" + +#: vmbackups/templates/vmbackups/policy.html:21 +msgid "Delete this schedule? Its backups are kept." +msgstr "要删除此计划吗?其备份将保留。" + +#: vmbackups/templates/vmbackups/policy.html:21 +msgid "Delete schedule" +msgstr "删除计划" + +#: vmbackups/templates/vmbackups/policy.html:25 +msgid "Runs" +msgstr "运行记录" + +#: vmbackups/templates/vmbackups/policy.html:29 +msgid "Day" +msgstr "日期" + +#: vmbackups/templates/vmbackups/policy.html:36 +msgid "Backup job" +msgstr "备份作业" + +#: vmbackups/templates/vmbackups/policy.html:37 +msgid "Skipped" +msgstr "已跳过" + +#: vmbackups/templates/vmbackups/policy.html:47 +msgid "No run yet." +msgstr "还没有运行记录。" + +#: vmbackups/templates/vmbackups/policy_form.html:12 +#, python-format +msgid "Time zone: %(time_zone)s" +msgstr "时区:%(time_zone)s" + +#: vmbackups/templates/vmbackups/policy_form.html:17 +msgid "" +"Each VM is backed up once a day, starting at the time; a VM that has not " +"started within 6 hours waits for the next day. Older backups of each VM " +"beyond the number kept are deleted; backups taken by hand are not." +msgstr "每台虚拟机每天从该时间开始备份一次;6 小时内未开始的虚拟机将等待第二天。每台虚拟机超出保留数量的旧备份会被删除;手动创建的备份不会被删除。" + #: vmbackups/templates/vmbackups/restore.html:12 #, python-format msgid "" @@ -9478,6 +9612,10 @@ msgid "" "with its own UUID and MAC addresses." msgstr "%(vm)s 在 %(time)s 的备份(位于 %(target)s)将恢复为一台拥有自己 UUID 和 MAC 地址的新虚拟机。" +#: vmbackups/templates/vmbackups/state.html:1 +msgid "Files of the backup are missing from the target" +msgstr "备份的文件在目标中缺失" + #: vmbackups/templates/vmbackups/target.html:13 #, python-format msgid "%(counter)s backup." @@ -9545,14 +9683,6 @@ msgstr "添加备份目标" msgid "Back up now" msgstr "立即备份" -#: vmbackups/templates/vmbackups/vm_tab.html:13 -msgid "Backup target" -msgstr "备份目标" - -#: vmbackups/templates/vmbackups/vm_tab.html:21 -msgid "Require frozen file systems" -msgstr "要求冻结文件系统" - #: vmbackups/templates/vmbackups/vm_tab.html:28 msgid "" "A running VM keeps running: its disks are copied from one instant, its file " @@ -9560,41 +9690,50 @@ msgid "" "backup is crash-consistent. Memory is not kept." msgstr "运行中的虚拟机会继续运行:其磁盘从同一时刻复制;客户机代理响应时,文件系统在该时刻被冻结,否则备份为崩溃一致。不保存内存。" -#: vmbackups/templates/vmbackups/vm_tab.html:53 +#: vmbackups/templates/vmbackups/vm_tab.html:33 +msgid "Schedules:" +msgstr "计划:" + +#: vmbackups/templates/vmbackups/vm_tab.html:58 msgid "No backup of this VM yet." msgstr "此虚拟机还没有备份。" -#: vmbackups/utils.py:27 +#: vmbackups/utils.py:28 #, python-format msgid "" "Volume %(volume)s belongs to a backup of %(vm)s; delete the backup on the " "Backups page" msgstr "卷 %(volume)s 属于 %(vm)s 的备份;请在备份页面删除该备份" -#: vmbackups/utils.py:37 +#: vmbackups/utils.py:38 #, python-format msgid "" "Storage pool %(pool)s is backup target %(target)s; remove it from the target " "first" msgstr "存储池 %(pool)s 是备份目标 %(target)s;请先将其从目标中移除" -#: vmbackups/utils.py:49 +#: vmbackups/utils.py:50 msgid "No backup target has a storage pool on this VM's host." msgstr "没有备份目标在此虚拟机的主机上有存储池。" -#: vmbackups/views.py:67 vmbackups/views.py:85 +#: vmbackups/views.py:68 vmbackups/views.py:89 #, python-format msgid "Backup target %(target)s has backups; delete them first" msgstr "备份目标 %(target)s 中有备份;请先删除它们" -#: vmbackups/views.py:102 +#: vmbackups/views.py:71 +#, python-format +msgid "Backup target %(target)s has schedules; delete them first" +msgstr "备份目标 %(target)s 有计划;请先删除它们" + +#: vmbackups/views.py:106 #, python-format msgid "" "Storage pool %(pool)s of %(compute)s is not the same directory as storage " "pool %(other)s of %(other_compute)s" msgstr "%(compute)s 的存储池 %(pool)s 与 %(other_compute)s 的存储池 %(other)s 不是同一目录" -#: vmbackups/views.py:134 +#: vmbackups/views.py:138 msgid "Choose a backup target" msgstr "请选择备份目标" diff --git a/vmbackups/forms.py b/vmbackups/forms.py index 9444ac2b..2fd49bb4 100644 --- a/vmbackups/forms.py +++ b/vmbackups/forms.py @@ -2,8 +2,9 @@ from django import forms from django.utils.translation import gettext_lazy as _ from computes.models import Compute +from instances.models import Instance -from .models import BackupTarget +from .models import BackupPolicy, BackupTarget class TargetPoolForm(forms.Form): @@ -44,3 +45,43 @@ class RestoreForm(forms.Form): super().__init__(*args, **kwargs) self.fields["compute"].queryset = Compute.objects.filter(backuptargetpool__target=backup.target).order_by("name") self.fields["name"].initial = f"{backup.vm_name}-restored" + + +class PolicyForm(forms.ModelForm): + """A backup schedule: a compute's VMs or chosen VMs, all on hosts that + have a pool of its target.""" + + class Meta: + model = BackupPolicy + fields = ["name", "target", "compute", "instances", "time", "keep", "frozen", "enabled"] + labels = {"name": _("Name"), "target": _("Backup target"), "compute": _("Every VM of a compute"), + "instances": _("Or these VMs"), "time": _("Daily at"), "keep": _("Backups to keep of each VM"), + "frozen": _("Require frozen file systems"), "enabled": _("Enabled")} + widgets = {"time": forms.TimeInput(attrs={"type": "time"}, format="%H:%M"), + "instances": forms.SelectMultiple(attrs={"data-searchable": "1"})} + + def __init__(self, *args, **kwargs): + super().__init__(*args, **kwargs) + self.fields["instances"].queryset = Instance.objects.filter(is_template=False).select_related("compute").order_by( + "name") + self.fields["instances"].label_from_instance = lambda vm: f"{vm.name} ({vm.compute.name})" + self.fields["keep"].validators.append(_min_one) + self.fields["keep"].widget.attrs["min"] = 1 + + def clean(self): + data = super().clean() + compute, vms, target = data.get("compute"), data.get("instances"), data.get("target") + if bool(compute) == bool(vms): + raise forms.ValidationError(_("Choose a compute or VMs, not both")) + if target is not None: + hosts = {compute} if compute else {vm.compute for vm in vms} + for host in sorted(hosts, key=lambda c: c.name): + if target.pool_on(host) is None: + raise forms.ValidationError(_("Backup target %(target)s has no storage pool on %(compute)s"), + params={"target": target.name, "compute": host.name}) + return data + + +def _min_one(value): + if value < 1: + raise forms.ValidationError(_("Keep one backup at least")) diff --git a/vmbackups/templates/vmbackups/index.html b/vmbackups/templates/vmbackups/index.html index 4c930d30..43b5c451 100644 --- a/vmbackups/templates/vmbackups/index.html +++ b/vmbackups/templates/vmbackups/index.html @@ -7,7 +7,8 @@ {% block page_heading %}{% trans "Backups" %}{% endblock page_heading %} -{% block page_heading_extra %}{% bs_icon 'hdd-network' %} {% trans "Backup targets" %}{% endblock page_heading_extra %} +{% block page_heading_extra %}{% bs_icon 'list-task' %} {% trans "Schedules" %} +{% bs_icon 'hdd-network' %} {% trans "Backup targets" %}{% endblock page_heading_extra %} {% block content %}