Skip to content

Instantly share code, notes, and snippets.

@ilyaevseev
Created July 30, 2019 03:26
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save ilyaevseev/effc9a6a2bdc4f9bf90000a384488bd0 to your computer and use it in GitHub Desktop.
Save ilyaevseev/effc9a6a2bdc4f9bf90000a384488bd0 to your computer and use it in GitHub Desktop.
ProxmoxVE patch for Ceph RBD tuning.Taken from https://pve.proxmox.com/pipermail/pve-devel/2018-June/032787.html with debugging output
diff -u /usr/share/perl5/PVE/QemuServer.pm*
--- /usr/share/perl5/PVE/QemuServer.pm0 2019-05-25 12:40:24.000000000 +0300
+++ /usr/share/perl5/PVE/QemuServer.pm 2019-06-24 07:06:34.825186937 +0300
@@ -1881,6 +1881,18 @@
$device .= ",serial=$serial";
}
+ my $volid = $drive->{file};
+ if ($volid && $drive->{discard}) {
+ my $storage_name = PVE::Storage::parse_volume_id($volid);
+ if ($storecfg->{ids}->{$storage_name}->{type} eq 'rbd') {
+ $device .= ",discard_granularity=4194304";
+ print "DBUG: VM $vmid, volume $volid = rbd, discard\n";
+ } else {
+ print "DBUG: VM $vmid, volume $volid = no rbd\n";
+ }
+ } else {
+ print "DBUG: VM $vmid, volume $volid = no discard\n";
+ }
return $device;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment