[pve-devel] [PATCH manager 1/2] pve5to6: check ceph config for mon_host line
Thomas Lamprecht
t.lamprecht at proxmox.com
Thu Jul 4 10:33:40 CEST 2019
On 7/4/19 9:35 AM, Dominik Csapak wrote:
> this already works on luminous, so it does not harm to add it already,
> and is recommended when both msgr1 and msgr2 is activated in nautilus
>
> Signed-off-by: Dominik Csapak <d.csapak at proxmox.com>
> ---
> PVE/CLI/pve5to6.pm | 13 +++++++++++++
> 1 file changed, 13 insertions(+)
>
> diff --git a/PVE/CLI/pve5to6.pm b/PVE/CLI/pve5to6.pm
> index c167ebca..bb54c735 100644
> --- a/PVE/CLI/pve5to6.pm
> +++ b/PVE/CLI/pve5to6.pm
> @@ -421,6 +421,19 @@ sub check_ceph {
> }
> }
>
> + log_info("checking Ceph config..");
> + my $conf = PVE::Cluster::cfs_read_file('ceph.conf');
> + if (defined($conf)) {
> + my $global = $conf->{global};
> + if (!defined($global->{mon_host}) && !defined($global->{"mon host"})) {
applied, but followed up with a chek for "mon-host" variant, like
you mentioned off-list.
In a later follow up I also change the defined($conf) to %$conf,
as the parser itself can return {} if no config or empty config,
and the latter case can happen in this code path.
> + log_warn("No mon_host entry found in ceph config.\n It is recommended to add mon_host with all monitor addresses(without ports) to the global section.");
> + } else {
> + log_pass("Found mon_host entry.");
> + }
> + } else {
> + log_skip("no ceph config found");
> + }
> +
> my $local_ceph_ver = PVE::Ceph::Tools::get_local_version(1);
> if (defined($local_ceph_ver)) {
> if ($local_ceph_ver == 14) {
>
More information about the pve-devel
mailing list