[pve-devel] [RFC ha-manager v2 2/7] Env: add 'read_fence_config' and 'fencing_mode'
Thomas Lamprecht
t.lamprecht at proxmox.com
Sat Mar 12 21:36:21 CET 2016
On 03/12/2016 01:29 PM, Dietmar Maurer wrote:
>> 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.
But I would warn if fence mode is set to only HW fencing but no device
is configured, just failing silently here seems a bit odd and not really
transparent to the user, but you're right, here its maybe not the best
place.
More information about the pve-devel
mailing list