From 39a012b711963305b100df1172a6955142589117 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Edwin=20T=C3=B6r=C3=B6k?= Date: Tue, 25 Jul 2023 14:45:24 +0100 Subject: [PATCH] CA-380551: bump minimum HA SR size to 4GiB MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Commit 00cb7f2fa changed the default (recommended) size of the redo log to 4GiB, while keeping the minimum at 256MiB for backwards compatibility with existing VDIs. However: * HA must be disabled/re-enabled across updates anyway so backwards compatibility is not needed * the redo-log on its own is known not to work (bug), keeping backwards compatibility here is not useful * it makes it more difficult for XenCenter to tell the user when they chose an SR that is too small If the SR is greater than minimum but below recommended then from the CLI you could still enable HA and create a redo log of the appropriate size, but not from XenCenter (where the size cannot be chosen). We could expose a new RO pool field with the minimum size and update clients to use that, but that is unnecessary complication for a very rare use case. Revert the 'recommended_size' introduction, and instead bump the minimum size. The existing 'SR.assert_can_host_statefile' can then report an error when the size is wrong and XenCenter can appropriately grey out the choice for the user with the correct message. (And this method works also for other reasons why we might reject an SR). Fixes: 00cb7f2fa ("redo-log: bump default size to 4GiB") Signed-off-by: Edwin Török --- ocaml/database/redo_log.ml | 2 +- ocaml/database/redo_log.mli | 3 --- ocaml/xapi/xapi_pool.ml | 2 +- ocaml/xapi/xapi_sr.ml | 2 +- ocaml/xapi/xha_metadata_vdi.ml | 4 ++-- 5 files changed, 5 insertions(+), 8 deletions(-) diff --git a/ocaml/database/redo_log.ml b/ocaml/database/redo_log.ml index 6ef17b93c4e..566ef0952c0 100644 --- a/ocaml/database/redo_log.ml +++ b/ocaml/database/redo_log.ml @@ -49,7 +49,7 @@ let mib megabytes = Int64.of_int megabytes ** 1024L ** 1024L (* Make sure we have plenty of room for the database *) -let minimum_vdi_size, recommended_vdi_size = (mib 256, mib 4096) +let minimum_vdi_size = mib 4096 let redo_log_sm_config = [("type", "raw")] diff --git a/ocaml/database/redo_log.mli b/ocaml/database/redo_log.mli index 800922c7b0a..710612fe9fa 100644 --- a/ocaml/database/redo_log.mli +++ b/ocaml/database/redo_log.mli @@ -21,9 +21,6 @@ val get_static_device : string -> string option val minimum_vdi_size : int64 (** Minimum size for redo log VDI *) -val recommended_vdi_size : int64 -(** Recommended size for redo log VDI *) - val redo_log_sm_config : (string * string) list (** SM config for redo log VDI *) diff --git a/ocaml/xapi/xapi_pool.ml b/ocaml/xapi/xapi_pool.ml index b5345bbbb1d..9f5e8fd39a8 100644 --- a/ocaml/xapi/xapi_pool.ml +++ b/ocaml/xapi/xapi_pool.ml @@ -2858,7 +2858,7 @@ let create_redo_log_vdi ~__context ~sr = Client.VDI.create ~rpc ~session_id ~name_label:"Metadata redo-log" ~name_description: "Used when HA is disabled, while extra security is still desired" - ~sR:sr ~virtual_size:Redo_log.recommended_vdi_size ~_type:`redo_log + ~sR:sr ~virtual_size:Redo_log.minimum_vdi_size ~_type:`redo_log ~sharable:true ~read_only:false ~other_config:[] ~xenstore_data:[] ~sm_config:Redo_log.redo_log_sm_config ~tags:[] ) diff --git a/ocaml/xapi/xapi_sr.ml b/ocaml/xapi/xapi_sr.ml index 7abd3e5f7b4..8f4bc9a3711 100644 --- a/ocaml/xapi/xapi_sr.ml +++ b/ocaml/xapi/xapi_sr.ml @@ -942,7 +942,7 @@ let find_or_create_metadata_vdi ~__context ~sr = Helpers.call_api_functions ~__context (fun rpc session_id -> Client.VDI.create ~rpc ~session_id ~name_label:"Metadata for DR" ~name_description:"Used for disaster recovery" ~sR:sr - ~virtual_size:Redo_log.recommended_vdi_size ~_type:`metadata + ~virtual_size:Redo_log.minimum_vdi_size ~_type:`metadata ~sharable:false ~read_only:false ~other_config:[] ~xenstore_data:[] ~sm_config:Redo_log.redo_log_sm_config ~tags:[] ) diff --git a/ocaml/xapi/xha_metadata_vdi.ml b/ocaml/xapi/xha_metadata_vdi.ml index 311edc71394..d824bf6a493 100644 --- a/ocaml/xapi/xha_metadata_vdi.ml +++ b/ocaml/xapi/xha_metadata_vdi.ml @@ -24,8 +24,8 @@ let create ~__context ~sr = Helpers.call_api_functions ~__context (fun rpc session_id -> Client.VDI.create ~rpc ~session_id ~name_label:"Metadata for HA" ~name_description:"Used for master failover" ~sR:sr - ~virtual_size:Redo_log.recommended_vdi_size ~_type:`redo_log - ~sharable:true ~read_only:false ~other_config:[] ~xenstore_data:[] + ~virtual_size:Redo_log.minimum_vdi_size ~_type:`redo_log ~sharable:true + ~read_only:false ~other_config:[] ~xenstore_data:[] ~sm_config:Redo_log.redo_log_sm_config ~tags:[] )