public inbox for pve-devel@lists.proxmox.com
 help / color / mirror / Atom feed
* [pve-devel] [PATCH qemu-server] fix #3329: turn on cache=writeback for efidisks on rbd
@ 2021-06-16 13:09 Dominik Csapak
  2021-06-16 13:25 ` Maximilian Hill
  2021-06-16 13:47 ` [pve-devel] applied: " Thomas Lamprecht
  0 siblings, 2 replies; 4+ messages in thread
From: Dominik Csapak @ 2021-06-16 13:09 UTC (permalink / raw)
  To: pve-devel

on slower ceph clusters, the write pattern of the ovmf booting process
slows down the boot of the vm, so we turn on caching by default

it seems no other storage (until now) behaves like this. if it does in
the future, we can still add them too, or add a 'cache' property for
the efidisk

Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
---
 PVE/QemuServer.pm | 10 +++++++++-
 1 file changed, 9 insertions(+), 1 deletion(-)

diff --git a/PVE/QemuServer.pm b/PVE/QemuServer.pm
index d77981c..96375c3 100644
--- a/PVE/QemuServer.pm
+++ b/PVE/QemuServer.pm
@@ -3307,8 +3307,16 @@ sub config_to_command {
 	    $size_str = ",size=" . (-s $ovmf_vars);
 	}
 
+	# on slower ceph clusters, booting without cache on efidisk can take a while.
+	# enable cache by default, should not be harmful since it's only the efidisk
+	# see #3329
+	my $cache = "";
+	if ($path =~ m/^rbd:/) {
+	    $cache = ',cache=writeback';
+	}
+
 	push @$cmd, '-drive', "if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code";
-	push @$cmd, '-drive', "if=pflash,unit=1,format=$format,id=drive-efidisk0$size_str,file=$path";
+	push @$cmd, '-drive', "if=pflash,unit=1$cache,format=$format,id=drive-efidisk0$size_str,file=$path";
     }
 
     # load q35 config
-- 
2.20.1





^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pve-devel] [PATCH qemu-server] fix #3329: turn on cache=writeback for efidisks on rbd
  2021-06-16 13:09 [pve-devel] [PATCH qemu-server] fix #3329: turn on cache=writeback for efidisks on rbd Dominik Csapak
@ 2021-06-16 13:25 ` Maximilian Hill
  2021-06-16 13:34   ` Thomas Lamprecht
  2021-06-16 13:47 ` [pve-devel] applied: " Thomas Lamprecht
  1 sibling, 1 reply; 4+ messages in thread
From: Maximilian Hill @ 2021-06-16 13:25 UTC (permalink / raw)
  To: Proxmox VE development discussion

[-- Attachment #1: Type: text/plain, Size: 734 bytes --]

Hello,

On Wed, Jun 16, 2021 at 03:09:33PM +0200, Dominik Csapak wrote:
> on slower ceph clusters, the write pattern of the ovmf booting process
> slows down the boot of the vm, so we turn on caching by default
> 
> +	my $cache = "";
> +	if ($path =~ m/^rbd:/) {
> +	    $cache = ',cache=writeback';
does this work, evven if the rbd storage is not called "rbd"?
> +	}
> +
>  	push @$cmd, '-drive', "if=pflash,unit=0,format=raw,readonly=on,file=$ovmf_code";
> -	push @$cmd, '-drive', "if=pflash,unit=1,format=$format,id=drive-efidisk0$size_str,file=$path";
> +	push @$cmd, '-drive', "if=pflash,unit=1$cache,format=$format,id=drive-efidisk0$size_str,file=$path";
>      }
>  
>      # load q35 config
> -- 
> 2.20.1

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 4+ messages in thread

* Re: [pve-devel] [PATCH qemu-server] fix #3329: turn on cache=writeback for efidisks on rbd
  2021-06-16 13:25 ` Maximilian Hill
@ 2021-06-16 13:34   ` Thomas Lamprecht
  0 siblings, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2021-06-16 13:34 UTC (permalink / raw)
  To: Proxmox VE development discussion, Maximilian Hill

hi,

On 16.06.21 15:25, Maximilian Hill wrote:
> On Wed, Jun 16, 2021 at 03:09:33PM +0200, Dominik Csapak wrote:
>> on slower ceph clusters, the write pattern of the ovmf booting process
>> slows down the boot of the vm, so we turn on caching by default
>>
>> +	my $cache = "";
>> +	if ($path =~ m/^rbd:/) {
>> +	    $cache = ',cache=writeback';
> does this work, evven if the rbd storage is not called "rbd"?

yes, this has nothing to do with the storage name, the path is already translated here
and "rbd:" tells QEMU to use librdb for accessing this image.




^ permalink raw reply	[flat|nested] 4+ messages in thread

* [pve-devel] applied: [PATCH qemu-server] fix #3329: turn on cache=writeback for efidisks on rbd
  2021-06-16 13:09 [pve-devel] [PATCH qemu-server] fix #3329: turn on cache=writeback for efidisks on rbd Dominik Csapak
  2021-06-16 13:25 ` Maximilian Hill
@ 2021-06-16 13:47 ` Thomas Lamprecht
  1 sibling, 0 replies; 4+ messages in thread
From: Thomas Lamprecht @ 2021-06-16 13:47 UTC (permalink / raw)
  To: Proxmox VE development discussion, Dominik Csapak

On 16.06.21 15:09, Dominik Csapak wrote:
> on slower ceph clusters, the write pattern of the ovmf booting process
> slows down the boot of the vm, so we turn on caching by default
> 
> it seems no other storage (until now) behaves like this. if it does in
> the future, we can still add them too, or add a 'cache' property for
> the efidisk
> 
> Signed-off-by: Dominik Csapak <d.csapak@proxmox.com>
> ---
>  PVE/QemuServer.pm | 10 +++++++++-
>  1 file changed, 9 insertions(+), 1 deletion(-)
> 
>

applied, thanks!

I added a cfg2cmd test and made it a shorter ternary operation as followup




^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2021-06-16 13:48 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-06-16 13:09 [pve-devel] [PATCH qemu-server] fix #3329: turn on cache=writeback for efidisks on rbd Dominik Csapak
2021-06-16 13:25 ` Maximilian Hill
2021-06-16 13:34   ` Thomas Lamprecht
2021-06-16 13:47 ` [pve-devel] applied: " Thomas Lamprecht

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox
Service provided by Proxmox Server Solutions GmbH | Privacy | Legal