[Unit]
Description=PVE Cluster Ressource Manager Daemon
ConditionPathExists=/usr/sbin/pve-ha-crm
+ConditionPathExists=/etc/pve/ha/resources.cfg
Requires=pve-cluster.service
Wants=pvedaemon.service
After=pve-cluster.service
[Unit]
Description=PVE Local HA Ressource Manager Daemon
ConditionPathExists=/usr/sbin/pve-ha-lrm
+ConditionPathExists=/etc/pve/ha/resources.cfg
Requires=pve-cluster.service
Wants=pvedaemon.service
After=pve-cluster.service
# Server can have several states:
my $valid_states = {
- disabled => "HA is disabled (no resource configuration)",
wait_for_agent_lock => "waiting for agent lock",
active => "got agent_lock",
lost_agent_lock => "lost agent_lock",
results => {},
}, $class;
- my $next_state = $haenv->service_config_exists() ?
- 'wait_for_agent_lock' : 'disabled';
-
- $self->set_local_status({ state => $next_state });
+ $self->set_local_status({ state => 'wait_for_agent_lock' });
return $self;
}
my $ctime = $haenv->get_time();
- if ($state eq 'disabled') {
-
- if ($haenv->service_config_exists()) {
- $self->set_local_status({ state => 'wait_for_agent_lock' });
- }
-
- } if ($state eq 'wait_for_agent_lock') {
+ if ($state eq 'wait_for_agent_lock') {
my $service_count = 1; # todo: correctly compute
return 0;
}
- } elsif ($state eq 'disabled') {
- # do nothing
-
+ $haenv->sleep(5);
+
} else {
die "got unexpected status '$state'\n";