diff --git a/instances/jobs.py b/instances/jobs.py index 4c020732..dfbef7f0 100644 --- a/instances/jobs.py +++ b/instances/jobs.py @@ -970,7 +970,17 @@ class CreateInstance(Kind): def plan(self, user, params): compute = Compute.objects.get(pk=params["compute"]) - return Plan(claims=vm_claims(compute, params["name"]), resource=claims.compute_key(compute.pk), + keys = vm_claims(compute, params["name"]) + # the volumes it is made from: not while a download writes them; a writable one + # exclusive, as an attach holds it, a template or an image in a CD-ROM shared + if params["template"]: + keys[claims.volume_key(compute.pk, params["template_pool"], params["template"])] = Claim.SHARED + for image, (device, _bus) in zip(filter(None, params["images"].split(",")), params["devices"]): + pool, _sep, name = image.partition("/") + key = claims.volume_key(compute.pk, pool, name) + if keys.get(key) != Claim.EXCLUSIVE: # one given twice keeps its writable claim + keys[key] = Claim.SHARED if device == "cdrom" else Claim.EXCLUSIVE + return Plan(claims=keys, resource=claims.compute_key(compute.pk), label=f"{compute.name}/{params['name']}", intent={"compute": compute.pk, "uuid": str(uuid4()), "name": params["name"]}) diff --git a/instances/tests/test_create_instance.py b/instances/tests/test_create_instance.py index d3582036..d7ba0a24 100644 --- a/instances/tests/test_create_instance.py +++ b/instances/tests/test_create_instance.py @@ -13,7 +13,8 @@ from instances.api.serializers import CreateInstanceSerializer from instances.models import Instance from instances.utils import nic_macs from operations.jobs import Context, Outcome, finish, get_kind -from operations.models import Operation, acquire +from operations.claims import admit +from operations.models import Claim, Operation, acquire wvm_create = MagicMock() # the page and the job reach the same host @@ -47,6 +48,25 @@ class CreateInstanceViewTests(TestCase): self.assertEqual(conn.create_instance.call_args.kwargs["volumes"][0]["bus"], "virtio") self.assertTrue(Instance.objects.filter(name="new-vm").exists()) + @patch("instances.views.wvmCreate", new=wvm_create) + @patch("instances.views.NewVMForm") + def test_the_volumes_it_is_made_from_are_claimed(self, form_class): + # not while a download writes them: an existing disk exclusive, a template shared + self.create(form_class) + compute = Compute.objects.get() + self.assertIn((f"volume:{compute.pk}:pool-b/base.qcow2", Claim.EXCLUSIVE), + set(Claim.objects.values_list("resource", "mode"))) + Operation.objects.all().delete() + self.create(form_class, images="", template="base.qcow2", template_pool="pool-b", storage="default") + self.assertIn((f"volume:{compute.pk}:pool-b/base.qcow2", Claim.SHARED), + set(Claim.objects.values_list("resource", "mode"))) + Operation.objects.all().delete() + admit({f"volume:{compute.pk}:pool-b/base.qcow2": Claim.EXCLUSIVE}, holder="other-node:1:1") + response, _conn = self.create(form_class) + self.assertIn("A short operation is in progress on this resource; try again in a moment.", + [str(m) for m in get_messages(response.wsgi_request)]) + self.assertFalse(Operation.objects.exists()) + @patch("instances.views.wvmCreate", new=wvm_create) @patch("instances.views.NewVMForm") def test_a_volume_is_taken_from_its_own_pool(self, form_class): diff --git a/instances/tests/test_duplicate_devices.py b/instances/tests/test_duplicate_devices.py index cf32471d..55696775 100644 --- a/instances/tests/test_duplicate_devices.py +++ b/instances/tests/test_duplicate_devices.py @@ -13,6 +13,7 @@ from computes.models import Compute from instances.models import Instance from operations.claims import admit from operations.models import Claim +from vrtManager import util PATH = "/var/lib/libvirt/images/data.qcow2" MAC = "52:54:00:aa:bb:cc" @@ -95,9 +96,28 @@ class DuplicateDeviceTests(TestCase): [f"The VM already has a network device with MAC {MAC.upper()}"]) self.proxy.add_network.assert_called_once() + def test_an_iso_a_download_writes_is_not_added_or_inserted(self): + self.proxy.iso_location.return_value = ("isos", "/var/lib/libvirt/isos/alma.iso") + admit({f"volume:{self.vm.compute_id}:isos/alma.iso": Claim.EXCLUSIVE}, holder="other-node:1:1") + busy = ["A short operation is in progress on this resource; try again in a moment."] + with patch("instances.views.cdrom_bus_choices", return_value=["sata"]): + self.assertEqual(self.post("add_cdrom", {"bus": "sata", "media": "alma.iso"}), busy) + self.assertEqual(self.post("mount_iso", {"mount_iso": "sda", "media": "alma.iso"})[-1:], busy) + self.proxy.attach_disk.assert_not_called() + self.proxy.mount_iso.assert_not_called() + + def test_an_iso_is_read_again_in_the_pool_claimed(self): + # another pool's image of that name (a download there) is not inserted under this pool's claim + from vrtManager.instance import wvmInstance + + vm = wvmInstance.__new__(wvmInstance) + with patch.object(wvmInstance, "iso_location", return_value=("other", "/other/alma.iso")), \ + self.assertRaisesMessage(util.OperationError, "no longer in pool isos"): + vm.iso_path_in("alma.iso", "isos") + def test_an_iso_in_a_cdrom_of_the_vm_is_not_added_again(self): iso = "/var/lib/libvirt/isos/alma.iso" - self.proxy.get_iso_path.return_value = iso + self.proxy.iso_location.return_value = ("isos", iso) with patch("instances.views.cdrom_bus_choices", return_value=["sata"]): form = {"bus": "sata", "media": "alma.iso"} self.post("add_cdrom", form) diff --git a/instances/tests/test_new_disk_name.py b/instances/tests/test_new_disk_name.py index 76435381..1d3212c0 100644 --- a/instances/tests/test_new_disk_name.py +++ b/instances/tests/test_new_disk_name.py @@ -32,7 +32,8 @@ class NewDiskNameTestCase(TestCase): proxy.get_disk_devices.side_effect = lambda **kw: list((config if kw.get("config") else live)[0]) proxy.get_media_devices.side_effect = lambda **kw: list((config if kw.get("config") else live)[1]) proxy.get_disk_bus_types.return_value = ["virtio", "sata", "scsi", "usb"] - proxy.get_iso_path.side_effect = lambda image: f"/iso/{image}" + proxy.iso_location.side_effect = lambda image: ("isos", f"/iso/{image}") + proxy.iso_path_in.side_effect = lambda image, pool: f"/iso/{image}" proxy.get_cache_modes.return_value = {"default": "", "none": ""} proxy.get_machine_type.return_value = "q35" proxy.get_status.return_value = status diff --git a/instances/views.py b/instances/views.py index 7dd8d4f9..c7a315da 100755 --- a/instances/views.py +++ b/instances/views.py @@ -1848,7 +1848,7 @@ def add_cdrom(request, pk): if bus == "usb" and not image: messages.error(request, _("A USB CD-ROM needs an ISO image: libvirt has no empty USB drive")) return _back(request, pk, "disks") - path = instance.proxy.get_iso_path(image) if image else "" + pool, path = instance.proxy.iso_location(image) if image else ("", "") # a form sent twice (a double click) adds the drive once if path and path in {media["path"] for media in instance.media + instance.config_media}: messages.error(request, _("%(image)s is already in a CD-ROM of this VM") % {"image": image}) @@ -1858,7 +1858,10 @@ def add_cdrom(request, pk): instance.media + instance.config_media, instance.disks + instance.config_disks, bus ) try: - with audit_vm(request, instance, f"add CD-ROM {target}" + (f" with {image}" if image else "")): + # the image shared: not inserted while a download writes it (Busy names the job) + with claims.hold({claims.volume_key(instance.compute_id, pool, image): Claim.SHARED} if image else {}), \ + audit_vm(request, instance, f"add CD-ROM {target}" + (f" with {image}" if image else "")): + path = instance.proxy.iso_path_in(image, pool) if image else "" # read again under the claim instance.proxy.attach_disk( target, path, @@ -1920,8 +1923,11 @@ def mount_iso(request, pk): image = request.POST.get("media", "") dev = request.POST.get("mount_iso", "") try: - with audit_vm(request, instance, f"insert media {image} into {dev}"): - instance.proxy.mount_iso(dev, image) + pool, _path = instance.proxy.iso_location(image) + # the image shared: not inserted while a download writes it (Busy names the job) + with claims.hold({claims.volume_key(instance.compute_id, pool, image): Claim.SHARED}), \ + audit_vm(request, instance, f"insert media {image} into {dev}"): + instance.proxy.mount_iso(dev, image, pool) except libvirtError as err: messages.error(request, err) return redirect(same_origin_referer(request, reverse("instances:instance", args=[pk])) + "#disks") diff --git a/locale/tr/LC_MESSAGES/django.mo b/locale/tr/LC_MESSAGES/django.mo index 914d54b4..6a22f977 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 46070e51..43ba6403 100644 --- a/locale/tr/LC_MESSAGES/django.po +++ b/locale/tr/LC_MESSAGES/django.po @@ -11,7 +11,7 @@ msgid "" msgstr "" "Project-Id-Version: PACKAGE VERSION\n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-20 12:24+0000\n" +"POT-Creation-Date: 2026-11-20 13:47+0000\n" "PO-Revision-Date: 2020-11-04 12:00+0000\n" "Last-Translator: catborise , 2020\n" "Language-Team: Turkish (https://www.transifex.com/catborise/teams/110663/tr/)\n" @@ -3548,8 +3548,8 @@ msgstr "" "VNC olarak değiştirin." #: instances/api/viewsets.py:160 instances/api/viewsets.py:178 -#: instances/jobs.py:1605 instances/views.py:1010 instances/views.py:1032 -#: instances/views.py:2030 +#: instances/jobs.py:1615 instances/views.py:1010 instances/views.py:1032 +#: instances/views.py:2036 msgid "Templates cannot be started." msgstr "Şablon makineler başlatılamaz." @@ -3621,7 +3621,7 @@ msgstr "" msgid "A password takes no line breaks or other control characters." msgstr "Parola satır sonu ya da başka denetim karakteri içeremez." -#: instances/forms.py:114 vrtManager/instance.py:1823 +#: instances/forms.py:114 vrtManager/instance.py:1835 msgid "" "The console listens on no address (on a network, a socket or nowhere); change" " it in the XML editor" @@ -3724,7 +3724,7 @@ msgstr "" msgid "Delete snapshot" msgstr "Anlık görüntüyü sil" -#: instances/jobs.py:366 vrtManager/instance.py:2591 +#: instances/jobs.py:366 vrtManager/instance.py:2603 #, python-format msgid "The VM has no external snapshot named %(name)s" msgstr "Sanal makinede %(name)s adında harici anlık görüntü yok" @@ -3759,7 +3759,7 @@ msgstr "Sanal makine artık işin çalıştığı sunucuda değil" msgid "Take snapshot" msgstr "Anlık görüntü al" -#: instances/jobs.py:437 instances/jobs.py:446 vrtManager/instance.py:2162 +#: instances/jobs.py:437 instances/jobs.py:446 vrtManager/instance.py:2174 #, python-format msgid "A snapshot named %(name)s already exists" msgstr "%(name)s adında bir anlık görüntü zaten var" @@ -3837,7 +3837,7 @@ msgstr "" msgid "Clone VM" msgstr "Sanal makineyi klonla" -#: instances/jobs.py:668 instances/jobs.py:675 instances/jobs.py:1017 +#: instances/jobs.py:668 instances/jobs.py:675 instances/jobs.py:1027 #: vmbackups/jobs.py:369 vmbackups/jobs.py:1076 vmbackups/jobs.py:1283 #: vmbackups/jobs.py:1459 msgid "Copying disks" @@ -3923,12 +3923,12 @@ msgstr "" msgid "Each network card needs a network" msgstr "Her ağ kartının bir ağı olmalı" -#: instances/jobs.py:880 vrtManager/backup.py:387 vrtManager/instance.py:3007 +#: instances/jobs.py:880 vrtManager/backup.py:387 vrtManager/instance.py:3019 #, python-format msgid "This host has no network %(name)s" msgstr "Bu sunucuda %(name)s ağı yok" -#: instances/jobs.py:882 vrtManager/backup.py:391 vrtManager/instance.py:3009 +#: instances/jobs.py:882 vrtManager/backup.py:391 vrtManager/instance.py:3021 #, python-format msgid "This host has no network filter %(name)s" msgstr "Bu sunucuda %(name)s ağ filtresi yok" @@ -3953,11 +3953,11 @@ msgstr "" msgid "Create VM" msgstr "Sanal makine oluştur" -#: instances/jobs.py:940 instances/jobs.py:987 instances/views.py:2826 +#: instances/jobs.py:940 instances/jobs.py:997 instances/views.py:2832 msgid "A virtual machine with this name already exists" msgstr "Bu isimde bir sanal makine mevcut" -#: instances/jobs.py:942 instances/jobs.py:982 +#: instances/jobs.py:942 instances/jobs.py:992 msgid "There is an instance with same name. Remove it and try again!" msgstr "Aynı isimde başka bir sanal makine var. Onu silip yeniden deneyin!" @@ -4002,19 +4002,19 @@ msgstr "cloud-init tohumu, disk için bir dizin depolama havuzu gerektirir" msgid "This host offers no firmware %(firmware)s" msgstr "Bu sunucu %(firmware)s firmware'ini sunmuyor" -#: instances/jobs.py:969 vrtManager/instance.py:3357 +#: instances/jobs.py:969 vrtManager/instance.py:3369 msgid "This host offers no TPM 2.0: install swtpm on it" msgstr "Bu sunucu TPM 2.0 sunmuyor: üzerine swtpm kurun" -#: instances/jobs.py:1037 +#: instances/jobs.py:1047 msgid "Writing the cloud-init seed" msgstr "cloud-init tohumu yazılıyor" -#: instances/jobs.py:1044 +#: instances/jobs.py:1054 msgid "Defining the VM" msgstr "Sanal makine tanımlanıyor" -#: instances/jobs.py:1086 +#: instances/jobs.py:1096 #, python-format msgid "" "The panel failed unexpectedly; its log has the details. Remove these volumes " @@ -4023,122 +4023,122 @@ msgstr "" "Panel beklenmedik bir hatayla karşılaştı; ayrıntılar panelin günlüğünde. Bu " "birimleri elle kaldırın: %(volumes)s" -#: instances/jobs.py:1090 +#: instances/jobs.py:1100 #, python-format msgid "%(error)s. Remove these volumes by hand: %(volumes)s" msgstr "%(error)s. Şu birimleri elle silin: %(volumes)s" -#: instances/jobs.py:1118 +#: instances/jobs.py:1128 #, python-format msgid "The instance is already on %(compute)s" msgstr "Sanal makine zaten %(compute)s üzerinde" -#: instances/jobs.py:1121 +#: instances/jobs.py:1131 #, python-format msgid "%(compute)s is not reachable" msgstr "%(compute)s sunucusuna ulaşılamıyor" -#: instances/jobs.py:1123 +#: instances/jobs.py:1133 #, python-format msgid "%(compute)s is the VM's own host under another name" msgstr "%(compute)s, sanal makinenin kendi sunucusunun başka bir adı" -#: instances/jobs.py:1180 +#: instances/jobs.py:1190 #, python-format msgid "" "The VM migrated, but autostart could not be set on the destination: %(error)s" msgstr "" "Sanal makine taşındı, ancak hedefte otomatik başlatma ayarlanamadı: %(error)s" -#: instances/jobs.py:1187 +#: instances/jobs.py:1197 #, python-format msgid "The VM migrated, but its NVRAM file stays on the source: %(error)s" msgstr "Sanal makine taşındı, ancak NVRAM dosyası kaynakta kaldı: %(error)s" -#: instances/jobs.py:1195 +#: instances/jobs.py:1205 msgid "Migrate VM" msgstr "Sanal makineyi taşı" -#: instances/jobs.py:1249 +#: instances/jobs.py:1259 msgid "Migrating the VM" msgstr "Sanal makine taşınıyor" -#: instances/jobs.py:1298 +#: instances/jobs.py:1308 msgid "libvirt is still migrating the VM" msgstr "libvirt sanal makineyi hâlâ taşıyor" -#: instances/jobs.py:1310 +#: instances/jobs.py:1320 msgid "The VM stayed on the source host" msgstr "Sanal makine kaynak sunucuda kaldı" -#: instances/jobs.py:1312 +#: instances/jobs.py:1322 msgid "" "The VM is on both computes or on neither; check them, then resolve this job." msgstr "" "Sanal makine ya iki sunucuda da var ya da hiçbirinde yok; kontrol edin, sonra" " bu işi çözün." -#: instances/jobs.py:1331 +#: instances/jobs.py:1341 msgid "Move disk" msgstr "Diski taşı" -#: instances/jobs.py:1338 +#: instances/jobs.py:1348 msgid "Choose a disk of the VM" msgstr "Sanal makinenin bir diskini seçin" -#: instances/jobs.py:1362 +#: instances/jobs.py:1372 msgid "Copying the disk" msgstr "Disk kopyalanıyor" -#: instances/jobs.py:1404 +#: instances/jobs.py:1414 #, python-format msgid "Another block job runs on %(dev)s; check the VM" msgstr "" "%(dev)s üzerinde başka bir blok işi çalışıyor; sanal makineyi kontrol edin" -#: instances/jobs.py:1410 +#: instances/jobs.py:1420 #, python-format msgid "The disk stayed in %(path)s; remove %(dest)s if it is there" msgstr "Disk %(path)s içinde kaldı; varsa %(dest)s dosyasını silin" -#: instances/jobs.py:1412 +#: instances/jobs.py:1422 #, python-format msgid "The definitions of %(dev)s name %(paths)s; check the VM" msgstr "%(dev)s tanımları %(paths)s gösteriyor; sanal makineyi kontrol edin" -#: instances/jobs.py:1419 +#: instances/jobs.py:1429 #, python-format msgid "Disk %(path)s was kept: a disk file that stays needs it" msgstr "%(path)s diski korundu: kalan bir disk dosyası ona ihtiyaç duyuyor" -#: instances/jobs.py:1420 +#: instances/jobs.py:1430 #, python-format msgid "The VM is removed, but disk %(path)s was not deleted: %(err)s" msgstr "Sanal makine kaldırıldı, ancak %(path)s diski silinmedi: %(err)s" -#: instances/jobs.py:1421 +#: instances/jobs.py:1431 #, python-format msgid "Disk %(path)s is used by another VM and was kept" msgstr "" "%(path)s diski başka bir sanal makine tarafından kullanılıyor ve korundu" -#: instances/jobs.py:1475 +#: instances/jobs.py:1485 msgid "Delete VM" msgstr "Sanal makineyi sil" -#: instances/jobs.py:1505 +#: instances/jobs.py:1515 msgid "Deleting the VM" msgstr "Sanal makine siliniyor" -#: instances/jobs.py:1518 +#: instances/jobs.py:1528 msgid "The VM was not deleted; it may have been shut off" msgstr "Sanal makine silinmedi; kapatılmış olabilir" -#: instances/jobs.py:1584 +#: instances/jobs.py:1594 msgid "The VM was not powered" msgstr "Sanal makineye güç işlemi yapılmadı" -#: instances/jobs.py:1600 instances/templates/allinstances.html:69 +#: instances/jobs.py:1610 instances/templates/allinstances.html:69 #: instances/templates/instance_actions.html:17 #: instances/templates/instance_actions.html:33 #: interfaces/templates/interface.html:18 networks/templates/network.html:18 @@ -4146,20 +4146,20 @@ msgstr "Sanal makineye güç işlemi yapılmadı" msgid "Start" msgstr "Başlat" -#: instances/jobs.py:1607 +#: instances/jobs.py:1617 msgid "The VM is not shut off" msgstr "Sanal makine kapalı değil" -#: instances/jobs.py:1621 instances/templates/allinstances.html:71 +#: instances/jobs.py:1631 instances/templates/allinstances.html:71 #: instances/templates/instance_actions.html:27 msgid "Shut down" msgstr "Kapat" -#: instances/jobs.py:1626 vrtManager/instance.py:182 +#: instances/jobs.py:1636 vrtManager/instance.py:182 msgid "The VM is not running" msgstr "Sanal makine çalışmıyor" -#: instances/jobs.py:1628 +#: instances/jobs.py:1638 msgid "" "The VM was still running when the job was checked: its guest may still shut " "it down" @@ -4167,12 +4167,12 @@ msgstr "" "İş denetlendiğinde sanal makine hâlâ çalışıyordu: konuk sistem onu yine de " "kapatabilir" -#: instances/jobs.py:1640 instances/templates/allinstances.html:73 +#: instances/jobs.py:1650 instances/templates/allinstances.html:73 #: instances/templates/instance_actions.html:50 msgid "Force off" msgstr "Zorla kapat" -#: instances/jobs.py:1645 +#: instances/jobs.py:1655 msgid "The VM is already shut off" msgstr "Sanal makine zaten kapalı" @@ -4359,7 +4359,7 @@ msgid "Disk source" msgstr "Disk kaynağı" #: instances/templates/add_instance_volume.html:21 -#: instances/templates/create_instance_w2.html:134 instances/views.py:2856 +#: instances/templates/create_instance_w2.html:134 instances/views.py:2862 msgid "New disk" msgstr "Yeni disk" @@ -4822,7 +4822,7 @@ msgstr "Özel CPU modelleri" msgid "Size (GiB)" msgstr "Boyut (GiB)" -#: instances/templates/create_instance_w2.html:161 instances/views.py:2857 +#: instances/templates/create_instance_w2.html:161 instances/views.py:2863 msgid "Existing volumes" msgstr "Mevcut birimler" @@ -4859,7 +4859,7 @@ msgstr "Aygıt" msgid "Remove" msgstr "Kaldır" -#: instances/templates/create_instance_w2.html:194 instances/views.py:2858 +#: instances/templates/create_instance_w2.html:194 instances/views.py:2864 msgid "Clone from template" msgstr "Şablondan klonla" @@ -5413,7 +5413,7 @@ msgid "Add USB device" msgstr "USB aygıtı ekle" #: instances/templates/instances/host_devices_form.html:18 -#: vrtManager/instance.py:3260 +#: vrtManager/instance.py:3272 msgid "" "A VM with a saved state does not change its USB devices: start it, or start " "it without its saved state" @@ -7563,7 +7563,7 @@ msgstr "Birim başarıyla değiştirildi." msgid "Disk %(dev)s is not a storage volume of this instance" msgstr "%(dev)s diski bu sanal makinenin bir depolama birimi değil" -#: instances/views.py:1768 vrtManager/instance.py:2601 +#: instances/views.py:1768 vrtManager/instance.py:2613 msgid "The VM has a saved state; start it or remove the saved state first" msgstr "" "Sanal makinenin kaydedilmiş durumu var; önce başlatın veya kaydedilmiş durumu" @@ -7611,47 +7611,47 @@ msgstr "USB CD-ROM bir ISO imajı ister: libvirt boş USB sürücü desteklemiyo msgid "%(image)s is already in a CD-ROM of this VM" msgstr "%(image)s bu sanal makinenin bir CD-ROM'unda zaten takılı" -#: instances/views.py:1935 +#: instances/views.py:1941 #, python-format msgid "Pool %(pool)s was not read again: %(err)s" msgstr "%(pool)s havuzu yeniden okunamadı: %(err)s" -#: instances/views.py:1956 +#: instances/views.py:1962 #, python-format msgid "Snapshot was not deleted: %(err)s" msgstr "Anlık görüntü silinmedi: %(err)s" -#: instances/views.py:2075 +#: instances/views.py:2081 msgid "Add at least one device to the boot order." msgstr "Ön yükleme sırasına en az bir aygıt ekleyin." -#: instances/views.py:2081 vrtManager/instance.py:1364 +#: instances/views.py:2087 vrtManager/instance.py:1364 msgid "Invalid Device Type for boot order" msgstr "Ön yükleme sırası için geçersiz aygıt türü" -#: instances/views.py:2092 +#: instances/views.py:2098 msgid "Boot order changed. It applies at the next start." msgstr "Ön yükleme sırası değiştirildi. Sonraki başlatmada uygulanır." -#: instances/views.py:2094 +#: instances/views.py:2100 msgid "Boot order changed successfully." msgstr "Ön yükleme sırası başarıyla değiştirildi." -#: instances/views.py:2114 +#: instances/views.py:2120 msgid "The XML is empty" msgstr "XML boş" -#: instances/views.py:2118 instances/views.py:2838 +#: instances/views.py:2124 instances/views.py:2844 #, python-format msgid "The XML is not well-formed: %(error)s" msgstr "XML düzgün biçimlendirilmemiş: %(error)s" -#: instances/views.py:2120 +#: instances/views.py:2126 #, python-format msgid "The XML must keep the VM's UUID %(uuid)s." msgstr "XML, sanal makinenin %(uuid)s UUID'sini korumalıdır." -#: instances/views.py:2124 +#: instances/views.py:2130 msgid "" "The definition has changed since the editor was opened. Reload the page to " "edit the current one." @@ -7659,45 +7659,45 @@ msgstr "" "Düzenleyici açıldığından beri tanım değişti. Geçerli tanımı düzenlemek için " "sayfayı yeniden yükleyin." -#: instances/views.py:2140 +#: instances/views.py:2146 msgid "The XML definition was saved." msgstr "XML tanımı kaydedildi." -#: instances/views.py:2142 +#: instances/views.py:2148 msgid "The XML definition was saved; the VM uses it from its next start." msgstr "" "XML tanımı kaydedildi; sanal makine onu sonraki başlatmasından itibaren " "kullanır." -#: instances/views.py:2223 +#: instances/views.py:2229 msgid "Select one network interface to change" msgstr "Değiştirilecek bir ağ arabirimi seçin" -#: instances/views.py:2237 +#: instances/views.py:2243 #, python-format msgid "Network interface %(mac)s was changed meanwhile; reload the page" msgstr "%(mac)s ağ arayüzü bu arada değişti; sayfayı yeniden yükleyin" -#: instances/views.py:2267 +#: instances/views.py:2273 msgid "Network Device Config is changed. Please shutdown instance to activate." msgstr "" "Ağ aygıtı yapılandırması değiştirildi. Aktifleştirmek için lütfen sanal " "makineyi kapatın." -#: instances/views.py:2269 +#: instances/views.py:2275 msgid "Network device changed" msgstr "Ağ aygıtı değiştirildi" -#: instances/views.py:2281 +#: instances/views.py:2287 msgid "No network selected" msgstr "Ağ seçilmedi" -#: instances/views.py:2286 +#: instances/views.py:2292 #, python-format msgid "The VM already has a network device with MAC %(mac)s" msgstr "Sanal makinede %(mac)s MAC adresli bir ağ aygıtı zaten var" -#: instances/views.py:2305 +#: instances/views.py:2311 msgid "" "The running VM has no free PCI slot for another network device: shut it down " "and add the device then; Add PCIe slots on the Disks tab gives it free ones " @@ -7707,21 +7707,21 @@ msgstr "" "aygıtı sonra ekleyin; Diskler sekmesindeki PCIe yuvaları ekle, sonraki " "başlatmadan itibaren ona boş yuvalar verir." -#: instances/views.py:2351 instances/views.py:2357 +#: instances/views.py:2357 instances/views.py:2363 msgid "The VM has it" msgstr "Sanal makinede var" -#: instances/views.py:2392 +#: instances/views.py:2398 #, python-format msgid "The host has no USB device %(device)s; reload the page" msgstr "Sunucuda %(device)s USB aygıtı yok; sayfayı yeniden yükleyin" -#: instances/views.py:2413 +#: instances/views.py:2419 #, python-format msgid "The host has no PCI device %(device)s" msgstr "Sunucuda %(device)s PCI aygıtı yok" -#: instances/views.py:2431 +#: instances/views.py:2437 #, python-format msgid "" "Removal of PCI device %(address)s requested: the guest has not let it go yet;" @@ -7731,20 +7731,20 @@ msgstr "" "bırakmadı; bırakana ya da sanal makine durana kadar çalışan sanal makinede " "kalır." -#: instances/views.py:2476 instances/views.py:2506 +#: instances/views.py:2482 instances/views.py:2512 msgid "Select a network interface and a QoS direction" msgstr "Bir ağ arabirimi ve bir QoS yönü seçin" -#: instances/views.py:2479 vrtManager/network.py:470 +#: instances/views.py:2485 vrtManager/network.py:470 msgid "QoS rates must be whole numbers" msgstr "QoS hızları tam sayı olmalıdır" -#: instances/views.py:2486 networks/views.py:235 +#: instances/views.py:2492 networks/views.py:235 #, python-format msgid "%(qos_dir)s QoS is set" msgstr "%(qos_dir)s QoS ayarlandı" -#: instances/views.py:2491 +#: instances/views.py:2497 #, python-format msgid "" "%(qos_dir)s QoS is set. A running VM gets it after it is powered off and on." @@ -7752,12 +7752,12 @@ msgstr "" "%(qos_dir)s QoS ayarlandı. Çalışan bir sanal makine, kapatılıp açıldıktan " "sonra bunu alır." -#: instances/views.py:2513 networks/views.py:261 +#: instances/views.py:2519 networks/views.py:261 #, python-format msgid "%(qos_dir)s QoS is deleted" msgstr "%(qos_dir)s QoS silindi" -#: instances/views.py:2518 +#: instances/views.py:2524 #, python-format msgid "" "%(qos_dir)s QoS is deleted. A running VM keeps the old limit until it is " @@ -7766,21 +7766,21 @@ msgstr "" "%(qos_dir)s QoS silindi. Çalışan bir sanal makine, kapatılıp açılana kadar " "eski sınırı korur." -#: instances/views.py:2546 +#: instances/views.py:2552 msgid "Only one owner is allowed and the one already added" msgstr "Sadece bir sahibe izin verilmiştir ve bir sahip zaten eklenmiş" -#: instances/views.py:2548 +#: instances/views.py:2554 #, python-format msgid "%(user)s is already an owner" msgstr "%(user)s zaten bir sahip" -#: instances/views.py:2613 +#: instances/views.py:2619 #, python-format msgid "Console settings were not saved: %(errors)s" msgstr "Konsol ayarları kaydedilmedi: %(errors)s" -#: instances/views.py:2635 +#: instances/views.py:2641 msgid "" "Error setting console password. You should check that your instance have an " "graphic device." @@ -7788,41 +7788,41 @@ msgstr "" "Konsol parolası ayarlanırken hata oluştu. Sanal makinenin bir grafik aygıtına" " sahip olduğundan emin olunuz." -#: instances/views.py:2682 +#: instances/views.py:2688 msgid "Shut the VM down to change whether it is a template." msgstr "Şablon olup olmadığını değiştirmek için sanal makineyi kapatın." -#: instances/views.py:2688 +#: instances/views.py:2694 #, python-format msgid "%(quota)s: '%(instance_name)s' stays a template." msgstr "%(quota)s: '%(instance_name)s' şablon olarak kalıyor." -#: instances/views.py:2710 +#: instances/views.py:2716 msgid "An I/O limit is whole numbers of IOPS and MiB/s, 0 for none" msgstr "G/Ç sınırı, IOPS ve MiB/s için tam sayılardır; 0: sınır yok" -#: instances/views.py:2824 +#: instances/views.py:2830 msgid "The XML has no name" msgstr "XML'de ad yok" -#: instances/views.py:2842 webvirtcloud/middleware.py:157 +#: instances/views.py:2848 webvirtcloud/middleware.py:157 #, python-format msgid "libvirt Error - %(exception)s" msgstr "libvirt Hatası - %(exception)s" -#: instances/views.py:2856 +#: instances/views.py:2862 msgid "An empty disk of the size you set" msgstr "Belirlediğiniz boyutta boş bir disk" -#: instances/views.py:2857 +#: instances/views.py:2863 msgid "Volumes already in a pool" msgstr "Bir havuzda zaten bulunan birimler" -#: instances/views.py:2858 +#: instances/views.py:2864 msgid "A copy of a template volume" msgstr "Bir şablon biriminin kopyası" -#: instances/views.py:2948 +#: instances/views.py:2954 msgid "" "This host has no running storage pool for the VM's disks: add or start one on" " its Storage page." @@ -7830,29 +7830,29 @@ msgstr "" "Bu sunucuda sanal makinenin diskleri için çalışan bir depolama havuzu yok: " "Depolama sayfasından bir tane ekleyin ya da başlatın." -#: instances/views.py:2950 +#: instances/views.py:2956 msgid "This host has no network for the VM: add one on its Networks page." msgstr "" "Bu sunucuda sanal makine için ağ yok: Ağlar sayfasından bir tane ekleyin." -#: instances/views.py:2982 +#: instances/views.py:2988 #, python-format msgid "The machine type is q35, not %(machine)s: UEFI Secure Boot needs it" msgstr "Makine türü %(machine)s değil q35: UEFI Secure Boot bunu gerektiriyor" -#: instances/views.py:3011 +#: instances/views.py:3017 msgid "Flavor Created" msgstr "Flavor Oluşturuldu" -#: instances/views.py:3019 +#: instances/views.py:3025 msgid "Create Flavor" msgstr "Kullanıcı Oluştur" -#: instances/views.py:3031 +#: instances/views.py:3037 msgid "Flavor Deleted" msgstr "Flavor Silindi" -#: instances/views.py:3037 +#: instances/views.py:3043 msgid "Only the size template goes; VMs made from it keep their size." msgstr "" "Yalnızca boyut şablonu silinir; ondan oluşturulan sanal makineler boyutlarını" @@ -9655,19 +9655,19 @@ msgstr "Sunucu dosyanın boyutunu bildirmiyor" msgid "The file is larger than the pool's free space" msgstr "Dosya, havuzun boş alanından büyük" -#: storages/jobs.py:303 +#: storages/jobs.py:304 msgid "The server sent more than the file's size" msgstr "Sunucu dosyanın boyutundan fazlasını gönderdi" -#: storages/jobs.py:314 +#: storages/jobs.py:315 msgid "The download ended early" msgstr "İndirme erken bitti" -#: storages/jobs.py:320 +#: storages/jobs.py:321 msgid "The download stopped and its volume was not deleted" msgstr "İndirme durdu ve birimi silinemedi" -#: storages/jobs.py:337 +#: storages/jobs.py:338 msgid "The download stopped; what it wrote was deleted" msgstr "İndirme durdu; yazdıkları silindi" @@ -11528,14 +11528,14 @@ msgid "" msgstr "" "%(pool)s depolama havuzu %(target)s yedek hedefidir; önce hedeften çıkarın" -#: vmbackups/utils.py:85 +#: vmbackups/utils.py:84 msgid "" "No backup target open to VM owners has a storage pool on this VM's host." msgstr "" "VM sahiplerine açık hiçbir yedek hedefinin bu VM'in sunucusunda depolama " "havuzu yok." -#: vmbackups/utils.py:86 +#: vmbackups/utils.py:85 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." @@ -12061,17 +12061,22 @@ msgstr "ISO imajı %(image)s bulunamadı" msgid "ISO image %(image)s is in more than one storage pool" msgstr "ISO imajı %(image)s birden fazla depolama havuzunda var" -#: vrtManager/instance.py:1509 +#: vrtManager/instance.py:1424 +#, python-format +msgid "ISO image %(image)s is no longer in pool %(pool)s; choose it again" +msgstr "%(image)s ISO imajı artık %(pool)s havuzunda değil; yeniden seçin" + +#: vrtManager/instance.py:1521 #, python-format msgid "Disk %(target_dev)s is not in the VM's definition" msgstr "Disk %(target_dev)s sanal makinenin tanımında yok" -#: vrtManager/instance.py:1641 +#: vrtManager/instance.py:1653 msgid "Please shutdown the instance then try to enable vCPU hotplug" msgstr "" "vCPU hotplug özelliğini etkinleştirmek için önce sanal makineyi kapatın" -#: vrtManager/instance.py:1844 +#: vrtManager/instance.py:1856 #, python-format msgid "" "The serial console is a %(type)s one, the browser opens only a pty one; " @@ -12080,11 +12085,11 @@ msgstr "" "Seri konsol %(type)s türünde, tarayıcı yalnızca pty türünü açar; bunu XML " "düzenleyicide değiştirin" -#: vrtManager/instance.py:1955 +#: vrtManager/instance.py:1967 msgid "The VM has no video card" msgstr "Sanal makinede ekran kartı yok" -#: vrtManager/instance.py:1965 +#: vrtManager/instance.py:1977 #, python-format msgid "" "The VM's CPU topology has %(count)s vCPUs: change it in the XML editor to set" @@ -12093,62 +12098,62 @@ msgstr "" "VM'nin CPU topolojisi %(count)s vCPU içeriyor: başka bir en fazla değer için " "onu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:1991 +#: vrtManager/instance.py:2003 #, python-format msgid "The VM's next start has a maximum memory of %(max)s MiB" msgstr "" "Sanal makinenin bir sonraki başlangıcındaki en yüksek bellek %(max)s MiB" -#: vrtManager/instance.py:2132 +#: vrtManager/instance.py:2144 msgid "" "The VM has external snapshots; internal snapshots cannot be mixed with them" msgstr "" "Sanal makinenin harici anlık görüntüleri var; dahili anlık görüntüler " "bunlarla karıştırılamaz" -#: vrtManager/instance.py:2160 +#: vrtManager/instance.py:2172 msgid "" "The VM has internal snapshots; external snapshots cannot be mixed with them" msgstr "" "Sanal makinenin dahili anlık görüntüleri var; harici anlık görüntüler " "bunlarla karıştırılamaz" -#: vrtManager/instance.py:2165 +#: vrtManager/instance.py:2177 msgid "Newer snapshots exist after the last revert; delete them first" msgstr "" "Son geri dönüşten sonra daha yeni anlık görüntüler var; önce onları silin" -#: vrtManager/instance.py:2168 +#: vrtManager/instance.py:2180 msgid "No snapshot is current; revert to a snapshot first" msgstr "Geçerli anlık görüntü yok; önce bir anlık görüntüye geri dönün" -#: vrtManager/instance.py:2174 +#: vrtManager/instance.py:2186 #, python-format msgid "Eject the media from %(dev)s first" msgstr "Önce %(dev)s içindeki ortamı çıkarın" -#: vrtManager/instance.py:2176 +#: vrtManager/instance.py:2188 #, python-format msgid "Disk %(dev)s is not a file; external snapshots need file disks" msgstr "" "Disk %(dev)s bir dosya değil; harici anlık görüntüler dosya diskleri " "gerektirir" -#: vrtManager/instance.py:2189 +#: vrtManager/instance.py:2201 msgid "A snapshot with memory is not quiesced; it keeps the whole guest state" msgstr "" "Bellekli bir anlık görüntüde dosya sistemleri dondurulmaz; tüm konuk durumunu" " saklar" -#: vrtManager/instance.py:2191 +#: vrtManager/instance.py:2203 msgid "Only a running VM's file systems can be frozen" msgstr "Yalnızca çalışan bir sanal makinenin dosya sistemleri dondurulabilir" -#: vrtManager/instance.py:2193 +#: vrtManager/instance.py:2205 msgid "The QEMU guest agent is not connected; it freezes the file systems" msgstr "QEMU konuk aracısı bağlı değil; dosya sistemlerini o dondurur" -#: vrtManager/instance.py:2202 +#: vrtManager/instance.py:2214 #, python-format msgid "" "The storage pools could not be refreshed, so their free space is unknown: " @@ -12156,21 +12161,21 @@ msgid "" msgstr "" "Depolama havuzları yenilenemedi, bu yüzden boş alanları bilinmiyor: %(err)s" -#: vrtManager/instance.py:2225 +#: vrtManager/instance.py:2237 msgid "Memory is saved only from a running VM" msgstr "Bellek yalnızca çalışan bir sanal makineden kaydedilir" -#: vrtManager/instance.py:2227 +#: vrtManager/instance.py:2239 msgid "The VM has no disk to keep its memory next to" msgstr "Sanal makinenin, belleğinin yanına kaydedileceği bir diski yok" -#: vrtManager/instance.py:2231 +#: vrtManager/instance.py:2243 #, python-format msgid "%(disk)s is not in a storage pool; memory is saved only into one" msgstr "" "%(disk)s bir depolama havuzunda değil; bellek yalnızca bir havuza kaydedilir" -#: vrtManager/instance.py:2262 +#: vrtManager/instance.py:2274 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the snapshot needs %(size).1f " @@ -12181,7 +12186,7 @@ msgstr "" "%(size).1f GiB gerektiriyor (sanal makinenin oradaki disklerinin " "%%%(percent)g kadarı, en az %(minimum)g GiB, ve kaydediliyorsa bellek)" -#: vrtManager/instance.py:2280 +#: vrtManager/instance.py:2292 msgid "" "This snapshot was taken by an older version on a UEFI VM and cannot be " "reverted; delete it instead" @@ -12189,7 +12194,7 @@ msgstr "" "Bu anlık görüntü UEFI bir sanal makinede eski bir sürümle alındı ve geri " "dönülemez; bunun yerine silin" -#: vrtManager/instance.py:2310 +#: vrtManager/instance.py:2322 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is " @@ -12198,7 +12203,7 @@ msgstr "" "Geri dönüş iki kez başarısız oldu; biraz sonra tekrar deneyin (%(error)s). " "Sanal makine çalışıyor." -#: vrtManager/instance.py:2312 +#: vrtManager/instance.py:2324 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is shut " @@ -12207,13 +12212,13 @@ msgstr "" "Geri dönüş iki kez başarısız oldu; biraz sonra tekrar deneyin (%(error)s). " "Sanal makine kapalı." -#: vrtManager/instance.py:2480 +#: vrtManager/instance.py:2492 msgid "A disk moves when its VM is defined and running, paused or shut off" msgstr "" "Bir disk, sanal makinesi tanımlıyken ve çalışırken, duraklatılmışken veya " "kapalıyken taşınır" -#: vrtManager/instance.py:2482 +#: vrtManager/instance.py:2494 msgid "" "A disk of a VM with snapshots, a saved state or a running block job does not " "move" @@ -12221,7 +12226,7 @@ msgstr "" "Anlık görüntüleri, kaydedilmiş durumu veya çalışan bir blok işi olan sanal " "makinenin diski taşınmaz" -#: vrtManager/instance.py:2490 +#: vrtManager/instance.py:2502 #, python-format msgid "" "%(dev)s is not a disk file of the VM, the same in its running and next " @@ -12230,121 +12235,121 @@ msgstr "" "%(dev)s, sanal makinenin çalışan ve sonraki başlatma tanımlarında aynı olan " "bir disk dosyası değil" -#: vrtManager/instance.py:2495 +#: vrtManager/instance.py:2507 #, python-format msgid "%(dev)s does not move: only writable raw and qcow2 disks do" msgstr "%(dev)s taşınmaz: yalnızca yazılabilir raw ve qcow2 diskler taşınır" -#: vrtManager/instance.py:2502 +#: vrtManager/instance.py:2514 #, python-format msgid "%(dev)s does not move: no storage pool has %(path)s" msgstr "%(dev)s taşınmaz: hiçbir depolama havuzunda %(path)s yok" -#: vrtManager/instance.py:2504 +#: vrtManager/instance.py:2516 #, python-format msgid "%(dev)s does not move: it has a backing file" msgstr "%(dev)s taşınmaz: temel (backing) dosyası var" -#: vrtManager/instance.py:2507 +#: vrtManager/instance.py:2519 #, python-format msgid "%(pool_name)s is not an active pool of disk files of this host" msgstr "%(pool_name)s bu sunucunun etkin bir disk dosyası havuzu değil" -#: vrtManager/instance.py:2510 +#: vrtManager/instance.py:2522 #, python-format msgid "%(dev)s is in pool %(pool_name)s already" msgstr "%(dev)s zaten %(pool_name)s havuzunda" -#: vrtManager/instance.py:2514 +#: vrtManager/instance.py:2526 #, python-format msgid "Pool %(pool_name)s already has a file %(name)s" msgstr "%(pool_name)s havuzunda zaten %(name)s dosyası var" -#: vrtManager/instance.py:2538 +#: vrtManager/instance.py:2550 #, python-format msgid "The copy of %(dev)s ended before it was complete" msgstr "%(dev)s kopyası tamamlanmadan sona erdi" -#: vrtManager/instance.py:2583 +#: vrtManager/instance.py:2595 #, python-format msgid "%(error)s; remove %(dest)s if it is there: %(cleanup_error)s" msgstr "%(error)s; varsa %(dest)s dosyasını kaldırın: %(cleanup_error)s" -#: vrtManager/instance.py:2585 +#: vrtManager/instance.py:2597 #, python-format msgid "%(error)s; the VM may use %(dest)s now: check its disk %(dev)s" msgstr "" "%(error)s; sanal makine şu anda %(dest)s dosyasını kullanıyor olabilir: " "%(dev)s diskini kontrol edin" -#: vrtManager/instance.py:2592 +#: vrtManager/instance.py:2604 #, python-format msgid "The VM has no internal snapshot named %(name)s" msgstr "Sanal makinenin %(name)s adlı dahili anlık görüntüsü yok" -#: vrtManager/instance.py:2603 +#: vrtManager/instance.py:2615 msgid "A snapshot job is still running on this VM; try again when it ends" msgstr "" "Bu sanal makinede hâlâ bir anlık görüntü işi çalışıyor; bittiğinde tekrar " "deneyin" -#: vrtManager/instance.py:2613 +#: vrtManager/instance.py:2625 msgid "Shut the VM down to revert to an internal snapshot" msgstr "Dahili bir anlık görüntüye geri dönmek için sanal makineyi kapatın" -#: vrtManager/instance.py:2680 +#: vrtManager/instance.py:2692 msgid "Cannot clone a VM whose NVRAM is not a file" msgstr "NVRAM'i dosya olmayan bir sanal makine klonlanamaz" -#: vrtManager/instance.py:2751 +#: vrtManager/instance.py:2763 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(path)s" msgstr "" "Klonlama başarısız oldu (%(err)s); bu kopyaları elle kaldırın: %(path)s" -#: vrtManager/instance.py:2762 +#: vrtManager/instance.py:2774 msgid "Shut the VM down before cloning it" msgstr "Klonlamadan önce sanal makineyi kapatın" -#: vrtManager/instance.py:2789 +#: vrtManager/instance.py:2801 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(leftovers)s" msgstr "" "Klonlama başarısız oldu (%(err)s); bu kopyaları elle kaldırın: %(leftovers)s" -#: vrtManager/instance.py:2800 +#: vrtManager/instance.py:2812 msgid "Live clone needs libvirt 11.10 or later; shut the VM down to clone it" msgstr "" "Canlı klonlama libvirt 11.10 veya sonrasını gerektirir; klonlamak için sanal " "makineyi kapatın" -#: vrtManager/instance.py:2803 +#: vrtManager/instance.py:2815 msgid "A VM with a TPM is cloned only shut down" msgstr "TPM'i olan bir sanal makine yalnızca kapalıyken klonlanır" -#: vrtManager/instance.py:2806 +#: vrtManager/instance.py:2818 #, python-format msgid "Disk %(dev)s is not a local file; shut the VM down to clone it" msgstr "" "Disk %(dev)s yerel bir dosya değil; klonlamak için sanal makineyi kapatın" -#: vrtManager/instance.py:2808 +#: vrtManager/instance.py:2820 #, python-format msgid "Disk %(dev)s is shareable; shut the VM down to clone it" msgstr "Disk %(dev)s paylaşılabilir; klonlamak için sanal makineyi kapatın" -#: vrtManager/instance.py:2813 +#: vrtManager/instance.py:2825 #, python-format msgid "Disk %(dev)s changes at the next start; shut the VM down to clone it" msgstr "" "Disk %(dev)s sonraki başlatmada değişiyor; klonlamak için sanal makineyi " "kapatın" -#: vrtManager/instance.py:2815 +#: vrtManager/instance.py:2827 msgid "Another job is running on the VM; clone it when that ends" msgstr "Sanal makinede başka bir iş çalışıyor; o bittiğinde klonlayın" -#: vrtManager/instance.py:2841 +#: vrtManager/instance.py:2853 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the clone needs %(size).1f GiB" @@ -12354,25 +12359,25 @@ msgstr "" "gerektiriyor (kopyalanan diskler, artı bunların %%%(percent)g kadarı, en az " "%(minimum)g GiB)" -#: vrtManager/instance.py:2858 +#: vrtManager/instance.py:2870 #, python-format msgid "Volume %(name)s already exists in storage pool %(pool)s" msgstr "%(name)s birimi %(pool)s depolama havuzunda zaten var" -#: vrtManager/instance.py:3046 +#: vrtManager/instance.py:3058 msgid "A network interface that is a host device is removed in the XML editor" msgstr "Sunucu aygıtı olan bir ağ arabirimi XML düzenleyicide kaldırılır" -#: vrtManager/instance.py:3062 +#: vrtManager/instance.py:3074 #, python-format msgid "No network interface with MAC %(old_mac)s" msgstr "MAC adresi %(old_mac)s olan ağ arabirimi yok" -#: vrtManager/instance.py:3065 +#: vrtManager/instance.py:3077 msgid "A network interface that is a host device is changed in the XML editor" msgstr "Sunucu aygıtı olan bir ağ arabirimi XML düzenleyicide değiştirilir" -#: vrtManager/instance.py:3159 +#: vrtManager/instance.py:3171 msgid "" "A VM changes its PCI devices while it runs, or is shut off without a saved " "state" @@ -12380,43 +12385,43 @@ msgstr "" "Sanal makine PCI aygıtlarını çalışırken veya kaydedilmiş durumu olmadan " "kapalıyken değiştirir" -#: vrtManager/instance.py:3180 +#: vrtManager/instance.py:3192 #, python-format msgid "%(err)s; whether the VM has %(device)s now is not known" msgstr "%(err)s; sanal makinede şu anda %(device)s olup olmadığı bilinmiyor" -#: vrtManager/instance.py:3182 +#: vrtManager/instance.py:3194 #, python-format msgid "%(err)s; %(device)s: the VM is not running, its next start has it" msgstr "%(err)s; %(device)s: sanal makine çalışmıyor, sonraki başlatmada var" -#: vrtManager/instance.py:3183 +#: vrtManager/instance.py:3195 #, python-format msgid "" "%(err)s; %(device)s: the VM is not running, its next start does not have it" msgstr "%(err)s; %(device)s: sanal makine çalışmıyor, sonraki başlatmada yok" -#: vrtManager/instance.py:3184 +#: vrtManager/instance.py:3196 #, python-format msgid "%(err)s; %(device)s: the running VM has it, its next start has it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede var, sonraki başlatmada var" -#: vrtManager/instance.py:3185 +#: vrtManager/instance.py:3197 #, python-format msgid "" "%(err)s; %(device)s: the running VM has it, its next start does not have it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede var, sonraki başlatmada yok" -#: vrtManager/instance.py:3186 +#: vrtManager/instance.py:3198 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start has it" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede yok, sonraki başlatmada var" -#: vrtManager/instance.py:3188 +#: vrtManager/instance.py:3200 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start does not" @@ -12424,48 +12429,48 @@ msgid "" msgstr "" "%(err)s; %(device)s: çalışan sanal makinede yok, sonraki başlatmada yok" -#: vrtManager/instance.py:3222 +#: vrtManager/instance.py:3234 #, python-format msgid "The VM has no PCI device %(address)s" msgstr "Sanal makinede %(address)s PCI aygıtı yok" -#: vrtManager/instance.py:3243 +#: vrtManager/instance.py:3255 msgid "The VM has no USB controller" msgstr "Sanal makinede USB denetleyicisi yok" -#: vrtManager/instance.py:3277 +#: vrtManager/instance.py:3289 msgid "The VM has no such USB device" msgstr "Sanal makinede böyle bir USB aygıtı yok" -#: vrtManager/instance.py:3291 +#: vrtManager/instance.py:3303 #, python-format msgid "The VM has no network interface %(mac)s" msgstr "Sanal makinede %(mac)s ağ arabirimi yok" -#: vrtManager/instance.py:3323 +#: vrtManager/instance.py:3335 msgid "The VM has its own RNG device: change it in the XML editor" msgstr "" "Sanal makinenin kendi RNG aygıtı var: bunu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:3350 +#: vrtManager/instance.py:3362 msgid "The VM has its own TPM: change it in the XML editor" msgstr "Sanal makinenin kendi TPM'i var: bunu XML düzenleyicide değiştirin" -#: vrtManager/instance.py:3369 +#: vrtManager/instance.py:3381 #, python-format msgid "Unknown crash action %(action)s" msgstr "Bilinmeyen çökme eylemi %(action)s" -#: vrtManager/instance.py:3396 +#: vrtManager/instance.py:3408 #, python-format msgid "Network interface %(mac)s is not in the definition" msgstr "%(mac)s ağ arayüzü tanımda yok" -#: vrtManager/instance.py:3487 +#: vrtManager/instance.py:3499 msgid "The guest agent did not answer in time; nothing was changed" msgstr "Konuk ajanı zamanında yanıt vermedi; hiçbir şey değiştirilmedi" -#: vrtManager/instance.py:3490 +#: vrtManager/instance.py:3502 msgid "The VM runs Windows: its guest agent sets no root password or SSH key" msgstr "" "Sanal makinede Windows çalışıyor: konuk ajanı root parolası ya da SSH " diff --git a/locale/zh/LC_MESSAGES/django.mo b/locale/zh/LC_MESSAGES/django.mo index 12ebfc6a..67874e48 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 a1662f21..998fd860 100644 --- a/locale/zh/LC_MESSAGES/django.po +++ b/locale/zh/LC_MESSAGES/django.po @@ -7,7 +7,7 @@ msgid "" msgstr "" "Project-Id-Version: \n" "Report-Msgid-Bugs-To: \n" -"POT-Creation-Date: 2026-11-20 12:24+0000\n" +"POT-Creation-Date: 2026-11-20 13:47+0000\n" "PO-Revision-Date: \n" "Last-Translator: \n" "Language-Team: \n" @@ -3365,8 +3365,8 @@ msgid "" msgstr "不支持控制台类型 '%(type)s'。请将虚拟机图形切换为 VNC。" #: instances/api/viewsets.py:160 instances/api/viewsets.py:178 -#: instances/jobs.py:1605 instances/views.py:1010 instances/views.py:1032 -#: instances/views.py:2030 +#: instances/jobs.py:1615 instances/views.py:1010 instances/views.py:1032 +#: instances/views.py:2036 msgid "Templates cannot be started." msgstr "模板无法启动。" @@ -3436,7 +3436,7 @@ msgstr "VNC 密码最多 8 个字母、数字或符号,不能有带重音的 msgid "A password takes no line breaks or other control characters." msgstr "密码不能包含换行或其他控制字符。" -#: instances/forms.py:114 vrtManager/instance.py:1823 +#: instances/forms.py:114 vrtManager/instance.py:1835 msgid "" "The console listens on no address (on a network, a socket or nowhere); change" " it in the XML editor" @@ -3530,7 +3530,7 @@ msgstr "虚拟机未定义;请检查这些卷,然后处理此任务:%(volu msgid "Delete snapshot" msgstr "删除快照" -#: instances/jobs.py:366 vrtManager/instance.py:2591 +#: instances/jobs.py:366 vrtManager/instance.py:2603 #, python-format msgid "The VM has no external snapshot named %(name)s" msgstr "虚拟机没有名为 %(name)s 的外部快照" @@ -3562,7 +3562,7 @@ msgstr "虚拟机已不在运行该任务的计算节点上" msgid "Take snapshot" msgstr "创建快照" -#: instances/jobs.py:437 instances/jobs.py:446 vrtManager/instance.py:2162 +#: instances/jobs.py:437 instances/jobs.py:446 vrtManager/instance.py:2174 #, python-format msgid "A snapshot named %(name)s already exists" msgstr "名为 %(name)s 的快照已存在" @@ -3631,7 +3631,7 @@ msgstr "%(vm)s 已暂停,其文件系统可能仍处于冻结状态:请先 msgid "Clone VM" msgstr "克隆虚拟机" -#: instances/jobs.py:668 instances/jobs.py:675 instances/jobs.py:1017 +#: instances/jobs.py:668 instances/jobs.py:675 instances/jobs.py:1027 #: vmbackups/jobs.py:369 vmbackups/jobs.py:1076 vmbackups/jobs.py:1283 #: vmbackups/jobs.py:1459 msgid "Copying disks" @@ -3703,12 +3703,12 @@ msgstr "镜像已存在。请检查卷或更改虚拟机名称" msgid "Each network card needs a network" msgstr "每个网卡都需要一个网络" -#: instances/jobs.py:880 vrtManager/backup.py:387 vrtManager/instance.py:3007 +#: instances/jobs.py:880 vrtManager/backup.py:387 vrtManager/instance.py:3019 #, python-format msgid "This host has no network %(name)s" msgstr "此主机没有网络 %(name)s" -#: instances/jobs.py:882 vrtManager/backup.py:391 vrtManager/instance.py:3009 +#: instances/jobs.py:882 vrtManager/backup.py:391 vrtManager/instance.py:3021 #, python-format msgid "This host has no network filter %(name)s" msgstr "此主机没有网络过滤器 %(name)s" @@ -3730,11 +3730,11 @@ msgstr "磁盘缓存 %(cache)s 与设置中的原生 (native) 磁盘 I/O 不兼 msgid "Create VM" msgstr "创建虚拟机" -#: instances/jobs.py:940 instances/jobs.py:987 instances/views.py:2826 +#: instances/jobs.py:940 instances/jobs.py:997 instances/views.py:2832 msgid "A virtual machine with this name already exists" msgstr "同名虚拟机已存在" -#: instances/jobs.py:942 instances/jobs.py:982 +#: instances/jobs.py:942 instances/jobs.py:992 msgid "There is an instance with same name. Remove it and try again!" msgstr "已存在同名虚拟机。请删除后重试!" @@ -3778,136 +3778,136 @@ msgstr "cloud-init 种子需要为磁盘使用目录类型的存储池" msgid "This host offers no firmware %(firmware)s" msgstr "此主机不提供固件 %(firmware)s" -#: instances/jobs.py:969 vrtManager/instance.py:3357 +#: instances/jobs.py:969 vrtManager/instance.py:3369 msgid "This host offers no TPM 2.0: install swtpm on it" msgstr "此主机不提供 TPM 2.0:请在主机上安装 swtpm" -#: instances/jobs.py:1037 +#: instances/jobs.py:1047 msgid "Writing the cloud-init seed" msgstr "正在写入 cloud-init 种子" -#: instances/jobs.py:1044 +#: instances/jobs.py:1054 msgid "Defining the VM" msgstr "正在定义虚拟机" -#: instances/jobs.py:1086 +#: instances/jobs.py:1096 #, python-format msgid "" "The panel failed unexpectedly; its log has the details. Remove these volumes " "by hand: %(volumes)s" msgstr "面板发生意外错误;详细信息见面板日志。请手动删除这些卷:%(volumes)s" -#: instances/jobs.py:1090 +#: instances/jobs.py:1100 #, python-format msgid "%(error)s. Remove these volumes by hand: %(volumes)s" msgstr "%(error)s。请手动删除这些卷:%(volumes)s" -#: instances/jobs.py:1118 +#: instances/jobs.py:1128 #, python-format msgid "The instance is already on %(compute)s" msgstr "虚拟机已在 %(compute)s 上" -#: instances/jobs.py:1121 +#: instances/jobs.py:1131 #, python-format msgid "%(compute)s is not reachable" msgstr "无法连接 %(compute)s" -#: instances/jobs.py:1123 +#: instances/jobs.py:1133 #, python-format msgid "%(compute)s is the VM's own host under another name" msgstr "%(compute)s 是该虚拟机所在主机的另一个名称" -#: instances/jobs.py:1180 +#: instances/jobs.py:1190 #, python-format msgid "" "The VM migrated, but autostart could not be set on the destination: %(error)s" msgstr "虚拟机已迁移,但无法在目标主机上设置自动启动:%(error)s" -#: instances/jobs.py:1187 +#: instances/jobs.py:1197 #, python-format msgid "The VM migrated, but its NVRAM file stays on the source: %(error)s" msgstr "虚拟机已迁移,但其 NVRAM 文件仍留在源主机上:%(error)s" -#: instances/jobs.py:1195 +#: instances/jobs.py:1205 msgid "Migrate VM" msgstr "迁移虚拟机" -#: instances/jobs.py:1249 +#: instances/jobs.py:1259 msgid "Migrating the VM" msgstr "正在迁移虚拟机" -#: instances/jobs.py:1298 +#: instances/jobs.py:1308 msgid "libvirt is still migrating the VM" msgstr "libvirt 仍在迁移虚拟机" -#: instances/jobs.py:1310 +#: instances/jobs.py:1320 msgid "The VM stayed on the source host" msgstr "虚拟机留在了源主机上" -#: instances/jobs.py:1312 +#: instances/jobs.py:1322 msgid "" "The VM is on both computes or on neither; check them, then resolve this job." msgstr "虚拟机同时位于两个计算节点上,或都不在;请检查后处理此任务。" -#: instances/jobs.py:1331 +#: instances/jobs.py:1341 msgid "Move disk" msgstr "移动磁盘" -#: instances/jobs.py:1338 +#: instances/jobs.py:1348 msgid "Choose a disk of the VM" msgstr "请选择虚拟机的一个磁盘" -#: instances/jobs.py:1362 +#: instances/jobs.py:1372 msgid "Copying the disk" msgstr "正在复制磁盘" -#: instances/jobs.py:1404 +#: instances/jobs.py:1414 #, python-format msgid "Another block job runs on %(dev)s; check the VM" msgstr "%(dev)s 上正在运行另一个块任务;请检查虚拟机" -#: instances/jobs.py:1410 +#: instances/jobs.py:1420 #, python-format msgid "The disk stayed in %(path)s; remove %(dest)s if it is there" msgstr "磁盘仍在 %(path)s;如果 %(dest)s 存在,请将其删除" -#: instances/jobs.py:1412 +#: instances/jobs.py:1422 #, python-format msgid "The definitions of %(dev)s name %(paths)s; check the VM" msgstr "%(dev)s 的定义指向 %(paths)s;请检查虚拟机" -#: instances/jobs.py:1419 +#: instances/jobs.py:1429 #, python-format msgid "Disk %(path)s was kept: a disk file that stays needs it" msgstr "磁盘 %(path)s 已保留:某个保留的磁盘文件依赖它" -#: instances/jobs.py:1420 +#: instances/jobs.py:1430 #, python-format msgid "The VM is removed, but disk %(path)s was not deleted: %(err)s" msgstr "虚拟机已删除,但磁盘 %(path)s 未被删除:%(err)s" -#: instances/jobs.py:1421 +#: instances/jobs.py:1431 #, python-format msgid "Disk %(path)s is used by another VM and was kept" msgstr "磁盘 %(path)s 正被另一台虚拟机使用,已保留" -#: instances/jobs.py:1475 +#: instances/jobs.py:1485 msgid "Delete VM" msgstr "删除虚拟机" -#: instances/jobs.py:1505 +#: instances/jobs.py:1515 msgid "Deleting the VM" msgstr "正在删除虚拟机" -#: instances/jobs.py:1518 +#: instances/jobs.py:1528 msgid "The VM was not deleted; it may have been shut off" msgstr "虚拟机未被删除;它可能已被关闭" -#: instances/jobs.py:1584 +#: instances/jobs.py:1594 msgid "The VM was not powered" msgstr "未对虚拟机执行电源操作" -#: instances/jobs.py:1600 instances/templates/allinstances.html:69 +#: instances/jobs.py:1610 instances/templates/allinstances.html:69 #: instances/templates/instance_actions.html:17 #: instances/templates/instance_actions.html:33 #: interfaces/templates/interface.html:18 networks/templates/network.html:18 @@ -3915,31 +3915,31 @@ msgstr "未对虚拟机执行电源操作" msgid "Start" msgstr "启动" -#: instances/jobs.py:1607 +#: instances/jobs.py:1617 msgid "The VM is not shut off" msgstr "虚拟机未关机" -#: instances/jobs.py:1621 instances/templates/allinstances.html:71 +#: instances/jobs.py:1631 instances/templates/allinstances.html:71 #: instances/templates/instance_actions.html:27 msgid "Shut down" msgstr "关机" -#: instances/jobs.py:1626 vrtManager/instance.py:182 +#: instances/jobs.py:1636 vrtManager/instance.py:182 msgid "The VM is not running" msgstr "虚拟机未在运行" -#: instances/jobs.py:1628 +#: instances/jobs.py:1638 msgid "" "The VM was still running when the job was checked: its guest may still shut " "it down" msgstr "检查任务时虚拟机仍在运行:其客户机可能仍会将其关闭" -#: instances/jobs.py:1640 instances/templates/allinstances.html:73 +#: instances/jobs.py:1650 instances/templates/allinstances.html:73 #: instances/templates/instance_actions.html:50 msgid "Force off" msgstr "强制关闭" -#: instances/jobs.py:1645 +#: instances/jobs.py:1655 msgid "The VM is already shut off" msgstr "虚拟机已关机" @@ -4122,7 +4122,7 @@ msgid "Disk source" msgstr "磁盘来源" #: instances/templates/add_instance_volume.html:21 -#: instances/templates/create_instance_w2.html:134 instances/views.py:2856 +#: instances/templates/create_instance_w2.html:134 instances/views.py:2862 msgid "New disk" msgstr "新磁盘" @@ -4567,7 +4567,7 @@ msgstr "自定义 CPU 型号" msgid "Size (GiB)" msgstr "大小(GiB)" -#: instances/templates/create_instance_w2.html:161 instances/views.py:2857 +#: instances/templates/create_instance_w2.html:161 instances/views.py:2863 msgid "Existing volumes" msgstr "已有卷" @@ -4604,7 +4604,7 @@ msgstr "设备" msgid "Remove" msgstr "移除" -#: instances/templates/create_instance_w2.html:194 instances/views.py:2858 +#: instances/templates/create_instance_w2.html:194 instances/views.py:2864 msgid "Clone from template" msgstr "从模板克隆" @@ -5125,7 +5125,7 @@ msgid "Add USB device" msgstr "添加 USB 设备" #: instances/templates/instances/host_devices_form.html:18 -#: vrtManager/instance.py:3260 +#: vrtManager/instance.py:3272 msgid "" "A VM with a saved state does not change its USB devices: start it, or start " "it without its saved state" @@ -7108,7 +7108,7 @@ msgstr "卷已成功更改。" msgid "Disk %(dev)s is not a storage volume of this instance" msgstr "磁盘 %(dev)s 不是此虚拟机的存储卷" -#: instances/views.py:1768 vrtManager/instance.py:2601 +#: instances/views.py:1768 vrtManager/instance.py:2613 msgid "The VM has a saved state; start it or remove the saved state first" msgstr "虚拟机有保存的状态;请先启动它或删除保存的状态" @@ -7148,87 +7148,87 @@ msgstr "USB CD-ROM 需要 ISO 镜像:libvirt 不支持空的 USB 驱动器" msgid "%(image)s is already in a CD-ROM of this VM" msgstr "%(image)s 已在此虚拟机的某个光驱中" -#: instances/views.py:1935 +#: instances/views.py:1941 #, python-format msgid "Pool %(pool)s was not read again: %(err)s" msgstr "未重新读取存储池 %(pool)s:%(err)s" -#: instances/views.py:1956 +#: instances/views.py:1962 #, python-format msgid "Snapshot was not deleted: %(err)s" msgstr "快照未删除:%(err)s" -#: instances/views.py:2075 +#: instances/views.py:2081 msgid "Add at least one device to the boot order." msgstr "请至少向启动顺序中添加一个设备。" -#: instances/views.py:2081 vrtManager/instance.py:1364 +#: instances/views.py:2087 vrtManager/instance.py:1364 msgid "Invalid Device Type for boot order" msgstr "启动顺序的设备类型无效" -#: instances/views.py:2092 +#: instances/views.py:2098 msgid "Boot order changed. It applies at the next start." msgstr "启动顺序已更改,将在下次启动时生效。" -#: instances/views.py:2094 +#: instances/views.py:2100 msgid "Boot order changed successfully." msgstr "启动顺序已成功更改。" -#: instances/views.py:2114 +#: instances/views.py:2120 msgid "The XML is empty" msgstr "XML 为空" -#: instances/views.py:2118 instances/views.py:2838 +#: instances/views.py:2124 instances/views.py:2844 #, python-format msgid "The XML is not well-formed: %(error)s" msgstr "XML 格式不正确:%(error)s" -#: instances/views.py:2120 +#: instances/views.py:2126 #, python-format msgid "The XML must keep the VM's UUID %(uuid)s." msgstr "XML 必须保留虚拟机的 UUID %(uuid)s。" -#: instances/views.py:2124 +#: instances/views.py:2130 msgid "" "The definition has changed since the editor was opened. Reload the page to " "edit the current one." msgstr "自打开编辑器以来定义已被更改。请重新加载页面以编辑当前定义。" -#: instances/views.py:2140 +#: instances/views.py:2146 msgid "The XML definition was saved." msgstr "XML 定义已保存。" -#: instances/views.py:2142 +#: instances/views.py:2148 msgid "The XML definition was saved; the VM uses it from its next start." msgstr "XML 定义已保存;虚拟机从下次启动起使用它。" -#: instances/views.py:2223 +#: instances/views.py:2229 msgid "Select one network interface to change" msgstr "请选择一个要更改的网络接口" -#: instances/views.py:2237 +#: instances/views.py:2243 #, python-format msgid "Network interface %(mac)s was changed meanwhile; reload the page" msgstr "网络接口 %(mac)s 在此期间已更改;请重新加载页面" -#: instances/views.py:2267 +#: instances/views.py:2273 msgid "Network Device Config is changed. Please shutdown instance to activate." msgstr "网络设备配置已更改。请关闭虚拟机以使其生效。" -#: instances/views.py:2269 +#: instances/views.py:2275 msgid "Network device changed" msgstr "网络设备已更改" -#: instances/views.py:2281 +#: instances/views.py:2287 msgid "No network selected" msgstr "未选择网络" -#: instances/views.py:2286 +#: instances/views.py:2292 #, python-format msgid "The VM already has a network device with MAC %(mac)s" msgstr "虚拟机已有 MAC 地址为 %(mac)s 的网络设备" -#: instances/views.py:2305 +#: instances/views.py:2311 msgid "" "The running VM has no free PCI slot for another network device: shut it down " "and add the device then; Add PCIe slots on the Disks tab gives it free ones " @@ -7236,140 +7236,140 @@ msgid "" msgstr "" "运行中的虚拟机没有可用 PCI 插槽来添加网络设备:请关机后再添加设备。“磁盘”选项卡上的“添加 PCIe 插槽”可使其从下次启动起获得可用插槽。" -#: instances/views.py:2351 instances/views.py:2357 +#: instances/views.py:2357 instances/views.py:2363 msgid "The VM has it" msgstr "虚拟机已有此设备" -#: instances/views.py:2392 +#: instances/views.py:2398 #, python-format msgid "The host has no USB device %(device)s; reload the page" msgstr "主机没有 USB 设备 %(device)s;请重新加载页面" -#: instances/views.py:2413 +#: instances/views.py:2419 #, python-format msgid "The host has no PCI device %(device)s" msgstr "主机上没有 PCI 设备 %(device)s" -#: instances/views.py:2431 +#: instances/views.py:2437 #, python-format msgid "" "Removal of PCI device %(address)s requested: the guest has not let it go yet;" " it stays in the running VM until it does or the VM stops." msgstr "已请求移除 PCI 设备 %(address)s:客户机尚未释放它;在客户机释放或虚拟机停止之前,它仍保留在运行中的虚拟机中。" -#: instances/views.py:2476 instances/views.py:2506 +#: instances/views.py:2482 instances/views.py:2512 msgid "Select a network interface and a QoS direction" msgstr "请选择网络接口和 QoS 方向" -#: instances/views.py:2479 vrtManager/network.py:470 +#: instances/views.py:2485 vrtManager/network.py:470 msgid "QoS rates must be whole numbers" msgstr "QoS 速率必须为整数" -#: instances/views.py:2486 networks/views.py:235 +#: instances/views.py:2492 networks/views.py:235 #, python-format msgid "%(qos_dir)s QoS is set" msgstr "%(qos_dir)s QoS 已设置" -#: instances/views.py:2491 +#: instances/views.py:2497 #, python-format msgid "" "%(qos_dir)s QoS is set. A running VM gets it after it is powered off and on." msgstr "%(qos_dir)s QoS 已设置。运行中的虚拟机需关机再开机后才能生效。" -#: instances/views.py:2513 networks/views.py:261 +#: instances/views.py:2519 networks/views.py:261 #, python-format msgid "%(qos_dir)s QoS is deleted" msgstr "%(qos_dir)s QoS 已删除" -#: instances/views.py:2518 +#: instances/views.py:2524 #, python-format msgid "" "%(qos_dir)s QoS is deleted. A running VM keeps the old limit until it is " "powered off and on." msgstr "%(qos_dir)s QoS 已删除。运行中的虚拟机在关机再开机之前保留旧的限制。" -#: instances/views.py:2546 +#: instances/views.py:2552 msgid "Only one owner is allowed and the one already added" msgstr "只允许一个所有者,且已添加" -#: instances/views.py:2548 +#: instances/views.py:2554 #, python-format msgid "%(user)s is already an owner" msgstr "%(user)s 已是所有者" -#: instances/views.py:2613 +#: instances/views.py:2619 #, python-format msgid "Console settings were not saved: %(errors)s" msgstr "控制台设置未保存:%(errors)s" -#: instances/views.py:2635 +#: instances/views.py:2641 msgid "" "Error setting console password. You should check that your instance have an " "graphic device." msgstr "设置控制台密码出错。请检查虚拟机是否有图形设备。" -#: instances/views.py:2682 +#: instances/views.py:2688 msgid "Shut the VM down to change whether it is a template." msgstr "请关闭虚拟机以更改其是否为模板。" -#: instances/views.py:2688 +#: instances/views.py:2694 #, python-format msgid "%(quota)s: '%(instance_name)s' stays a template." msgstr "%(quota)s:“%(instance_name)s”仍为模板。" -#: instances/views.py:2710 +#: instances/views.py:2716 msgid "An I/O limit is whole numbers of IOPS and MiB/s, 0 for none" msgstr "I/O 限制须为 IOPS 和 MiB/s 的整数,0 表示不限" -#: instances/views.py:2824 +#: instances/views.py:2830 msgid "The XML has no name" msgstr "XML 中没有名称" -#: instances/views.py:2842 webvirtcloud/middleware.py:157 +#: instances/views.py:2848 webvirtcloud/middleware.py:157 #, python-format msgid "libvirt Error - %(exception)s" msgstr "libvirt 错误 - %(exception)s" -#: instances/views.py:2856 +#: instances/views.py:2862 msgid "An empty disk of the size you set" msgstr "按设定大小创建的空磁盘" -#: instances/views.py:2857 +#: instances/views.py:2863 msgid "Volumes already in a pool" msgstr "存储池中已有的卷" -#: instances/views.py:2858 +#: instances/views.py:2864 msgid "A copy of a template volume" msgstr "模板卷的副本" -#: instances/views.py:2948 +#: instances/views.py:2954 msgid "" "This host has no running storage pool for the VM's disks: add or start one on" " its Storage page." msgstr "此主机没有可用于虚拟机磁盘的运行中存储池:请在其“存储”页面添加或启动一个。" -#: instances/views.py:2950 +#: instances/views.py:2956 msgid "This host has no network for the VM: add one on its Networks page." msgstr "此主机没有可供虚拟机使用的网络:请在其“网络”页面添加一个。" -#: instances/views.py:2982 +#: instances/views.py:2988 #, python-format msgid "The machine type is q35, not %(machine)s: UEFI Secure Boot needs it" msgstr "机器类型为 q35,而不是 %(machine)s:UEFI 安全启动需要它" -#: instances/views.py:3011 +#: instances/views.py:3017 msgid "Flavor Created" msgstr "规格已创建" -#: instances/views.py:3019 +#: instances/views.py:3025 msgid "Create Flavor" msgstr "创建规格" -#: instances/views.py:3031 +#: instances/views.py:3037 msgid "Flavor Deleted" msgstr "规格已删除" -#: instances/views.py:3037 +#: instances/views.py:3043 msgid "Only the size template goes; VMs made from it keep their size." msgstr "仅删除此规格;由它创建的虚拟机保持其大小。" @@ -9082,19 +9082,19 @@ msgstr "服务器未告知文件大小" msgid "The file is larger than the pool's free space" msgstr "文件大于存储池的可用空间" -#: storages/jobs.py:303 +#: storages/jobs.py:304 msgid "The server sent more than the file's size" msgstr "服务器发送的数据超过了文件大小" -#: storages/jobs.py:314 +#: storages/jobs.py:315 msgid "The download ended early" msgstr "下载提前结束" -#: storages/jobs.py:320 +#: storages/jobs.py:321 msgid "The download stopped and its volume was not deleted" msgstr "下载已停止,但其卷未被删除" -#: storages/jobs.py:337 +#: storages/jobs.py:338 msgid "The download stopped; what it wrote was deleted" msgstr "下载已停止;已写入的内容已删除" @@ -10839,12 +10839,12 @@ msgid "" "first" msgstr "存储池 %(pool)s 是备份目标 %(target)s;请先将其从目标中移除" -#: vmbackups/utils.py:85 +#: vmbackups/utils.py:84 msgid "" "No backup target open to VM owners has a storage pool on this VM's host." msgstr "没有向虚拟机所有者开放的备份目标在此虚拟机的主机上有存储池。" -#: vmbackups/utils.py:86 +#: vmbackups/utils.py:85 msgid "No backup target has a storage pool on this VM's host." msgstr "没有备份目标在此虚拟机的主机上有存储池。" @@ -11325,99 +11325,104 @@ msgstr "未找到 ISO 镜像 %(image)s" msgid "ISO image %(image)s is in more than one storage pool" msgstr "ISO 镜像 %(image)s 位于多个存储池中" -#: vrtManager/instance.py:1509 +#: vrtManager/instance.py:1424 +#, python-format +msgid "ISO image %(image)s is no longer in pool %(pool)s; choose it again" +msgstr "ISO 镜像 %(image)s 已不在存储池 %(pool)s 中;请重新选择" + +#: vrtManager/instance.py:1521 #, python-format msgid "Disk %(target_dev)s is not in the VM's definition" msgstr "磁盘 %(target_dev)s 不在虚拟机的定义中" -#: vrtManager/instance.py:1641 +#: vrtManager/instance.py:1653 msgid "Please shutdown the instance then try to enable vCPU hotplug" msgstr "请先关闭虚拟机,再启用 vCPU 热插拔" -#: vrtManager/instance.py:1844 +#: vrtManager/instance.py:1856 #, python-format msgid "" "The serial console is a %(type)s one, the browser opens only a pty one; " "change it in the XML editor" msgstr "串行控制台的类型是 %(type)s,浏览器只能打开 pty 类型的;请在 XML 编辑器中更改" -#: vrtManager/instance.py:1955 +#: vrtManager/instance.py:1967 msgid "The VM has no video card" msgstr "虚拟机没有显卡" -#: vrtManager/instance.py:1965 +#: vrtManager/instance.py:1977 #, python-format msgid "" "The VM's CPU topology has %(count)s vCPUs: change it in the XML editor to set" " another maximum" msgstr "该虚拟机的 CPU 拓扑为 %(count)s 个 vCPU:要设置其他最大值,请在 XML 编辑器中修改拓扑" -#: vrtManager/instance.py:1991 +#: vrtManager/instance.py:2003 #, python-format msgid "The VM's next start has a maximum memory of %(max)s MiB" msgstr "虚拟机下次启动时的最大内存为 %(max)s MiB" -#: vrtManager/instance.py:2132 +#: vrtManager/instance.py:2144 msgid "" "The VM has external snapshots; internal snapshots cannot be mixed with them" msgstr "虚拟机有外部快照;内部快照不能与其混用" -#: vrtManager/instance.py:2160 +#: vrtManager/instance.py:2172 msgid "" "The VM has internal snapshots; external snapshots cannot be mixed with them" msgstr "虚拟机有内部快照;外部快照不能与其混用" -#: vrtManager/instance.py:2165 +#: vrtManager/instance.py:2177 msgid "Newer snapshots exist after the last revert; delete them first" msgstr "上次还原后存在更新的快照;请先删除它们" -#: vrtManager/instance.py:2168 +#: vrtManager/instance.py:2180 msgid "No snapshot is current; revert to a snapshot first" msgstr "没有当前快照;请先还原到某个快照" -#: vrtManager/instance.py:2174 +#: vrtManager/instance.py:2186 #, python-format msgid "Eject the media from %(dev)s first" msgstr "请先弹出 %(dev)s 中的介质" -#: vrtManager/instance.py:2176 +#: vrtManager/instance.py:2188 #, python-format msgid "Disk %(dev)s is not a file; external snapshots need file disks" msgstr "磁盘 %(dev)s 不是文件;外部快照需要文件磁盘" -#: vrtManager/instance.py:2189 +#: vrtManager/instance.py:2201 msgid "A snapshot with memory is not quiesced; it keeps the whole guest state" msgstr "含内存的快照不会静默文件系统;它保存整个客户机状态" -#: vrtManager/instance.py:2191 +#: vrtManager/instance.py:2203 msgid "Only a running VM's file systems can be frozen" msgstr "只有运行中的虚拟机的文件系统可以冻结" -#: vrtManager/instance.py:2193 +#: vrtManager/instance.py:2205 msgid "The QEMU guest agent is not connected; it freezes the file systems" msgstr "QEMU 客户机代理未连接;文件系统由它冻结" -#: vrtManager/instance.py:2202 +#: vrtManager/instance.py:2214 #, python-format msgid "" "The storage pools could not be refreshed, so their free space is unknown: " "%(err)s" msgstr "无法刷新存储池,其可用空间未知:%(err)s" -#: vrtManager/instance.py:2225 +#: vrtManager/instance.py:2237 msgid "Memory is saved only from a running VM" msgstr "只能保存运行中的虚拟机的内存" -#: vrtManager/instance.py:2227 +#: vrtManager/instance.py:2239 msgid "The VM has no disk to keep its memory next to" msgstr "虚拟机没有可存放其内存的磁盘" -#: vrtManager/instance.py:2231 +#: vrtManager/instance.py:2243 #, python-format msgid "%(disk)s is not in a storage pool; memory is saved only into one" msgstr "%(disk)s 不在存储池中;内存只能保存到存储池中" -#: vrtManager/instance.py:2262 +#: vrtManager/instance.py:2274 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the snapshot needs %(size).1f " @@ -11427,147 +11432,147 @@ msgstr "" "存储池 %(pool)s 可用 %(free).1f GiB;快照需要 %(size).1f GiB(其中虚拟机磁盘的 %(percent)g%%,至少 " "%(minimum)g GiB,若保存内存则另加内存)" -#: vrtManager/instance.py:2280 +#: vrtManager/instance.py:2292 msgid "" "This snapshot was taken by an older version on a UEFI VM and cannot be " "reverted; delete it instead" msgstr "此快照由旧版本在 UEFI 虚拟机上创建,无法还原;请将其删除" -#: vrtManager/instance.py:2310 +#: vrtManager/instance.py:2322 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is " "running." msgstr "还原两次失败;请稍后重试(%(error)s)。虚拟机正在运行。" -#: vrtManager/instance.py:2312 +#: vrtManager/instance.py:2324 #, python-format msgid "" "The revert failed twice; try again in a moment (%(error)s). The VM is shut " "off." msgstr "还原两次失败;请稍后重试(%(error)s)。虚拟机已关机。" -#: vrtManager/instance.py:2480 +#: vrtManager/instance.py:2492 msgid "A disk moves when its VM is defined and running, paused or shut off" msgstr "仅当虚拟机已定义且处于运行、暂停或关机状态时才能移动磁盘" -#: vrtManager/instance.py:2482 +#: vrtManager/instance.py:2494 msgid "" "A disk of a VM with snapshots, a saved state or a running block job does not " "move" msgstr "有快照、保存的状态或正在运行块任务的虚拟机的磁盘不能移动" -#: vrtManager/instance.py:2490 +#: vrtManager/instance.py:2502 #, python-format msgid "" "%(dev)s is not a disk file of the VM, the same in its running and next " "start's definition" msgstr "%(dev)s 不是该虚拟机在运行中的定义和下次启动定义中相同的磁盘文件" -#: vrtManager/instance.py:2495 +#: vrtManager/instance.py:2507 #, python-format msgid "%(dev)s does not move: only writable raw and qcow2 disks do" msgstr "%(dev)s 不能移动:只能移动可写的 raw 和 qcow2 磁盘" -#: vrtManager/instance.py:2502 +#: vrtManager/instance.py:2514 #, python-format msgid "%(dev)s does not move: no storage pool has %(path)s" msgstr "%(dev)s 不能移动:没有存储池包含 %(path)s" -#: vrtManager/instance.py:2504 +#: vrtManager/instance.py:2516 #, python-format msgid "%(dev)s does not move: it has a backing file" msgstr "%(dev)s 不能移动:它有后备文件" -#: vrtManager/instance.py:2507 +#: vrtManager/instance.py:2519 #, python-format msgid "%(pool_name)s is not an active pool of disk files of this host" msgstr "%(pool_name)s 不是此主机上活动的磁盘文件存储池" -#: vrtManager/instance.py:2510 +#: vrtManager/instance.py:2522 #, python-format msgid "%(dev)s is in pool %(pool_name)s already" msgstr "%(dev)s 已在存储池 %(pool_name)s 中" -#: vrtManager/instance.py:2514 +#: vrtManager/instance.py:2526 #, python-format msgid "Pool %(pool_name)s already has a file %(name)s" msgstr "存储池 %(pool_name)s 中已有文件 %(name)s" -#: vrtManager/instance.py:2538 +#: vrtManager/instance.py:2550 #, python-format msgid "The copy of %(dev)s ended before it was complete" msgstr "%(dev)s 的复制在完成前结束" -#: vrtManager/instance.py:2583 +#: vrtManager/instance.py:2595 #, python-format msgid "%(error)s; remove %(dest)s if it is there: %(cleanup_error)s" msgstr "%(error)s;如果 %(dest)s 存在请将其删除:%(cleanup_error)s" -#: vrtManager/instance.py:2585 +#: vrtManager/instance.py:2597 #, python-format msgid "%(error)s; the VM may use %(dest)s now: check its disk %(dev)s" msgstr "%(error)s;虚拟机现在可能在使用 %(dest)s:请检查其磁盘 %(dev)s" -#: vrtManager/instance.py:2592 +#: vrtManager/instance.py:2604 #, python-format msgid "The VM has no internal snapshot named %(name)s" msgstr "虚拟机没有名为 %(name)s 的内部快照" -#: vrtManager/instance.py:2603 +#: vrtManager/instance.py:2615 msgid "A snapshot job is still running on this VM; try again when it ends" msgstr "此虚拟机上仍有快照任务在运行;请在其结束后重试" -#: vrtManager/instance.py:2613 +#: vrtManager/instance.py:2625 msgid "Shut the VM down to revert to an internal snapshot" msgstr "请关闭虚拟机后再还原到内部快照" -#: vrtManager/instance.py:2680 +#: vrtManager/instance.py:2692 msgid "Cannot clone a VM whose NVRAM is not a file" msgstr "NVRAM 不是文件的虚拟机无法克隆" -#: vrtManager/instance.py:2751 +#: vrtManager/instance.py:2763 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(path)s" msgstr "克隆失败(%(err)s);请手动删除这些副本:%(path)s" -#: vrtManager/instance.py:2762 +#: vrtManager/instance.py:2774 msgid "Shut the VM down before cloning it" msgstr "请先关闭虚拟机再克隆" -#: vrtManager/instance.py:2789 +#: vrtManager/instance.py:2801 #, python-format msgid "Clone failed (%(err)s); remove these copies by hand: %(leftovers)s" msgstr "克隆失败(%(err)s);请手动删除这些副本:%(leftovers)s" -#: vrtManager/instance.py:2800 +#: vrtManager/instance.py:2812 msgid "Live clone needs libvirt 11.10 or later; shut the VM down to clone it" msgstr "在线克隆需要 libvirt 11.10 或更高版本;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2803 +#: vrtManager/instance.py:2815 msgid "A VM with a TPM is cloned only shut down" msgstr "带 TPM 的虚拟机只能在关机时克隆" -#: vrtManager/instance.py:2806 +#: vrtManager/instance.py:2818 #, python-format msgid "Disk %(dev)s is not a local file; shut the VM down to clone it" msgstr "磁盘 %(dev)s 不是本地文件;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2808 +#: vrtManager/instance.py:2820 #, python-format msgid "Disk %(dev)s is shareable; shut the VM down to clone it" msgstr "磁盘 %(dev)s 是可共享的;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2813 +#: vrtManager/instance.py:2825 #, python-format msgid "Disk %(dev)s changes at the next start; shut the VM down to clone it" msgstr "磁盘 %(dev)s 在下次启动时会改变;请关闭虚拟机后再克隆" -#: vrtManager/instance.py:2815 +#: vrtManager/instance.py:2827 msgid "Another job is running on the VM; clone it when that ends" msgstr "虚拟机上有另一个任务正在运行;请在其结束后再克隆" -#: vrtManager/instance.py:2841 +#: vrtManager/instance.py:2853 #, python-format msgid "" "Storage pool %(pool)s has %(free).1f GiB free; the clone needs %(size).1f GiB" @@ -11576,111 +11581,111 @@ msgstr "" "存储池 %(pool)s 可用 %(free).1f GiB;克隆需要 %(size).1f GiB(复制的磁盘,再加其 %(percent)g%%,至少" " %(minimum)g GiB)" -#: vrtManager/instance.py:2858 +#: vrtManager/instance.py:2870 #, python-format msgid "Volume %(name)s already exists in storage pool %(pool)s" msgstr "卷 %(name)s 已存在于存储池 %(pool)s 中" -#: vrtManager/instance.py:3046 +#: vrtManager/instance.py:3058 msgid "A network interface that is a host device is removed in the XML editor" msgstr "作为主机设备的网络接口需在 XML 编辑器中删除" -#: vrtManager/instance.py:3062 +#: vrtManager/instance.py:3074 #, python-format msgid "No network interface with MAC %(old_mac)s" msgstr "没有 MAC 为 %(old_mac)s 的网络接口" -#: vrtManager/instance.py:3065 +#: vrtManager/instance.py:3077 msgid "A network interface that is a host device is changed in the XML editor" msgstr "作为主机设备的网络接口需在 XML 编辑器中修改" -#: vrtManager/instance.py:3159 +#: vrtManager/instance.py:3171 msgid "" "A VM changes its PCI devices while it runs, or is shut off without a saved " "state" msgstr "虚拟机只能在运行时或无保存的状态的关机时更改其 PCI 设备" -#: vrtManager/instance.py:3180 +#: vrtManager/instance.py:3192 #, python-format msgid "%(err)s; whether the VM has %(device)s now is not known" msgstr "%(err)s;虚拟机现在是否有 %(device)s 未知" -#: vrtManager/instance.py:3182 +#: vrtManager/instance.py:3194 #, python-format msgid "%(err)s; %(device)s: the VM is not running, its next start has it" msgstr "%(err)s;%(device)s:虚拟机未运行,下次启动时有它" -#: vrtManager/instance.py:3183 +#: vrtManager/instance.py:3195 #, python-format msgid "" "%(err)s; %(device)s: the VM is not running, its next start does not have it" msgstr "%(err)s;%(device)s:虚拟机未运行,下次启动时没有它" -#: vrtManager/instance.py:3184 +#: vrtManager/instance.py:3196 #, python-format msgid "%(err)s; %(device)s: the running VM has it, its next start has it" msgstr "%(err)s;%(device)s:运行中的虚拟机有它,下次启动时有它" -#: vrtManager/instance.py:3185 +#: vrtManager/instance.py:3197 #, python-format msgid "" "%(err)s; %(device)s: the running VM has it, its next start does not have it" msgstr "%(err)s;%(device)s:运行中的虚拟机有它,下次启动时没有它" -#: vrtManager/instance.py:3186 +#: vrtManager/instance.py:3198 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start has it" msgstr "%(err)s;%(device)s:运行中的虚拟机没有它,下次启动时有它" -#: vrtManager/instance.py:3188 +#: vrtManager/instance.py:3200 #, python-format msgid "" "%(err)s; %(device)s: the running VM does not have it, its next start does not" " have it" msgstr "%(err)s;%(device)s:运行中的虚拟机没有它,下次启动时没有它" -#: vrtManager/instance.py:3222 +#: vrtManager/instance.py:3234 #, python-format msgid "The VM has no PCI device %(address)s" msgstr "虚拟机没有 PCI 设备 %(address)s" -#: vrtManager/instance.py:3243 +#: vrtManager/instance.py:3255 msgid "The VM has no USB controller" msgstr "虚拟机没有 USB 控制器" -#: vrtManager/instance.py:3277 +#: vrtManager/instance.py:3289 msgid "The VM has no such USB device" msgstr "虚拟机没有此 USB 设备" -#: vrtManager/instance.py:3291 +#: vrtManager/instance.py:3303 #, python-format msgid "The VM has no network interface %(mac)s" msgstr "虚拟机没有网络接口 %(mac)s" -#: vrtManager/instance.py:3323 +#: vrtManager/instance.py:3335 msgid "The VM has its own RNG device: change it in the XML editor" msgstr "虚拟机有自己的 RNG 设备:请在 XML 编辑器中修改" -#: vrtManager/instance.py:3350 +#: vrtManager/instance.py:3362 msgid "The VM has its own TPM: change it in the XML editor" msgstr "虚拟机有自己的 TPM:请在 XML 编辑器中修改" -#: vrtManager/instance.py:3369 +#: vrtManager/instance.py:3381 #, python-format msgid "Unknown crash action %(action)s" msgstr "未知的崩溃操作 %(action)s" -#: vrtManager/instance.py:3396 +#: vrtManager/instance.py:3408 #, python-format msgid "Network interface %(mac)s is not in the definition" msgstr "网络接口 %(mac)s 不在定义中" -#: vrtManager/instance.py:3487 +#: vrtManager/instance.py:3499 msgid "The guest agent did not answer in time; nothing was changed" msgstr "客户机代理未及时响应;未做任何更改" -#: vrtManager/instance.py:3490 +#: vrtManager/instance.py:3502 msgid "The VM runs Windows: its guest agent sets no root password or SSH key" msgstr "该虚拟机运行 Windows:其客户机代理不能设置 root 密码或 SSH 密钥" diff --git a/operations/migrations/0006_claim_resource_text.py b/operations/migrations/0006_claim_resource_text.py new file mode 100644 index 00000000..ae00a5b2 --- /dev/null +++ b/operations/migrations/0006_claim_resource_text.py @@ -0,0 +1,18 @@ +# Generated by Django 5.2.18 on 2026-11-20 13:45 + +from django.db import migrations, models + + +class Migration(migrations.Migration): + + dependencies = [ + ('operations', '0005_alert'), + ] + + operations = [ + migrations.AlterField( + model_name='claim', + name='resource', + field=models.TextField(db_index=True), + ), + ] diff --git a/operations/models.py b/operations/models.py index dbb4ee39..e8ae6979 100644 --- a/operations/models.py +++ b/operations/models.py @@ -79,7 +79,7 @@ class Claim(models.Model): EXCLUSIVE = "exclusive" operation = models.ForeignKey(Operation, null=True, on_delete=models.CASCADE, related_name="claims") - resource = models.CharField(max_length=255, db_index=True) + resource = models.TextField(db_index=True) # a volume's key holds its pool's and file's names mode = models.CharField(max_length=9, choices=[(SHARED, SHARED), (EXCLUSIVE, EXCLUSIVE)]) holder = models.CharField(max_length=128, blank=True) # transient: host:pid:thread expires_at = models.DateTimeField(null=True) # transient only diff --git a/operations/tests/test_claims.py b/operations/tests/test_claims.py index 095541ff..518c89bb 100644 --- a/operations/tests/test_claims.py +++ b/operations/tests/test_claims.py @@ -30,6 +30,13 @@ class AdmitTestCase(TestCase): claims.admit({"compute:1": X}, holder="c") self.assertEqual((busy.exception.resource, busy.exception.blocker), ("compute:1", None)) + def test_a_long_volume_key_is_held(self): + # a pool's and a long file name's: more than 255 characters, which PostgreSQL refused + key = claims.volume_key(1, "default", "a" * 250 + ".iso") + claims.admit({key: S}, holder="a") + with self.assertRaises(claims.Busy): + claims.admit({key: X}, holder="b") + def test_a_refusal_writes_nothing(self): claims.admit({"instance:u1": X}, holder="a") with self.assertRaises(claims.Busy): diff --git a/storages/jobs.py b/storages/jobs.py index 2c4ed1f4..44d375a6 100644 --- a/storages/jobs.py +++ b/storages/jobs.py @@ -297,7 +297,8 @@ class FetchVolume(Kind): def chunks(): done, checked = 0, time.monotonic() try: - for data in answer.stream(2**20, decode_content=False): + # what has come, up to 1 MiB: a slow server's bytes are not held until a whole MiB + for data in iter(lambda: answer.read1(2**20, decode_content=False), b""): done += len(data) if done > size: raise util.OperationError(gettext_noop("The server sent more than the file's size")) diff --git a/storages/tests/test_pool_in_use.py b/storages/tests/test_pool_in_use.py index fd59d210..a88e32d0 100644 --- a/storages/tests/test_pool_in_use.py +++ b/storages/tests/test_pool_in_use.py @@ -83,8 +83,10 @@ class PoolInUseTests(TestCase): def test_a_backup_target_pool_is_not_stopped_during_a_backup(self): from vmbackups.models import BackupTarget, BackupTargetPool - target = BackupTarget.objects.create(name="nfs-b") - BackupTargetPool.objects.create(target=target, compute=self.compute, pool="use-pool", pool_uuid="u1") + # the pool of two targets: a backup to the second one counts too + for name in ("nfs-a", "nfs-b"): + target = BackupTarget.objects.create(name=name) + BackupTargetPool.objects.create(target=target, compute=self.compute, pool="use-pool", pool_uuid="u1") admit({f"backup_target:{target.pk}": Claim.EXCLUSIVE}, holder="other-node:1:1") # a backup writes to it self.assertIn("A short operation is in progress on this resource; try again in a moment.", self.post("stop")) self.assertTrue(self.pool.isActive()) diff --git a/storages/tests/test_volume_fetch_job.py b/storages/tests/test_volume_fetch_job.py index 0253be91..86059a99 100644 --- a/storages/tests/test_volume_fetch_job.py +++ b/storages/tests/test_volume_fetch_job.py @@ -25,7 +25,7 @@ def answer(chunks, size=None, status=200, headers=None): body.headers = {"Content-Length": str(size if size is not None else sum(map(len, chunks))), **(headers or {})} if size == -1: del body.headers["Content-Length"] - body.stream.return_value = iter(chunks) + body.read1.side_effect = [*chunks, b""] return body diff --git a/vmbackups/utils.py b/vmbackups/utils.py index 323e195c..53bd790b 100644 --- a/vmbackups/utils.py +++ b/vmbackups/utils.py @@ -53,11 +53,10 @@ def refuse_target_pool(compute, pool): def pool_stop_claims(compute, pool): """The claims that keep out a pool's jobs while it is stopped or deleted: the pool's, and its - backup target's if it is one (backup jobs claim the target).""" + backup targets' if it is one or more (backup jobs claim the target).""" keys = {claims.pool_key(compute.pk, pool): Claim.EXCLUSIVE} - row = BackupTargetPool.objects.filter(compute=compute, pool=pool).first() - if row: - keys[claims.backup_target_key(row.target_id)] = Claim.EXCLUSIVE + for target in BackupTargetPool.objects.filter(compute=compute, pool=pool).values_list("target_id", flat=True): + keys[claims.backup_target_key(target)] = Claim.EXCLUSIVE return keys diff --git a/vrtManager/instance.py b/vrtManager/instance.py index 4b685dff..2a86e5ab 100644 --- a/vrtManager/instance.py +++ b/vrtManager/instance.py @@ -1401,21 +1401,33 @@ class wvmInstance(wvmConnect): raise util.OperationError(gettext_noop("Media of %(dev)s changed in the running VM only: %(err)s"), dev=dev, err=err) from err raise - def get_iso_path(self, image): - """The path of the ISO image of that name, in one of the active pools.""" - paths = [] + def iso_location(self, image): + """(pool, path) of the ISO image of that name, in one of the active pools.""" + found = [] for storage in self.get_storages(only_actives=True): stg = self.get_storage(storage) if image in stg.listVolumes(): - paths.append(stg.storageVolLookupByName(image).path()) - if not paths: + found.append((storage, stg.storageVolLookupByName(image).path())) + if not found: raise util.OperationError(gettext_noop("ISO image %(image)s was not found"), image=image) - if len(paths) > 1: + if len(found) > 1: raise util.OperationError(gettext_noop("ISO image %(image)s is in more than one storage pool"), image=image) - return paths[0] + return found[0] - def mount_iso(self, dev, image): - self._set_cdrom_media(dev, self.get_iso_path(image)) + def get_iso_path(self, image): + return self.iso_location(image)[1] + + def iso_path_in(self, image, pool): + """The path of the ISO image, which must still be the one of that pool (the one a caller claimed).""" + found, path = self.iso_location(image) + if found != pool: + raise util.OperationError(gettext_noop("ISO image %(image)s is no longer in pool %(pool)s; choose it again"), + image=image, pool=pool) + return path + + def mount_iso(self, dev, image, pool=None): + """Insert the ISO image; pool: the pool it must be in, when the caller claimed its volume there.""" + self._set_cdrom_media(dev, self.iso_path_in(image, pool) if pool else self.get_iso_path(image)) def umount_iso(self, dev, image=None): self._set_cdrom_media(dev, None)