aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/tools
diff options
context:
space:
mode:
authorJohannes Stoelp <johannes.stoelp@gmail.com>2021-11-24 22:31:13 +0100
committerJohannes Stoelp <johannes.stoelp@gmail.com>2021-11-24 22:31:13 +0100
commite9a30288fde1f46422f41a9fc5c84564df007c4c (patch)
treea0e9c880bf2e24af8e2fded491b28f91e287bea1 /src/tools
parent44051c458ce659d3601f1f71a7bac66f0728de9e (diff)
downloadnotes-e9a30288fde1f46422f41a9fc5c84564df007c4c.tar.gz
notes-e9a30288fde1f46422f41a9fc5c84564df007c4c.zip
qemu: add migration notes
Diffstat (limited to 'src/tools')
-rw-r--r--src/tools/qemu.md33
1 files changed, 32 insertions, 1 deletions
diff --git a/src/tools/qemu.md b/src/tools/qemu.md
index c34c533..93a724f 100644
--- a/src/tools/qemu.md
+++ b/src/tools/qemu.md
@@ -198,7 +198,7 @@ Commands for qemu [Monitor][doc-qemu-monitor] or [QMP][doc-qemu-qmp]:
# List available snapshots.
info snapshots
-# Create/Load/Delete snapshot with name <tag>
+# Create/Load/Delete snapshot with name <tag>.
savevm <tag>
loadvm <tag>
delvm <tag>
@@ -211,6 +211,37 @@ qemu-system-x86_64 \
...
```
+## VM Migration
+
+`Online` migration example:
+```bash
+# Start machine 1 on host ABC.
+qemu-system-x86_64 -monitor stdio -cdrom <iso>
+
+# Prepare machine 2 on host DEF as migration target.
+# Listen for any connection on port 12345.
+qemu-system-x86_64 -monitor stdio -incoming tcp:0.0.0.0:12345
+
+# Start migration from the machine 1 monitor console.
+(qemu) migrate tcp:DEF:12345
+```
+
+Save to external file example:
+```bash
+```bash
+# Start machine 1.
+qemu-system-x86_64 -monitor stdio -cdrom <iso>
+
+# Save VM state to file.
+(qemu) migrate "exec:gzip -c > vm.gz"
+
+# Load VM from file.
+qemu-system-x86_64 -monitor stdio -incoming "exec: gzip -d -c vm.gz"
+```
+
+> The migration source machine and the migration target machine should be
+> launched with the **same** parameters.
+
## Appendix: Direct `Kernel` boot
Example command line to directly boot a `Kernel` with an `initrd` ramdisk.