5
0
mirror of git://git.proxmox.com/git/pve-ha-manager.git synced 2025-01-19 14:03:53 +03:00

env: datacenter config: include crs (cluster-resource-scheduling) setting

Suggested-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
Signed-off-by: Fiona Ebner <f.ebner@proxmox.com>
This commit is contained in:
Fiona Ebner 2022-11-17 15:00:09 +01:00 committed by Thomas Lamprecht
parent 749d8161be
commit 7c142d6822
3 changed files with 11 additions and 8 deletions

View 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 {

View 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'");

View 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 {