]> git.proxmox.com Git - mirror_qemu.git/blobdiff - docs/COLO-FT.txt
Merge remote-tracking branch 'remotes/kraxel/tags/vga-20190705-pull-request' into...
[mirror_qemu.git] / docs / COLO-FT.txt
index 628293824c14fd046de8964f329c7166843ae680..ad24680d130e86734d962c6a2701392862d88ba7 100644 (file)
@@ -41,41 +41,43 @@ identical responses to all client requests. Once the differences in the outputs
 are detected between the PVM and SVM, COLO withholds transmission of the
 outbound packets until it has successfully synchronized the PVM state to the SVM.
 
-   Primary Node                                                            Secondary Node
- +------------+  +-----------------------+       +------------------------+  +------------+
- |            |  |       HeartBeat       |<----->|       HeartBeat        |  |            |
- | Primary VM |  +-----------|-----------+       +-----------|------------+  |Secondary VM|
- |            |              |                               |               |            |
- |            |  +-----------|-----------+       +-----------|------------+  |            |
- |            |  |QEMU   +---v----+      |       |QEMU  +----v---+        |  |            |
- |            |  |       |Failover|      |       |      |Failover|        |  |            |
- |            |  |       +--------+      |       |      +--------+        |  |            |
- |            |  |   +---------------+   |       |   +---------------+    |  |            |
- |            |  |   | VM Checkpoint |-------------->| VM Checkpoint |    |  |            |
- |            |  |   +---------------+   |       |   +---------------+    |  |            |
- |            |  |                       |       |                        |  |            |
- |Requests<---------------------------^------------------------------------------>Requests|
- |Responses----------------------\ /--|--------------\  /------------------------Responses|
- |            |  |               | |  |  |       |   |  |                 |  |            |
- |            |  | +-----------+ | |  |  |       |   |  |  +------------+ |  |            |
- |            |  | | COLO disk | | |  |  |       |   |  |  | COLO disk  | |  |            |
- |            |  | |   Manager |-|-|--|--------------|--|->| Manager    | |  |            |
- |            |  | +|----------+ | |  |  |       |   |  |  +-----------|+ |  |            |
- |            |  |  |            | |  |  |       |   |  |              |  |  |            |
- +------------+  +--|------------|-|--|--+       +---|--|--------------|--+  +------------+
-                    |            | |  |              |  |              |
- +-------------+    | +----------v-v--|--+       +---|--v-----------+  |    +-------------+
- |  VM Monitor |    | |  COLO Proxy      |       |    COLO Proxy    |  |    | VM Monitor  |
- |             |    | |(compare packet)  |       | (adjust sequence)|  |    |             |
- +-------------+    | +----------|----^--+       +------------------+  |    +-------------+
-                    |            |    |                                |
- +------------------|------------|----|--+       +---------------------|------------------+
- |   Kernel         |            |    |  |       |   Kernel            |                  |
- +------------------|------------|----|--+       +---------------------|------------------+
-                    |            |    |                                |
-     +--------------v+  +--------v----|--+       +------------------+ +v-------------+
-     |   Storage     |  |External Network|       | External Network | |   Storage    |
-     +---------------+  +----------------+       +------------------+ +--------------+
+  Primary Node                                                            Secondary Node
++------------+  +-----------------------+       +------------------------+  +------------+
+|            |  |       HeartBeat       +<----->+       HeartBeat        |  |            |
+| Primary VM |  +-----------+-----------+       +-----------+------------+  |Secondary VM|
+|            |              |                               |               |            |
+|            |  +-----------|-----------+       +-----------|------------+  |            |
+|            |  |QEMU   +---v----+      |       |QEMU  +----v---+        |  |            |
+|            |  |       |Failover|      |       |      |Failover|        |  |            |
+|            |  |       +--------+      |       |      +--------+        |  |            |
+|            |  |   +---------------+   |       |   +---------------+    |  |            |
+|            |  |   | VM Checkpoint +-------------->+ VM Checkpoint |    |  |            |
+|            |  |   +---------------+   |       |   +---------------+    |  |            |
+|Requests<--------------------------\ /-----------------\ /--------------------->Requests|
+|            |  |                   ^ ^ |       |       | |              |  |            |
+|Responses+---------------------\ /-|-|------------\ /-------------------------+Responses|
+|            |  |               | | | | |       |  | |  | |              |  |            |
+|            |  | +-----------+ | | | | |       |  | |  | | +----------+ |  |            |
+|            |  | | COLO disk | | | | | |       |  | |  | | | COLO disk| |  |            |
+|            |  | |   Manager +---------------------------->| Manager  | |  |            |
+|            |  | ++----------+ v v | | |       |  | v  v | +---------++ |  |            |
+|            |  |  |+-----------+-+-+-++|       | ++-+--+-+---------+ |  |  |            |
+|            |  |  ||   COLO Proxy     ||       | |   COLO Proxy    | |  |  |            |
+|            |  |  || (compare packet  ||       | |(adjust sequence | |  |  |            |
+|            |  |  ||and mirror packet)||       | |    and ACK)     | |  |  |            |
+|            |  |  |+------------+---+-+|       | +-----------------+ |  |  |            |
++------------+  +-----------------------+       +------------------------+  +------------+
++------------+     |             |   |                                |     +------------+
+| VM Monitor |     |             |   |                                |     | VM Monitor |
++------------+     |             |   |                                |     +------------+
++---------------------------------------+       +----------------------------------------+
+|   Kernel         |             |   |  |       |   Kernel            |                  |
++---------------------------------------+       +----------------------------------------+
+                   |             |   |                                |
+    +--------------v+  +---------v---+--+       +------------------+ +v-------------+
+    |   Storage     |  |External Network|       | External Network | |   Storage    |
+    +---------------+  +----------------+       +------------------+ +--------------+
+
 
 == Components introduction ==
 
@@ -100,27 +102,61 @@ to make sure the state of VM in Secondary side is always consistent with VM in
 Primary side.
 
 COLO Proxy:
-Delivers packets to Primary and Seconday, and then compare the responses from
+Delivers packets to Primary and Secondary, and then compare the responses from
 both side. Then decide whether to start a checkpoint according to some rules.
-Please refer to docs/colo-proxy.txt for more informations.
+Please refer to docs/colo-proxy.txt for more information.
 
 Note:
 HeartBeat has not been implemented yet, so you need to trigger failover process
 by using 'x-colo-lost-heartbeat' command.
 
+== COLO operation status ==
+
++-----------------+
+|                 |
+|    Start COLO   |
+|                 |
++--------+--------+
+         |
+         |  Main qmp command:
+         |  migrate-set-capabilities with x-colo
+         |  migrate
+         |
+         v
++--------+--------+
+|                 |
+|  COLO running   |
+|                 |
++--------+--------+
+         |
+         |  Main qmp command:
+         |  x-colo-lost-heartbeat
+         |  or
+         |  some error happened
+         v
++--------+--------+
+|                 |  send qmp event:
+|  COLO failover  |  COLO_EXIT
+|                 |
++-----------------+
+
+COLO use the qmp command to switch and report operation status.
+The diagram just shows the main qmp command, you can get the detail
+in test procedure.
+
 == Test procedure ==
 1. Startup qemu
 Primary:
-# qemu-kvm -enable-kvm -m 2048 -smp 2 -qmp stdio -vnc :7 -name primary \
-  -device piix3-usb-uhci \
+# qemu-system-x86_64 -accel kvm -m 2048 -smp 2 -qmp stdio -name primary \
+  -device piix3-usb-uhci -vnc :7 \
   -device usb-tablet -netdev tap,id=hn0,vhost=off \
   -device virtio-net-pci,id=net-pci0,netdev=hn0 \
   -drive if=virtio,id=primary-disk0,driver=quorum,read-pattern=fifo,vote-threshold=1,\
          children.0.file.filename=1.raw,\
          children.0.driver=raw -S
 Secondary:
-# qemu-kvm -enable-kvm -m 2048 -smp 2 -qmp stdio -vnc :7 -name secondary \
-  -device piix3-usb-uhci \
+# qemu-system-x86_64 -accel kvm -m 2048 -smp 2 -qmp stdio -name secondary \
+  -device piix3-usb-uhci -vnc :7 \
   -device usb-tablet -netdev tap,id=hn0,vhost=off \
   -device virtio-net-pci,id=net-pci0,netdev=hn0 \
   -drive if=none,id=secondary-disk0,file.filename=1.raw,driver=raw,node-name=node0 \
@@ -137,7 +173,7 @@ Secondary:
 { 'execute': 'nbd-server-start',
   'arguments': {'addr': {'type': 'inet', 'data': {'host': 'xx.xx.xx.xx', 'port': '8889'} } }
 }
-{'execute': 'nbd-server-add', 'arguments': {'device': 'secondeary-disk0', 'writable': true } }
+{'execute': 'nbd-server-add', 'arguments': {'device': 'secondary-disk0', 'writable': true } }
 
 Note:
   a. The qmp command nbd-server-start and nbd-server-add must be run