]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
env: datacenter config: include crs (cluster-resource-scheduling) setting
authorFiona Ebner <f.ebner@proxmox.com>
Thu, 17 Nov 2022 14:00:09 +0000 (15:00 +0100)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Fri, 18 Nov 2022 12:25:21 +0000 (13:25 +0100)
Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
src/PVE/HA/Env/PVE2.pm
src/PVE/HA/LRM.pm
src/PVE/HA/Sim/Env.pm

index d2c46e8c861b50dee87c6497e484af423f4dd1c7..f6ebfebc208bafbf5cd99d06d09948afb33ae497 100644 (file)
@@ -456,12 +456,12 @@ sub get_datacenter_settings {
     my ($self) = @_;
 
     my $datacenterconfig = eval { cfs_read_file('datacenter.cfg') };
-    if (my $err = $@) {
-       $self->log('err', "unable to get HA settings from datacenter.cfg - $err");
-       return {};
-    }
+    $self->log('err', "unable to get HA settings from datacenter.cfg - $@") if $@;
 
-    return $datacenterconfig->{ha};
+    return {
+       ha => $datacenterconfig->{ha} // {},
+       crs => $datacenterconfig->{crs} // {},
+    };
 }
 
 sub get_static_node_stats {
index 7750f4d45cff5cb90827d9e6335ff19f8aa37263..5d2fa2c21656e787275e5d780e1e1047ada9ec76 100644 (file)
@@ -59,8 +59,8 @@ sub shutdown_request {
 
     my ($shutdown, $reboot) = $haenv->is_node_shutdown();
 
-    my $dc_ha_cfg = $haenv->get_datacenter_settings();
-    my $shutdown_policy = $dc_ha_cfg->{shutdown_policy} // 'conditional';
+    my $dc_cfg = $haenv->get_datacenter_settings();
+    my $shutdown_policy = $dc_cfg->{ha}->{shutdown_policy} // 'conditional';
 
     if ($shutdown) { # don't log this on service restart, only on node shutdown
        $haenv->log('info', "got shutdown request with shutdown policy '$shutdown_policy'");
index 6c4703079a7ab4ecc9e1511c8310110d4951e3bf..c6ea73c141258e74c1233148c2a80bc8561eaf6f 100644 (file)
@@ -430,7 +430,10 @@ sub get_datacenter_settings {
 
     my $datacenterconfig = $self->{hardware}->read_datacenter_conf();
 
-    return $datacenterconfig->{ha};
+    return {
+       ha => $datacenterconfig->{ha} // {},
+       crs => $datacenterconfig->{crs} // {},
+    };
 }
 
 sub get_static_node_stats {