[pve-devel] [RFC ha-manager v2 2/7] Env: add 'read_fence_config' and 'fencing_mode'

Dietmar Maurer dietmar at proxmox.com
Sat Mar 12 13:29:34 CET 2016


> diff --git a/src/PVE/HA/Env/PVE2.pm b/src/PVE/HA/Env/PVE2.pm
> index 8638786..220f77c 100644
> --- a/src/PVE/HA/Env/PVE2.pm
> +++ b/src/PVE/HA/Env/PVE2.pm
> @@ -144,6 +144,30 @@ sub read_service_config {
>      return $conf;
>  }
>  
> +sub read_fence_config {
> +    my ($self) = @_;
> +
> +    return PVE::HA::Config::read_fence_config();
> +}
> +
> +sub fencing_mode {
> +    my ($self) = @_;
> +
> +    my $datacenterconfig = cfs_read_file('datacenter.cfg');
> +    return 'watchdog' if !$datacenterconfig->{fencing} ||
> +	$datacenterconfig->{fencing} eq 'watchdog';
> +
> +    my $cfg = $self->read_fence_config();
> +
> +    if (!%$cfg) {
> +	$self->log('warn', "HW fencing enabled but no device configured!");

I would not catch that at all. Fencing simply does not work in this case.




More information about the pve-devel mailing list