Hi everyone!
I want to apply this patch but i am not sure how.
Patch: https://pve.proxmox.com/pipermail/pve-devel/2019-April/036621.html
and the code
Could someone please explain, I am sure its simple.
I assume
the - means remove line in file
the + is add line in file
?
Thanks
I want to apply this patch but i am not sure how.
Patch: https://pve.proxmox.com/pipermail/pve-devel/2019-April/036621.html
and the code
Code:
use list_images to check for existence of cloudinit disk instead of
'-e'. this should solve the problem with rbd where the path returned by
PVE::Storage::path is not checkable with '-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
Last edited: