]> git.proxmox.com Git - pve-ha-manager.git/commitdiff
tests: add shutdown policy scenario with multiple guests to spread out
authorThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Jul 2022 16:09:38 +0000 (18:09 +0200)
committerThomas Lamprecht <t.lamprecht@proxmox.com>
Thu, 21 Jul 2022 16:09:42 +0000 (18:09 +0200)
currently wrong as online_node_usage doesn't considers counting the
target node if the source node isn't considered online (=
operational) anymore

Signed-off-by: Thomas Lamprecht <t.lamprecht@proxmox.com>
src/test/test-shutdown-policy6/cmdlist [new file with mode: 0644]
src/test/test-shutdown-policy6/datacenter.cfg [new file with mode: 0644]
src/test/test-shutdown-policy6/hardware_status [new file with mode: 0644]
src/test/test-shutdown-policy6/log.expect [new file with mode: 0644]
src/test/test-shutdown-policy6/manager_status [new file with mode: 0644]
src/test/test-shutdown-policy6/service_config [new file with mode: 0644]

diff --git a/src/test/test-shutdown-policy6/cmdlist b/src/test/test-shutdown-policy6/cmdlist
new file mode 100644 (file)
index 0000000..a86b9e2
--- /dev/null
@@ -0,0 +1,4 @@
+[
+    [ "power node1 on", "power node2 on", "power node3 on"],
+    [ "shutdown node3" ]
+]
diff --git a/src/test/test-shutdown-policy6/datacenter.cfg b/src/test/test-shutdown-policy6/datacenter.cfg
new file mode 100644 (file)
index 0000000..de0bf81
--- /dev/null
@@ -0,0 +1,5 @@
+{
+    "ha": {
+        "shutdown_policy": "migrate"
+    }
+}
diff --git a/src/test/test-shutdown-policy6/hardware_status b/src/test/test-shutdown-policy6/hardware_status
new file mode 100644 (file)
index 0000000..451beb1
--- /dev/null
@@ -0,0 +1,5 @@
+{
+  "node1": { "power": "off", "network": "off" },
+  "node2": { "power": "off", "network": "off" },
+  "node3": { "power": "off", "network": "off" }
+}
diff --git a/src/test/test-shutdown-policy6/log.expect b/src/test/test-shutdown-policy6/log.expect
new file mode 100644 (file)
index 0000000..9d2d7da
--- /dev/null
@@ -0,0 +1,72 @@
+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     20    node1/crm: adding new service 'vm:104' on node 'node3'
+info     20    node1/crm: adding new service 'vm:105' on node 'node3'
+info     20    node1/crm: adding new service 'vm:106' 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     25    node3/lrm: starting service vm:104
+info     25    node3/lrm: service status vm:104 started
+info     25    node3/lrm: starting service vm:105
+info     25    node3/lrm: service status vm:105 started
+info     25    node3/lrm: starting service vm:106
+info     25    node3/lrm: service status vm:106 started
+info    120      cmdlist: execute shutdown node3
+info    120    node3/lrm: got shutdown request with shutdown policy 'migrate'
+info    120    node3/lrm: shutdown LRM, doing maintenance, removing this node from active list
+info    120    node1/crm: node 'node3': state changed from 'online' => 'maintenance'
+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    120    node1/crm: migrate service 'vm:104' to node 'node1' (running)
+info    120    node1/crm: service 'vm:104': state changed from 'started' to 'migrate'  (node = node3, target = node1)
+info    120    node1/crm: migrate service 'vm:105' to node 'node1' (running)
+info    120    node1/crm: service 'vm:105': state changed from 'started' to 'migrate'  (node = node3, target = node1)
+info    120    node1/crm: migrate service 'vm:106' to node 'node1' (running)
+info    120    node1/crm: service 'vm:106': state changed from 'started' to 'migrate'  (node = node3, target = node1)
+info    125    node3/lrm: status change active => maintenance
+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    125    node3/lrm: service vm:104 - start migrate to node 'node1'
+info    125    node3/lrm: service vm:104 - end migrate to node 'node1'
+info    125    node3/lrm: service vm:105 - start migrate to node 'node1'
+info    125    node3/lrm: service vm:105 - end migrate to node 'node1'
+info    125    node3/lrm: service vm:106 - start migrate to node 'node1'
+info    125    node3/lrm: service vm:106 - end migrate to node 'node1'
+info    140    node1/crm: service 'vm:103': state changed from 'migrate' to 'started'  (node = node1)
+info    140    node1/crm: service 'vm:104': state changed from 'migrate' to 'started'  (node = node1)
+info    140    node1/crm: service 'vm:105': state changed from 'migrate' to 'started'  (node = node1)
+info    140    node1/crm: service 'vm:106': 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    141    node1/lrm: starting service vm:104
+info    141    node1/lrm: service status vm:104 started
+info    141    node1/lrm: starting service vm:105
+info    141    node1/lrm: service status vm:105 started
+info    141    node1/lrm: starting service vm:106
+info    141    node1/lrm: service status vm:106 started
+info    146    node3/lrm: exit (loop end)
+info    146     shutdown: execute crm node3 stop
+info    145    node3/crm: server received shutdown request
+info    165    node3/crm: exit (loop end)
+info    165     shutdown: execute power node3 off
+info    720     hardware: exit simulation - done
diff --git a/src/test/test-shutdown-policy6/manager_status b/src/test/test-shutdown-policy6/manager_status
new file mode 100644 (file)
index 0000000..0967ef4
--- /dev/null
@@ -0,0 +1 @@
+{}
diff --git a/src/test/test-shutdown-policy6/service_config b/src/test/test-shutdown-policy6/service_config
new file mode 100644 (file)
index 0000000..d6f4fd9
--- /dev/null
@@ -0,0 +1,6 @@
+{
+    "vm:103": { "node": "node3", "state": "enabled" },
+    "vm:104": { "node": "node3", "state": "enabled" },
+    "vm:105": { "node": "node3", "state": "enabled" },
+    "vm:106": { "node": "node3", "state": "enabled" }
+}