Features/PostcopyRecovery: Difference between revisions

From QEMU
No edit summary
(Postcopy Recovery Procedures)
Line 1: Line 1:
<nowiki>
=== QMP handshake ===
{"execute": "qmp_capabilities"}<br>
{"return": {}}<br>


# QMP handshake
=== Enable postcopy ===
{"execute": "qmp_capabilities"}
{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [{"state": true, "capability": "postcopy-ram"}]}}<br>
{"return": {}}
{"return": {}}<br>


# Enable postcopy
=== Start precopy migration ===
{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [{"state": true, "capability": "postcopy-ram"}]}}
{"execute": "migrate", "arguments": {"uri": "unix:/tmp/migration-test-12K6jV/migsocket"}}<br>
{"return": {}}
{"return": {}}<br>


# Start precopy migration
=== Start postcopy migration ===
{"execute": "migrate", "arguments": {"uri": "unix:/tmp/migration-test-12K6jV/migsocket"}}
{"execute": "migrate-start-postcopy"}<br>
{"return": {}}
{"return": {}}<br>
{"timestamp": {"seconds": 1559730429, "microseconds": 585575}, "event": "STOP"}<br>
{"timestamp": {"seconds": 1559730429, "microseconds": 613592}, "event": "RESUME"}<br>


# Start postcopy migration
=== Manually pause the postcopy migration before it completes.  This emulates a network failure. ===
{"execute": "migrate-start-postcopy"}
{"execute": "migrate-pause"}<br>
{"return": {}}
{"return": {}}<br>
{"timestamp": {"seconds": 1559730429, "microseconds": 585575}, "event": "STOP"}
{"timestamp": {"seconds": 1559730429, "microseconds": 613592}, "event": "RESUME"}


# Manually pause the postcopy migration before it completes.  This emulates a network failure.
=== Check the status of migration, should be "postcopy-paused" ===
{"execute": "migrate-pause"}
{"execute": "query-migrate"}<br>
{"return": {}}
{"return": {"status": "postcopy-paused", "socket-address": [{"path": "/tmp/migration-test-12K6jV/migsocket", "type": "unix"}]}}<br>


# Check the status of migration, should be "postcopy-paused"
=== Try to continue the previous postcopy migration, until it finishes ===
{"execute": "query-migrate"}
{"execute": "migrate-recover", "arguments": {"uri": "unix:/tmp/migration-test-12K6jV/migsocket-recover"}, "id": "recover-cmd"}<br>
{"return": {"status": "postcopy-paused", "socket-address": [{"path": "/tmp/migration-test-12K6jV/migsocket", "type": "unix"}]}}
{"timestamp": {"seconds": 1559730429, "microseconds": 620072}, "event": "MIGRATION", "data": {"status": "setup"}}<br>
{"return": {}, "id": "recover-cmd"}<br>


# Try to continue the previous postcopy migration, until it finishes
=== Wait until migration completes (status becomes "completed") ===
{"execute": "migrate-recover", "arguments": {"uri": "unix:/tmp/migration-test-12K6jV/migsocket-recover"}, "id": "recover-cmd"}
{"execute": "query-migrate"}<br>
{"timestamp": {"seconds": 1559730429, "microseconds": 620072}, "event": "MIGRATION", "data": {"status": "setup"}}
{"return": {"postcopy-blocktime": 89, "status": "completed", "postcopy-vcpu-blocktime": [90]}}<br>
{"return": {}, "id": "recover-cmd"}
 
# Wait until migration completes (status becomes "completed")
{"execute": "query-migrate"}
{"return": {"postcopy-blocktime": 89, "status": "completed", "postcopy-vcpu-blocktime": [90]}}
 
</nowiki>

Revision as of 10:42, 5 June 2019

QMP handshake

{"execute": "qmp_capabilities"}
{"return": {}}

Enable postcopy

{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [{"state": true, "capability": "postcopy-ram"}]}}
{"return": {}}

Start precopy migration

{"execute": "migrate", "arguments": {"uri": "unix:/tmp/migration-test-12K6jV/migsocket"}}
{"return": {}}

Start postcopy migration

{"execute": "migrate-start-postcopy"}
{"return": {}}
{"timestamp": {"seconds": 1559730429, "microseconds": 585575}, "event": "STOP"}
{"timestamp": {"seconds": 1559730429, "microseconds": 613592}, "event": "RESUME"}

Manually pause the postcopy migration before it completes. This emulates a network failure.

{"execute": "migrate-pause"}
{"return": {}}

Check the status of migration, should be "postcopy-paused"

{"execute": "query-migrate"}
{"return": {"status": "postcopy-paused", "socket-address": [{"path": "/tmp/migration-test-12K6jV/migsocket", "type": "unix"}]}}

Try to continue the previous postcopy migration, until it finishes

{"execute": "migrate-recover", "arguments": {"uri": "unix:/tmp/migration-test-12K6jV/migsocket-recover"}, "id": "recover-cmd"}
{"timestamp": {"seconds": 1559730429, "microseconds": 620072}, "event": "MIGRATION", "data": {"status": "setup"}}
{"return": {}, "id": "recover-cmd"}

Wait until migration completes (status becomes "completed")

{"execute": "query-migrate"}
{"return": {"postcopy-blocktime": 89, "status": "completed", "postcopy-vcpu-blocktime": [90]}}