[pve-devel] [PATCH ha-manager v2 1/2] add possibility to simulate locks from services
Thomas Lamprecht
t.lamprecht at proxmox.com
Tue Sep 13 09:10:05 CEST 2016
On 09/13/2016 07:39 AM, Dietmar Maurer wrote:
>> diff --git a/src/PVE/HA/Sim/Resources.pm b/src/PVE/HA/Sim/Resources.pm
>> index 25b034e..ec3d775 100644
>> --- a/src/PVE/HA/Sim/Resources.pm
>> +++ b/src/PVE/HA/Sim/Resources.pm
>> @@ -42,6 +42,11 @@ sub start {
>> my $hardware = $haenv->hardware();
>> my $ss = $hardware->read_service_status($nodename);
>>
>> + if ($hardware->service_has_lock("$service_type:$id")) {
>> + $haenv->log('err', "service '$service_type:$id' locked, unable to start!");
> First, I would at least log the lock type.
Ok, just FYI, It get logged on removal, this is just for the simulated
hardware, but make sense here also.
Did not thought about this as previously I had only a hardcoded lock for
the test hardware, will change.
>
> Second, maybe we can make this more generic:
>
> $resource_plugin->check_service_is_relocatable($haenv, $id)
hmm, but this adds more complexity to the HA, and checking if a service
may not work on
more nodes is not trivial and may have some special cases.
It has a lot of things to consider (and if we do this I would add the
checks in the VM/CT code).
The user should know that HA may only work if his VM is not local bound
to devices/storages/...
Ensuring to catch all modifications which could bind a service to its
node could be done via a check
in the config modify method(s) which check if its HA managed and if the
changes introduce possible local bindings.
I'll think about this.
More information about the pve-devel
mailing list