# add new service
foreach my $sid (sort keys %$sc) {
next if $ss->{$sid}; # already there
- $haenv->log('info', "adding new service '$sid' on node '$sc->{$sid}->{node}'");
+ my $cd = $sc->{$sid};
+ $haenv->log('info', "adding new service '$sid' on node '$cd->{node}'");
# assume we are running to avoid relocate running service at add
- $ss->{$sid} = { state => 'started', node => $sc->{$sid}->{node},
+ my $state = ($cd->{state} eq 'enabled') ? 'started' : 'request_stop';
+ $ss->{$sid} = { state => $state, node => $cd->{node},
uid => compute_new_uuid('started') };
}
info 20 node1/crm: adding new service 'vm:101' on node 'node1'
info 20 node1/crm: adding new service 'vm:102' on node 'node2'
info 20 node1/crm: adding new service 'vm:103' on node 'node3'
-info 20 node1/crm: service 'vm:102': state changed from 'started' to 'request_stop'
info 21 node1/lrm: got lock 'ha_agent_node1_lock'
info 21 node1/lrm: status change wait_for_agent_lock => active
info 21 node1/lrm: starting service vm:101
info 20 node1/crm: node 'node2': state changed from 'unknown' => 'online'
info 20 node1/crm: node 'node3': state changed from 'unknown' => 'online'
info 20 node1/crm: adding new service 'fa:130' on node 'node2'
-info 20 node1/crm: service 'fa:130': state changed from 'started' to 'request_stop'
info 22 node2/crm: status change wait_for_quorum => slave
info 23 node2/lrm: got lock 'ha_agent_node2_lock'
info 23 node2/lrm: status change wait_for_agent_lock => active
info 20 node1/crm: got lock 'ha_manager_lock'
info 20 node1/crm: status change wait_for_quorum => master
info 20 node1/crm: adding new service 'fa:130' on node 'node3'
-info 20 node1/crm: service 'fa:130': state changed from 'started' to 'request_stop'
info 21 node1/lrm: got lock 'ha_agent_node1_lock'
info 21 node1/lrm: status change wait_for_agent_lock => active
info 21 node1/lrm: starting service vm:100
info 20 node1/crm: node 'node2': state changed from 'unknown' => 'online'
info 20 node1/crm: node 'node3': state changed from 'unknown' => 'online'
info 20 node1/crm: adding new service 'vm:103' on node 'node3'
-info 20 node1/crm: service 'vm:103': state changed from 'started' to 'request_stop'
info 22 node2/crm: status change wait_for_quorum => slave
info 24 node3/crm: status change wait_for_quorum => slave
info 25 node3/lrm: got lock 'ha_agent_node3_lock'
info 20 node1/crm: node 'node2': state changed from 'unknown' => 'online'
info 20 node1/crm: node 'node3': state changed from 'unknown' => 'online'
info 20 node1/crm: adding new service 'fa:110' on node 'node2'
-info 20 node1/crm: service 'fa:110': state changed from 'started' to 'request_stop'
info 22 node2/crm: status change wait_for_quorum => slave
info 23 node2/lrm: got lock 'ha_agent_node2_lock'
info 23 node2/lrm: status change wait_for_agent_lock => active
info 20 node1/crm: node 'node2': state changed from 'unknown' => 'online'
info 20 node1/crm: node 'node3': state changed from 'unknown' => 'online'
info 20 node1/crm: adding new service 'fa:130' on node 'node2'
-info 20 node1/crm: service 'fa:130': state changed from 'started' to 'request_stop'
info 22 node2/crm: status change wait_for_quorum => slave
info 23 node2/lrm: got lock 'ha_agent_node2_lock'
info 23 node2/lrm: status change wait_for_agent_lock => active
info 20 node1/crm: node 'node2': state changed from 'unknown' => 'online'
info 20 node1/crm: node 'node3': state changed from 'unknown' => 'online'
info 20 node1/crm: adding new service 'fa:130' on node 'node2'
-info 20 node1/crm: service 'fa:130': state changed from 'started' to 'request_stop'
info 22 node2/crm: status change wait_for_quorum => slave
info 23 node2/lrm: got lock 'ha_agent_node2_lock'
info 23 node2/lrm: status change wait_for_agent_lock => active
info 20 node1/crm: node 'node2': state changed from 'unknown' => 'online'
info 20 node1/crm: node 'node3': state changed from 'unknown' => 'online'
info 20 node1/crm: adding new service 'fa:130' on node 'node2'
-info 20 node1/crm: service 'fa:130': state changed from 'started' to 'request_stop'
info 22 node2/crm: status change wait_for_quorum => slave
info 23 node2/lrm: got lock 'ha_agent_node2_lock'
info 23 node2/lrm: status change wait_for_agent_lock => active