Привет всем! Хочу применить этот патч, но не уверен, как это сделать.
Патч:
Код: использовать list_images для проверки существования диска cloudinit вместо '-e'. Это должно решить проблему с rbd, когда путь, возвращаемый PVE::Storage::path, нельзя проверить с помощью '-e'.
Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
PVE/QemuServer/Cloudinit.pm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
index 445c777..da08470 100644
--- a/PVE/QemuServer/Cloudinit.pm
+++ b/PVE/QemuServer/Cloudinit.pm
@@ -31,13 +31,17 @@ sub commit_cloudinit_disk {
my $iso_path = PVE::Storage::path($storecfg, $drive->{file});
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
my $format = PVE::QemuServer::qemu_img_format($scfg, $volname);
- if (! -e $iso_path) {
+
+ my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+ my $vollist = $plugin->list_images($storeid, $scfg, $vmid);
+ my $exists = grep { $_->{volid} eq $drive->{file} } @$vollist;
+
+ if (!$exists) {
$volname =~ m/(vm-$vmid-cloudinit(.(qcow2|raw))?)/;
my $name = $1;
my $d = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $format, $name, 4 * 1024);
}
- my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
$plugin->activate_volume($storeid, $scfg, $volname);
my $size = PVE::Storage::file_size_info($iso_path);
--
2.11.0 Could someone please explain, I am sure its simple. I assume the - means remove line in file the + is add line in file ? Thanks
Патч:
Код: использовать list_images для проверки существования диска cloudinit вместо '-e'. Это должно решить проблему с rbd, когда путь, возвращаемый PVE::Storage::path, нельзя проверить с помощью '-e'.
Signed-off-by: Mira Limbeck <m.limbeck at proxmox.com>
---
PVE/QemuServer/Cloudinit.pm | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/PVE/QemuServer/Cloudinit.pm b/PVE/QemuServer/Cloudinit.pm
index 445c777..da08470 100644
--- a/PVE/QemuServer/Cloudinit.pm
+++ b/PVE/QemuServer/Cloudinit.pm
@@ -31,13 +31,17 @@ sub commit_cloudinit_disk {
my $iso_path = PVE::Storage::path($storecfg, $drive->{file});
my $scfg = PVE::Storage::storage_config($storecfg, $storeid);
my $format = PVE::QemuServer::qemu_img_format($scfg, $volname);
- if (! -e $iso_path) {
+
+ my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
+ my $vollist = $plugin->list_images($storeid, $scfg, $vmid);
+ my $exists = grep { $_->{volid} eq $drive->{file} } @$vollist;
+
+ if (!$exists) {
$volname =~ m/(vm-$vmid-cloudinit(.(qcow2|raw))?)/;
my $name = $1;
my $d = PVE::Storage::vdisk_alloc($storecfg, $storeid, $vmid, $format, $name, 4 * 1024);
}
- my $plugin = PVE::Storage::Plugin->lookup($scfg->{type});
$plugin->activate_volume($storeid, $scfg, $volname);
my $size = PVE::Storage::file_size_info($iso_path);
--
2.11.0 Could someone please explain, I am sure its simple. I assume the - means remove line in file the + is add line in file ? Thanks
