# shutdown <node>
# restart-lrm <node>
# service <sid> <enabled|disabled>
+# service <sid> <migrate|relocate> <target>
sub sim_hardware_cmd {
my ($self, $cmdstr, $logid) = @_;
$self->set_service_state($sid, $action);
+ } elsif ($action eq 'migrate' || $action eq 'relocate') {
+
+ die "sim_hardware_cmd: missing target node for '$action' command"
+ if !$target;
+
+ $self->queue_crm_commands_nolock("$action $sid $target");
+
} else {
die "sim_hardware_cmd: unknown service action '$action' " .
"- not implemented\n"
--- /dev/null
+info 0 hardware: starting simulation
+info 20 cmdlist: execute power node1 on
+info 20 node1/crm: status change startup => wait_for_quorum
+info 20 node1/lrm: status change startup => wait_for_agent_lock
+info 20 cmdlist: execute power node2 on
+info 20 node2/crm: status change startup => wait_for_quorum
+info 20 node2/lrm: status change startup => wait_for_agent_lock
+info 20 cmdlist: execute power node3 on
+info 20 node3/crm: status change startup => wait_for_quorum
+info 20 node3/lrm: status change startup => wait_for_agent_lock
+info 20 node1/crm: got lock 'ha_manager_lock'
+info 20 node1/crm: status change wait_for_quorum => master
+info 20 node1/crm: node 'node1': state changed from 'unknown' => 'online'
+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 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 25 node3/lrm: status change wait_for_agent_lock => active
+info 25 node3/lrm: starting service vm:103
+info 25 node3/lrm: service status vm:103 started
+info 120 cmdlist: execute service vm:103 migrate node1
+info 120 node1/crm: got crm command: migrate vm:103 node1
+info 120 node1/crm: migrate service 'vm:103' to node 'node1' (running)
+info 120 node1/crm: service 'vm:103': state changed from 'started' to 'migrate' (node = node3, target = node1)
+info 125 node3/lrm: service vm:103 - start migrate to node 'node1'
+info 125 node3/lrm: service vm:103 - end migrate to node 'node1'
+info 140 node1/crm: service 'vm:103': state changed from 'migrate' to 'started' (node = node1)
+info 141 node1/lrm: got lock 'ha_agent_node1_lock'
+info 141 node1/lrm: status change wait_for_agent_lock => active
+info 141 node1/lrm: starting service vm:103
+info 141 node1/lrm: service status vm:103 started
+info 720 hardware: exit simulation - done