From nobody Tue Feb 10 01:33:07 2026 Delivered-To: importer@patchew.org Authentication-Results: mx.zohomail.com; dkim=pass header.i=lukasstraub2@web.de; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass(p=quarantine dis=none) header.from=web.de ARC-Seal: i=1; a=rsa-sha256; t=1769373684; cv=none; d=zohomail.com; s=zohoarc; b=Swih6laPAAK/bc2orxDQbAPUXF/ykcoUwDCjg7LuPn7pFosLVUpCVBM57CsOlZrR4Q6U5ASKn1snHdQBrx1ofyvSC/o+rMD2rg/QaPVd9HH1oDWfrFIv+zrdvSCoLMgpbOFAMkSfD//+FbClyX0UwDAjAVZZSa3qPozOZwW8q+U= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1769373684; h=Content-Type:Content-Transfer-Encoding:Cc:Cc:Date:Date:From:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:Subject:To:To:Message-Id:Reply-To; bh=AWJLb1DGgkSXoEIH7BTnjP7hX7IzYbbOJ6yS6ExWv5s=; b=R9dO5ZBsFQ+IjPYCgvxnG3gEGWSFHoNEEK/IUUF1UB6i4xY2rdMWdItYh0unv7pTkL3VErSiZblucrkdBvDO1vNg0x6yCNAmJgFmuntXB71BlcIWjQ4MI8NUtoIRGXXcX7gAdZ8avtNM1dO/CKaoxCH+62kw0AEhR0MyQhaAsec= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass header.i=lukasstraub2@web.de; spf=pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) smtp.mailfrom=qemu-devel-bounces+importer=patchew.org@nongnu.org; dmarc=pass header.from= (p=quarantine dis=none) Return-Path: Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) by mx.zohomail.com with SMTPS id 1769373684320120.39726397681409; Sun, 25 Jan 2026 12:41:24 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vk6up-0007AL-NZ; Sun, 25 Jan 2026 15:40:59 -0500 Received: from eggs.gnu.org ([2001:470:142:3::10]) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vk6un-00079Q-Tb for qemu-devel@nongnu.org; Sun, 25 Jan 2026 15:40:57 -0500 Received: from mout.web.de ([212.227.17.11]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vk6uk-0006E1-3v for qemu-devel@nongnu.org; Sun, 25 Jan 2026 15:40:57 -0500 Received: from [127.0.1.1] ([217.247.97.172]) by smtp.web.de (mrweb106 [213.165.67.124]) with ESMTPSA (Nemesis) id 1Melax-1wIcBS3x2r-00jFZ7; Sun, 25 Jan 2026 21:40:44 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1769373644; x=1769978444; i=lukasstraub2@web.de; bh=AWJLb1DGgkSXoEIH7BTnjP7hX7IzYbbOJ6yS6ExWv5s=; h=X-UI-Sender-Class:From:Date:Subject:MIME-Version:Content-Type: Content-Transfer-Encoding:Message-Id:References:In-Reply-To:To:Cc: cc:content-transfer-encoding:content-type:date:from:message-id: mime-version:reply-to:subject:to; b=SwO2QnTrEcIdzzXOh9hhyprJ7Rxh4XC+fR3eHxrSqWWC/eZmgM9WJnmVVNivbpKP fzq7iCsRcqTIM/zwz6EOKOUYCdf/YpHdjyXHpLWnp/ukfpf2HRDOWVxAsLBElD8Tm VcdoEfwBrL9Nj3Cq4Fp7t7fwmev6J5wAfVYhFr6duuCHKpv6C9ERFyQIJ/8ZFktfS GPUiGZR7Lu5oRjiILJN5QrI1rzWIIhb1+fYqLNdxhMCUxFwSUboL265mEajHhDCJI HOx1luuXX8wVuBLC+UQ7QYRenwCIoZnLWvjZzlPo4gW6PVxr32eIYFxlh0OCZFnJl tJQ9yUQTmRu3LdXhRA== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 From: Lukas Straub Date: Sun, 25 Jan 2026 21:40:12 +0100 Subject: [PATCH v3 07/10] Convert colo main documentation to restructuredText MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260125-colo_unit_test_multifd-v3-7-ae926ccd8eae@web.de> References: <20260125-colo_unit_test_multifd-v3-0-ae926ccd8eae@web.de> In-Reply-To: <20260125-colo_unit_test_multifd-v3-0-ae926ccd8eae@web.de> To: qemu-devel@nongnu.org Cc: Peter Xu , Fabiano Rosas , Laurent Vivier , Paolo Bonzini , Zhang Chen , Hailiang Zhang , Markus Armbruster , Li Zhijian , "Dr. David Alan Gilbert" , Lukas Straub X-Mailer: b4 0.14.2 X-Developer-Signature: v=1; a=openpgp-sha256; l=41438; i=lukasstraub2@web.de; h=from:subject:message-id; bh=kIoJCZebt9A7/7l/DChCaD5V1JhR6NIl2ZdhG7SPOHA=; b=owEBbQKS/ZANAwAKATWrCyicXbJYAcsmYgBpdn/F6D7tx2XeYYU54b04nby6BUqJe/XJp5Fsg 6Eabo+6fOuJAjMEAAEKAB0WIQSD+rFYoNm4+3Jij6Q1qwsonF2yWAUCaXZ/xQAKCRA1qwsonF2y WIlID/90pzfb3dob92ahekjVy4znkRywiKiBpKuhthkF77SMKTQzaGkJ5eGa2oDz3sW+MTWoxqX kT/6uPXvizy6VbPutJDiokxWQichr8Ty4MfAUFsCxrGM46c9oS4uTj92TiEyPySUU8H0l+FriW4 ghwE2jxqeXBDmrSVqGo4ZoDd+GgsMBFa99bwHaAF4WDqakkARyK2KOmJoWBNsGd0EOf//xwiabA 1uh/V52nWOGOsWXhrsJhjq/mbM1bSeGi+7I2btVaNW5XXsW99NyT16Qrjfc2TYxALJTDQOQPFXj u/15PfYZImhIY5hgh/C7b8zkxyOynZLo/bAYS/37yknqJA2TS5ZUgoFG7rA+lnN3xsQWNYr1t+2 IRKOA1B9QF6i4PLZMyGZ3rWU6pnv6UAXpLEW0/L6zElkvh7uhNYVgj1O4ODRAqs3jtY+ZrIDm0g Vqq3yrjz2C231vzLgV30xGRbbWTIaeUqjm6JJfr6r7Bvv84pIkSp6GS1rqJDwe/xLnn1XjcWAG4 75aX2UjDovBQKBRnTnjGI76FXeEodN6uEMoPCvSQuHOHcmhcYw/MkNtGnxamlCS2GdpFvXQwaGj lXzYb1S3oSB99W4BLLdxpx6CEhw8MhiIg1yPJPcob+xeSbrmWLMmNE7uqNfX+d6+h+/n6KE/IVt 0excQlfMuiC/Gdg== X-Developer-Key: i=lukasstraub2@web.de; a=openpgp; fpr=83FAB158A0D9B8FB72628FA435AB0B289C5DB258 X-Provags-ID: V03:K1:ErnP5wCQ5Gs0jFrG+kqGICldmZd+2rvewYsnKNPuA8KuRHQKJZP tZaj2wKv7g42S0uraGJA5t+r4Wcjv0UjYRMbsRjv5tPy0lwojcMjzRxyeqKLV0poh6OzYy2 ad7I1EKIhaA2ZyzyWanCPl5Vw19yaBXnblPR/wWz8Oq0ixb5Ys6+LuFLki/gITRy2zink/A Fqu5iwbviAs0uN1q5y65Q== UI-OutboundReport: notjunk:1;M01:P0:IK+DQ7vxbYc=;Yov3iaSH067lc4eHkxKX8TYFmao 3piSZslOjQkZqwL2H+oscF3rfDp7oModEhHAbO/ulTho/qaTY7udXPCRZdBQ2O+zL0xtExqLA bU981GpFDR0l21trXwRhLIMQMyAyzjNkz9aTtI4VD0kH4CS9GsHrozR17RvguP0vxcMUzD+oX LeziG9HsvrVfxM6H0hIDN7GgYju276m5CHrcfxPho7H6kDBXkHPTFWP9MPDY29P4GxoP/jLbQ hZVXGo3gLWa0aMgtw+k7bHFaveudcSO5ShsmiyyrYp0yyTXI/D6J9qEgJ+ZpnWeDOc3sIeG1L dlD5rixl8I0gC22TQjztKK5Gt6bl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UP2NAc1ZEZ3lqX8VhfKxTyq25fR2U89ubddWS1YCn40mqBIGX4oZDeA1K7a9asUzk/GwNnuNz 4+f+uqFZgs7gbCBNiSztaG6EM9yvZIt41t+MY1j065GjH93X7K7KjDEcQzn6ds3MM8HwT4hEY c61RKdlSw7xlPu1CUiHomUErC2/RV0CVFAfR09T4EHFb70ThB033z3uzWfsqj4pCjaUaWCjpI +sP85rF++4eAQSx1yjAw4wEpfBKt/eLvF1PUyJWTmxXAgQadDUrCqH9PxQkHlNgWXEnj8/fzB bIrzS7D3WVc/t+twS9rN6EX+fT99u5HEvygxg9mCyAXRzNQAAzV8CMC+LgCkEMM9hRVKRn13F tHb8t3e1MjkBTIhf5oEDH5qF+idq+2ScljoOyrkT0MlJKM4DmYSDGpEbH3ZQRjZ2KiDMQWxqX Huuer2YIGC7JjBkUXQsUe/ghs5uUsCXwbsV9JgsBDOvPCHqmx5/l1hAK4pUVmIXqZYdvKqxOQ NLqRVSaZs9qOcVBpQLaK2nwgIt/U8a2bQwQrrAmhIwr5rMyviYvWSXlX01cmIJL8yPl1WZR/v 74PJb4P9eEFX/Ok046DULwGOIVKWoBgEqX+ehALu0Ex4HKYbgEjVzJpKzPsxoeSFv6bB5lseA IcwEzu8YyETga9/X+afWOxVH4Xko2oiJRuqIgU7zyawEYukeUPVNr7bm9sUHgDesqW6uwARc= Received-SPF: pass (zohomail.com: domain of gnu.org designates 209.51.188.17 as permitted sender) client-ip=209.51.188.17; envelope-from=qemu-devel-bounces+importer=patchew.org@nongnu.org; helo=lists.gnu.org; Received-SPF: pass client-ip=212.227.17.11; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: -25 X-Spam_score: -2.6 X-Spam_bar: -- X-Spam_report: (-2.6 / 5.0 requ) BAYES_00=-1.9, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, FREEMAIL_ENVFROM_END_DIGIT=0.25, FREEMAIL_FROM=0.001, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, RCVD_IN_VALIDITY_RPBL_BLOCKED=0.001, RCVD_IN_VALIDITY_SAFE_BLOCKED=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: qemu development List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: qemu-devel-bounces+importer=patchew.org@nongnu.org Sender: qemu-devel-bounces+importer=patchew.org@nongnu.org X-ZohoMail-DKIM: pass (identity lukasstraub2@web.de) X-ZM-MESSAGEID: 1769373686596158500 Signed-off-by: Lukas Straub --- MAINTAINERS | 2 +- docs/COLO-FT.txt | 334 ------------------------------------------ docs/system/index.rst | 1 + docs/system/qemu-colo.rst | 360 ++++++++++++++++++++++++++++++++++++++++++= ++++ 4 files changed, 362 insertions(+), 335 deletions(-) diff --git a/MAINTAINERS b/MAINTAINERS index 2a8b9b2d051883c1b7adce9c1afec80d16a317f8..7d396183cef0f5e2064e016cf47= 9765b97820b71 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3857,7 +3857,7 @@ F: migration/multifd-colo.* F: include/migration/colo.h F: include/migration/failover.h F: tests/qtest/migration/colo-tests.c -F: docs/COLO-FT.txt +F: docs/system/qemu-colo.rst =20 COLO Proxy M: Zhang Chen diff --git a/docs/COLO-FT.txt b/docs/COLO-FT.txt deleted file mode 100644 index 2283a09c080b8996f9767eeb415e8d4fbdc940af..000000000000000000000000000= 0000000000000 --- a/docs/COLO-FT.txt +++ /dev/null @@ -1,334 +0,0 @@ -COarse-grained LOck-stepping Virtual Machines for Non-stop Service ----------------------------------------- -Copyright (c) 2016 Intel Corporation -Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. -Copyright (c) 2016 Fujitsu, Corp. - -This work is licensed under the terms of the GNU GPL, version 2 or later. -See the COPYING file in the top-level directory. - -This document gives an overview of COLO's design and how to use it. - -=3D=3D Background =3D=3D -Virtual machine (VM) replication is a well known technique for providing -application-agnostic software-implemented hardware fault tolerance, -also known as "non-stop service". - -COLO (COarse-grained LOck-stepping) is a high availability solution. -Both primary VM (PVM) and secondary VM (SVM) run in parallel. They receive= the -same request from client, and generate response in parallel too. -If the response packets from PVM and SVM are identical, they are released -immediately. Otherwise, a VM checkpoint (on demand) is conducted. - -=3D=3D Architecture =3D=3D - -The architecture of COLO is shown in the diagram below. -It consists of a pair of networked physical nodes: -The primary node running the PVM, and the secondary node running the SVM -to maintain a valid replica of the PVM. -PVM and SVM execute in parallel and generate output of response packets for -client requests according to the application semantics. - -The incoming packets from the client or external network are received by t= he -primary node, and then forwarded to the secondary node, so that both the P= VM -and the SVM are stimulated with the same requests. - -COLO receives the outbound packets from both the PVM and SVM and compares = them -before allowing the output to be sent to clients. - -The SVM is qualified as a valid replica of the PVM, as long as it generates -identical responses to all client requests. Once the differences in the ou= tputs -are detected between the PVM and SVM, COLO withholds transmission of the -outbound packets until it has successfully synchronized the PVM state to t= he 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 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 | | S= torage | - +---------------+ +----------------+ +------------------+ +----= ----------+ - - -=3D=3D Components introduction =3D=3D - -You can see there are several components in COLO's diagram of architecture. -Their functions are described below. - -HeartBeat: -Runs on both the primary and secondary nodes, to periodically check platfo= rm -availability. When the primary node suffers a hardware fail-stop failure, -the heartbeat stops responding, the secondary node will trigger a failover -as soon as it determines the absence. - -COLO disk Manager: -When primary VM writes data into image, the colo disk manager captures thi= s data -and sends it to secondary VM's which makes sure the context of secondary V= M's -image is consistent with the context of primary VM 's image. -For more details, please refer to docs/block-replication.txt. - -Checkpoint/Failover Controller: -Modifications of save/restore flow to realize continuous migration, -to make sure the state of VM in Secondary side is always consistent with V= M in -Primary side. - -COLO Proxy: -Delivers packets to Primary and Secondary, and then compare the responses = from -both side. Then decide whether to start a checkpoint according to some rul= es. -Please refer to docs/colo-proxy.txt for more information. - -Note: -HeartBeat has not been implemented yet, so you need to trigger failover pr= ocess -by using 'x-colo-lost-heartbeat' command. - -=3D=3D COLO operation status =3D=3D - -+-----------------+ -| | -| 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. - -=3D=3D Test procedure =3D=3D -Note: Here we are running both instances on the same host for testing, -change the IP Addresses if you want to run it on two hosts. Initially -127.0.0.1 is the Primary Host and 127.0.0.2 is the Secondary Host. - -=3D=3D Startup qemu =3D=3D -1. Primary: -Note: Initially, $imagefolder/primary.qcow2 needs to be copied to all host= s. -You don't need to change any IP's here, because 0.0.0.0 listens on any -interface. The chardev's with 127.0.0.1 IP's loopback to the local qemu -instance. - -# imagefolder=3D"/mnt/vms/colo-test-primary" - -# qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=3Don -m 512 -smp 1 -= qmp stdio \ - -device piix3-usb-uhci -device usb-tablet -name primary \ - -netdev tap,id=3Dhn0,vhost=3Doff,helper=3D/usr/lib/qemu/qemu-bridge-hel= per \ - -device rtl8139,id=3De0,netdev=3Dhn0 \ - -chardev socket,id=3Dmirror0,host=3D0.0.0.0,port=3D9003,server=3Don,wai= t=3Doff \ - -chardev socket,id=3Dcompare1,host=3D0.0.0.0,port=3D9004,server=3Don,wa= it=3Don \ - -chardev socket,id=3Dcompare0,host=3D127.0.0.1,port=3D9001,server=3Don,= wait=3Doff \ - -chardev socket,id=3Dcompare0-0,host=3D127.0.0.1,port=3D9001 \ - -chardev socket,id=3Dcompare_out,host=3D127.0.0.1,port=3D9005,server=3D= on,wait=3Doff \ - -chardev socket,id=3Dcompare_out0,host=3D127.0.0.1,port=3D9005 \ - -object filter-mirror,id=3Dm0,netdev=3Dhn0,queue=3Dtx,outdev=3Dmirror0 \ - -object filter-redirector,netdev=3Dhn0,id=3Dredire0,queue=3Drx,indev=3D= compare_out \ - -object filter-redirector,netdev=3Dhn0,id=3Dredire1,queue=3Drx,outdev= =3Dcompare0 \ - -object iothread,id=3Diothread1 \ - -object colo-compare,id=3Dcomp0,primary_in=3Dcompare0-0,secondary_in=3D= compare1,\ -outdev=3Dcompare_out0,iothread=3Diothread1 \ - -drive if=3Dide,id=3Dcolo-disk0,driver=3Dquorum,read-pattern=3Dfifo,vot= e-threshold=3D1,\ -children.0.file.filename=3D$imagefolder/primary.qcow2,children.0.driver=3D= qcow2 -S - -2. Secondary: -Note: Active and hidden images need to be created only once and the -size should be the same as primary.qcow2. Again, you don't need to change -any IP's here, except for the $primary_ip variable. - -# imagefolder=3D"/mnt/vms/colo-test-secondary" -# primary_ip=3D127.0.0.1 - -# qemu-img create -f qcow2 $imagefolder/secondary-active.qcow2 10G - -# qemu-img create -f qcow2 $imagefolder/secondary-hidden.qcow2 10G - -# qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=3Don -m 512 -smp 1 -= qmp stdio \ - -device piix3-usb-uhci -device usb-tablet -name secondary \ - -netdev tap,id=3Dhn0,vhost=3Doff,helper=3D/usr/lib/qemu/qemu-bridge-hel= per \ - -device rtl8139,id=3De0,netdev=3Dhn0 \ - -chardev socket,id=3Dred0,host=3D$primary_ip,port=3D9003,reconnect-ms= =3D1000 \ - -chardev socket,id=3Dred1,host=3D$primary_ip,port=3D9004,reconnect-ms= =3D1000 \ - -object filter-redirector,id=3Df1,netdev=3Dhn0,queue=3Dtx,indev=3Dred0 \ - -object filter-redirector,id=3Df2,netdev=3Dhn0,queue=3Drx,outdev=3Dred1= \ - -object filter-rewriter,id=3Drew0,netdev=3Dhn0,queue=3Dall \ - -drive if=3Dnone,id=3Dparent0,file.filename=3D$imagefolder/primary.qcow= 2,driver=3Dqcow2 \ - -drive if=3Dnone,id=3Dchilds0,driver=3Dreplication,mode=3Dsecondary,fil= e.driver=3Dqcow2,\ -top-id=3Dcolo-disk0,file.file.filename=3D$imagefolder/secondary-active.qco= w2,\ -file.backing.driver=3Dqcow2,file.backing.file.filename=3D$imagefolder/seco= ndary-hidden.qcow2,\ -file.backing.backing=3Dparent0 \ - -drive if=3Dide,id=3Dcolo-disk0,driver=3Dquorum,read-pattern=3Dfifo,vot= e-threshold=3D1,\ -children.0=3Dchilds0 \ - -incoming tcp:0.0.0.0:9998 - - -3. On Secondary VM's QEMU monitor, issue command -{"execute":"qmp_capabilities"} -{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [ {"= capability": "x-colo", "state": true } ] } } -{"execute": "nbd-server-start", "arguments": {"addr": {"type": "inet", "da= ta": {"host": "0.0.0.0", "port": "9999"} } } } -{"execute": "nbd-server-add", "arguments": {"device": "parent0", "writable= ": true } } - -Note: - a. The qmp command nbd-server-start and nbd-server-add must be run - before running the qmp command migrate on primary QEMU - b. Active disk, hidden disk and nbd target's length should be the - same. - c. It is better to put active disk and hidden disk in ramdisk. They - will be merged into the parent disk on failover. - -4. On Primary VM's QEMU monitor, issue command: -{"execute":"qmp_capabilities"} -{"execute": "human-monitor-command", "arguments": {"command-line": "drive_= add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file.hos= t=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplicatio= n0"}} -{"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", "nod= e": "replication0" } } -{"execute": "migrate-set-capabilities", "arguments": {"capabilities": [ {"= capability": "x-colo", "state": true } ] } } -{"execute": "migrate", "arguments": {"uri": "tcp:127.0.0.2:9998" } } - - Note: - a. There should be only one NBD Client for each primary disk. - b. The qmp command line must be run after running qmp command line in - secondary qemu. - -5. After the above steps, you will see, whenever you make changes to PVM, = SVM will be synced. -You can issue command '{ "execute": "migrate-set-parameters" , "arguments"= :{ "x-checkpoint-delay": 2000 } }' -to change the idle checkpoint period time - -6. Failover test -You can kill one of the VMs and Failover on the surviving VM: - -If you killed the Secondary, then follow "Primary Failover". After that, -if you want to resume the replication, follow "Primary resume replication" - -If you killed the Primary, then follow "Secondary Failover". After that, -if you want to resume the replication, follow "Secondary resume replicatio= n" - -=3D=3D Primary Failover =3D=3D -The Secondary died, resume on the Primary - -{"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "ch= ild": "children.1"} } -{"execute": "human-monitor-command", "arguments":{ "command-line": "drive_= del replication0" } } -{"execute": "object-del", "arguments":{ "id": "comp0" } } -{"execute": "object-del", "arguments":{ "id": "iothread1" } } -{"execute": "object-del", "arguments":{ "id": "m0" } } -{"execute": "object-del", "arguments":{ "id": "redire0" } } -{"execute": "object-del", "arguments":{ "id": "redire1" } } -{"execute": "x-colo-lost-heartbeat" } - -=3D=3D Secondary Failover =3D=3D -The Primary died, resume on the Secondary and prepare to become the new Pr= imary - -{"execute": "nbd-server-stop"} -{"execute": "x-colo-lost-heartbeat"} - -{"execute": "object-del", "arguments":{ "id": "f2" } } -{"execute": "object-del", "arguments":{ "id": "f1" } } -{"execute": "chardev-remove", "arguments":{ "id": "red1" } } -{"execute": "chardev-remove", "arguments":{ "id": "red0" } } - -{"execute": "chardev-add", "arguments":{ "id": "mirror0", "backend": {"typ= e": "socket", "data": {"addr": { "type": "inet", "data": { "host": "0.0.0.0= ", "port": "9003" } }, "server": true } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare1", "backend": {"ty= pe": "socket", "data": {"addr": { "type": "inet", "data": { "host": "0.0.0.= 0", "port": "9004" } }, "server": true } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare0", "backend": {"ty= pe": "socket", "data": {"addr": { "type": "inet", "data": { "host": "127.0.= 0.1", "port": "9001" } }, "server": true } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare0-0", "backend": {"= type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "127.= 0.0.1", "port": "9001" } }, "server": false } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare_out", "backend": {= "type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "127= .0.0.1", "port": "9005" } }, "server": true } } } } -{"execute": "chardev-add", "arguments":{ "id": "compare_out0", "backend": = {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "12= 7.0.0.1", "port": "9005" } }, "server": false } } } } - -=3D=3D Primary resume replication =3D=3D -Resume replication after new Secondary is up. - -Start the new Secondary (Steps 2 and 3 above), then on the Primary: -{"execute": "drive-mirror", "arguments":{ "device": "colo-disk0", "job-id"= : "resync", "target": "nbd://127.0.0.2:9999/parent0", "mode": "existing", "= format": "raw", "sync": "full"} } - -Wait until disk is synced, then: -{"execute": "stop"} -{"execute": "block-job-cancel", "arguments":{ "device": "resync"} } - -{"execute": "human-monitor-command", "arguments":{ "command-line": "drive_= add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file.hos= t=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplicatio= n0"}} -{"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "no= de": "replication0" } } - -{"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "id":= "m0", "netdev": "hn0", "queue": "tx", "outdev": "mirror0" } } -{"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "= id": "redire0", "netdev": "hn0", "queue": "rx", "indev": "compare_out" } } -{"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "= id": "redire1", "netdev": "hn0", "queue": "rx", "outdev": "compare0" } } -{"execute": "object-add", "arguments":{ "qom-type": "iothread", "id": "iot= hread1" } } -{"execute": "object-add", "arguments":{ "qom-type": "colo-compare", "id": = "comp0", "primary_in": "compare0-0", "secondary_in": "compare1", "outdev": = "compare_out0", "iothread": "iothread1" } } - -{"execute": "migrate-set-capabilities", "arguments":{ "capabilities": [ {"= capability": "x-colo", "state": true } ] } } -{"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.2:9998" } } - -Note: -If this Primary previously was a Secondary, then we need to insert the -filters before the filter-rewriter by using the -""insert": "before", "position": "id=3Drew0"" Options. See below. - -=3D=3D Secondary resume replication =3D=3D -Become Primary and resume replication after new Secondary is up. Note -that now 127.0.0.1 is the Secondary and 127.0.0.2 is the Primary. - -Start the new Secondary (Steps 2 and 3 above, but with primary_ip=3D127.0.= 0.2), -then on the old Secondary: -{"execute": "drive-mirror", "arguments":{ "device": "colo-disk0", "job-id"= : "resync", "target": "nbd://127.0.0.1:9999/parent0", "mode": "existing", "= format": "raw", "sync": "full"} } - -Wait until disk is synced, then: -{"execute": "stop"} -{"execute": "block-job-cancel", "arguments":{ "device": "resync" } } - -{"execute": "human-monitor-command", "arguments":{ "command-line": "drive_= add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file.hos= t=3D127.0.0.1,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplicatio= n0"}} -{"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0", "no= de": "replication0" } } - -{"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "id":= "m0", "insert": "before", "position": "id=3Drew0", "netdev": "hn0", "queue= ": "tx", "outdev": "mirror0" } } -{"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "= id": "redire0", "insert": "before", "position": "id=3Drew0", "netdev": "hn0= ", "queue": "rx", "indev": "compare_out" } } -{"execute": "object-add", "arguments":{ "qom-type": "filter-redirector", "= id": "redire1", "insert": "before", "position": "id=3Drew0", "netdev": "hn0= ", "queue": "rx", "outdev": "compare0" } } -{"execute": "object-add", "arguments":{ "qom-type": "iothread", "id": "iot= hread1" } } -{"execute": "object-add", "arguments":{ "qom-type": "colo-compare", "id": = "comp0", "primary_in": "compare0-0", "secondary_in": "compare1", "outdev": = "compare_out0", "iothread": "iothread1" } } - -{"execute": "migrate-set-capabilities", "arguments":{ "capabilities": [ {"= capability": "x-colo", "state": true } ] } } -{"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.1:9998" } } - -=3D=3D TODO =3D=3D -1. Support shared storage. -2. Develop the heartbeat part. -3. Reduce checkpoint VM=E2=80=99s downtime while doing checkpoint. diff --git a/docs/system/index.rst b/docs/system/index.rst index 427b020483104f6589878bbf255a367ae114c61b..6268c41aea9c74dc3e59d896b5a= e082360bfbb1a 100644 --- a/docs/system/index.rst +++ b/docs/system/index.rst @@ -41,3 +41,4 @@ or Hypervisor.Framework. igvm vm-templating sriov + qemu-colo diff --git a/docs/system/qemu-colo.rst b/docs/system/qemu-colo.rst new file mode 100644 index 0000000000000000000000000000000000000000..4b5fbbf398f8a5c4ea6baad615b= de94b2b4678d2 --- /dev/null +++ b/docs/system/qemu-colo.rst @@ -0,0 +1,360 @@ +Qemu COLO Fault Tolerance +=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D= =3D + +| Copyright (c) 2016 Intel Corporation +| Copyright (c) 2016 HUAWEI TECHNOLOGIES CO., LTD. +| Copyright (c) 2016 Fujitsu, Corp. + +This work is licensed under the terms of the GNU GPL, version 2 or later. +See the COPYING file in the top-level directory. + +This document gives an overview of COLO's design and how to use it. + +Background +---------- +Virtual machine (VM) replication is a well known technique for providing +application-agnostic software-implemented hardware fault tolerance, +also known as "non-stop service". + +COLO (COarse-grained LOck-stepping) is a high availability solution. +Both primary VM (PVM) and secondary VM (SVM) run in parallel. They receive= the +same request from client, and generate response in parallel too. +If the response packets from PVM and SVM are identical, they are released +immediately. Otherwise, a VM checkpoint (on demand) is conducted. + +Architecture +------------ +The architecture of COLO is shown in the diagram below. +It consists of a pair of networked physical nodes: +The primary node running the PVM, and the secondary node running the SVM +to maintain a valid replica of the PVM. +PVM and SVM execute in parallel and generate output of response packets for +client requests according to the application semantics. + +The incoming packets from the client or external network are received by t= he +primary node, and then forwarded to the secondary node, so that both the P= VM +and the SVM are stimulated with the same requests. + +COLO receives the outbound packets from both the PVM and SVM and compares = them +before allowing the output to be sent to clients. + +The SVM is qualified as a valid replica of the PVM, as long as it generates +identical responses to all client requests. Once the differences in the ou= tputs +are detected between the PVM and SVM, COLO withholds transmission of the +outbound packets until it has successfully synchronized the PVM state to t= he SVM. + +Overview:: + + 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 dis= k| | | | + | | | | 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 +^^^^^^^^^^^^^^^^^^^^^^^ +You can see there are several components in COLO's diagram of architecture. +Their functions are described below. + +HeartBeat +~~~~~~~~~ +Runs on both the primary and secondary nodes, to periodically check platfo= rm +availability. When the primary node suffers a hardware fail-stop failure, +the heartbeat stops responding, the secondary node will trigger a failover +as soon as it determines the absence. + +COLO disk Manager +~~~~~~~~~~~~~~~~~ +When primary VM writes data into image, the colo disk manager captures thi= s data +and sends it to secondary VM's which makes sure the context of secondary V= M's +image is consistent with the context of primary VM 's image. +For more details, please refer to docs/block-replication.txt. + +Checkpoint/Failover Controller +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Modifications of save/restore flow to realize continuous migration, +to make sure the state of VM in Secondary side is always consistent with V= M in +Primary side. + +COLO Proxy +~~~~~~~~~~ +Delivers packets to Primary and Secondary, and then compare the responses = from +both side. Then decide whether to start a checkpoint according to some rul= es. +Please refer to docs/colo-proxy.txt for more information. + +Note: +HeartBeat has not been implemented yet, so you need to trigger failover pr= ocess +by using 'x-colo-lost-heartbeat' command. + +COLO operation status +^^^^^^^^^^^^^^^^^^^^^ + +Overview:: + + +-----------------+ + | | + | 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 +-------------- +Note: Here we are running both instances on the same host for testing, +change the IP Addresses if you want to run it on two hosts. Initially +``127.0.0.1`` is the Primary Host and ``127.0.0.2`` is the Secondary Host. + +Startup qemu +^^^^^^^^^^^^ +**1. Primary**: +Note: Initially, ``$imagefolder/primary.qcow2`` needs to be copied to all = hosts. +You don't need to change any IP's here, because ``0.0.0.0`` listens on any +interface. The chardev's with ``127.0.0.1`` IP's loopback to the local qemu +instance:: + + # imagefolder=3D"/mnt/vms/colo-test-primary" + + # qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=3Don -m 512 -smp= 1 -qmp stdio \ + -device piix3-usb-uhci -device usb-tablet -name primary \ + -netdev tap,id=3Dhn0,vhost=3Doff,helper=3D/usr/lib/qemu/qemu-bridge= -helper \ + -device rtl8139,id=3De0,netdev=3Dhn0 \ + -chardev socket,id=3Dmirror0,host=3D0.0.0.0,port=3D9003,server=3Don= ,wait=3Doff \ + -chardev socket,id=3Dcompare1,host=3D0.0.0.0,port=3D9004,server=3Do= n,wait=3Don \ + -chardev socket,id=3Dcompare0,host=3D127.0.0.1,port=3D9001,server= =3Don,wait=3Doff \ + -chardev socket,id=3Dcompare0-0,host=3D127.0.0.1,port=3D9001 \ + -chardev socket,id=3Dcompare_out,host=3D127.0.0.1,port=3D9005,serve= r=3Don,wait=3Doff \ + -chardev socket,id=3Dcompare_out0,host=3D127.0.0.1,port=3D9005 \ + -object filter-mirror,id=3Dm0,netdev=3Dhn0,queue=3Dtx,outdev=3Dmirr= or0 \ + -object filter-redirector,netdev=3Dhn0,id=3Dredire0,queue=3Drx,inde= v=3Dcompare_out \ + -object filter-redirector,netdev=3Dhn0,id=3Dredire1,queue=3Drx,outd= ev=3Dcompare0 \ + -object iothread,id=3Diothread1 \ + -object colo-compare,id=3Dcomp0,primary_in=3Dcompare0-0,secondary_i= n=3Dcompare1,\ + outdev=3Dcompare_out0,iothread=3Diothread1 \ + -drive if=3Dide,id=3Dcolo-disk0,driver=3Dquorum,read-pattern=3Dfifo= ,vote-threshold=3D1,\ + children.0.file.filename=3D$imagefolder/primary.qcow2,children.0.drive= r=3Dqcow2 -S + + +**2. Secondary**: +Note: Active and hidden images need to be created only once and the +size should be the same as ``primary.qcow2``. Again, you don't need to cha= nge +any IP's here, except for the ``$primary_ip`` variable:: + + # imagefolder=3D"/mnt/vms/colo-test-secondary" + # primary_ip=3D127.0.0.1 + + # qemu-img create -f qcow2 $imagefolder/secondary-active.qcow2 10G + + # qemu-img create -f qcow2 $imagefolder/secondary-hidden.qcow2 10G + + # qemu-system-x86_64 -enable-kvm -cpu qemu64,kvmclock=3Don -m 512 -smp= 1 -qmp stdio \ + -device piix3-usb-uhci -device usb-tablet -name secondary \ + -netdev tap,id=3Dhn0,vhost=3Doff,helper=3D/usr/lib/qemu/qemu-bridge= -helper \ + -device rtl8139,id=3De0,netdev=3Dhn0 \ + -chardev socket,id=3Dred0,host=3D$primary_ip,port=3D9003,reconnect-= ms=3D1000 \ + -chardev socket,id=3Dred1,host=3D$primary_ip,port=3D9004,reconnect-= ms=3D1000 \ + -object filter-redirector,id=3Df1,netdev=3Dhn0,queue=3Dtx,indev=3Dr= ed0 \ + -object filter-redirector,id=3Df2,netdev=3Dhn0,queue=3Drx,outdev=3D= red1 \ + -object filter-rewriter,id=3Drew0,netdev=3Dhn0,queue=3Dall \ + -drive if=3Dnone,id=3Dparent0,file.filename=3D$imagefolder/primary.= qcow2,driver=3Dqcow2 \ + -drive if=3Dnone,id=3Dchilds0,driver=3Dreplication,mode=3Dsecondary= ,file.driver=3Dqcow2,\ + top-id=3Dcolo-disk0,file.file.filename=3D$imagefolder/secondary-active= .qcow2,\ + file.backing.driver=3Dqcow2,file.backing.file.filename=3D$imagefolder/= secondary-hidden.qcow2,\ + file.backing.backing=3Dparent0 \ + -drive if=3Dide,id=3Dcolo-disk0,driver=3Dquorum,read-pattern=3Dfifo= ,vote-threshold=3D1,\ + children.0=3Dchilds0 \ + -incoming tcp:0.0.0.0:9998 + + +**3.** On Secondary VM's QEMU monitor, issue command:: + + {"execute":"qmp_capabilities"} + {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "nbd-server-start", "arguments": {"addr": {"type": "inet",= "data": {"host": "0.0.0.0", "port": "9999"} } } } + {"execute": "nbd-server-add", "arguments": {"device": "parent0", "writ= able": true } } + +Note: + a. The qmp command ``nbd-server-start`` and ``nbd-server-add`` must be r= un + before running the qmp command migrate on primary QEMU + b. Active disk, hidden disk and nbd target's length should be the + same. + c. It is better to put active disk and hidden disk in ramdisk. They + will be merged into the parent disk on failover. + +**4.** On Primary VM's QEMU monitor, issue command:: + + {"execute":"qmp_capabilities"} + {"execute": "human-monitor-command", "arguments": {"command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} + {"execute": "x-blockdev-change", "arguments":{"parent": "colo-disk0", = "node": "replication0" } } + {"execute": "migrate-set-capabilities", "arguments": {"capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "migrate", "arguments": {"uri": "tcp:127.0.0.2:9998" } } + +Note: + a. There should be only one NBD Client for each primary disk. + b. The qmp command line must be run after running qmp command line in + secondary qemu. + +**5.** After the above steps, you will see, whenever you make changes to P= VM, SVM will be synced. +You can issue command ``{ "execute": "migrate-set-parameters" , "arguments= ":{ "x-checkpoint-delay": 2000 } }`` +to change the idle checkpoint period time + +Failover test +^^^^^^^^^^^^^ +You can kill one of the VMs and Failover on the surviving VM: + +If you killed the Secondary, then follow "Primary Failover". +After that, if you want to resume the replication, follow "Primary resume = replication" + +If you killed the Primary, then follow "Secondary Failover". +After that, if you want to resume the replication, follow "Secondary resum= e replication" + +Primary Failover +~~~~~~~~~~~~~~~~ +The Secondary died, resume on the Primary:: + + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "child": "children.1"} } + {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_del replication0" } } + {"execute": "object-del", "arguments":{ "id": "comp0" } } + {"execute": "object-del", "arguments":{ "id": "iothread1" } } + {"execute": "object-del", "arguments":{ "id": "m0" } } + {"execute": "object-del", "arguments":{ "id": "redire0" } } + {"execute": "object-del", "arguments":{ "id": "redire1" } } + {"execute": "x-colo-lost-heartbeat" } + +Secondary Failover +~~~~~~~~~~~~~~~~~~ +The Primary died, resume on the Secondary and prepare to become the new Pr= imary:: + + {"execute": "nbd-server-stop"} + {"execute": "x-colo-lost-heartbeat"} + + {"execute": "object-del", "arguments":{ "id": "f2" } } + {"execute": "object-del", "arguments":{ "id": "f1" } } + {"execute": "chardev-remove", "arguments":{ "id": "red1" } } + {"execute": "chardev-remove", "arguments":{ "id": "red0" } } + + {"execute": "chardev-add", "arguments":{ "id": "mirror0", "backend": {= "type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "0.0= .0.0", "port": "9003" } }, "server": true } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare1", "backend": = {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "0.= 0.0.0", "port": "9004" } }, "server": true } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare0", "backend": = {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "12= 7.0.0.1", "port": "9001" } }, "server": true } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare0-0", "backend"= : {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": "= 127.0.0.1", "port": "9001" } }, "server": false } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare_out", "backend= ": {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host": = "127.0.0.1", "port": "9005" } }, "server": true } } } } + {"execute": "chardev-add", "arguments":{ "id": "compare_out0", "backen= d": {"type": "socket", "data": {"addr": { "type": "inet", "data": { "host":= "127.0.0.1", "port": "9005" } }, "server": false } } } } + +Primary resume replication +~~~~~~~~~~~~~~~~~~~~~~~~~~ +Resume replication after new Secondary is up. + +Start the new Secondary (Steps 2 and 3 above), then on the Primary:: + + {"execute": "drive-mirror", "arguments":{ "device": "colo-disk0", "job= -id": "resync", "target": "nbd://127.0.0.2:9999/parent0", "mode": "existing= ", "format": "raw", "sync": "full"} } + +Wait until disk is synced, then:: + + {"execute": "stop"} + {"execute": "block-job-cancel", "arguments":{ "device": "resync"} } + + {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.2,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "node": "replication0" } } + + {"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "= id": "m0", "netdev": "hn0", "queue": "tx", "outdev": "mirror0" } } + {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire0", "netdev": "hn0", "queue": "rx", "indev": "compare_out" = } } + {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire1", "netdev": "hn0", "queue": "rx", "outdev": "compare0" } } + {"execute": "object-add", "arguments":{ "qom-type": "iothread", "id": = "iothread1" } } + {"execute": "object-add", "arguments":{ "qom-type": "colo-compare", "i= d": "comp0", "primary_in": "compare0-0", "secondary_in": "compare1", "outde= v": "compare_out0", "iothread": "iothread1" } } + + {"execute": "migrate-set-capabilities", "arguments":{ "capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.2:9998" } } + +Note: +If this Primary previously was a Secondary, then we need to insert the +filters before the filter-rewriter by using the +""insert": "before", "position": "id=3Drew0"" Options. See below. + +Secondary resume replication +~~~~~~~~~~~~~~~~~~~~~~~~~~~~ +Become Primary and resume replication after new Secondary is up. Note +that now 127.0.0.1 is the Secondary and 127.0.0.2 is the Primary. + +Start the new Secondary (Steps 2 and 3 above, but with primary_ip=3D127.0.= 0.2), +then on the old Secondary:: + + {"execute": "drive-mirror", "arguments":{ "device": "colo-disk0", "job= -id": "resync", "target": "nbd://127.0.0.1:9999/parent0", "mode": "existing= ", "format": "raw", "sync": "full"} } + +Wait until disk is synced, then:: + + {"execute": "stop"} + {"execute": "block-job-cancel", "arguments":{ "device": "resync" } } + + {"execute": "human-monitor-command", "arguments":{ "command-line": "dr= ive_add -n buddy driver=3Dreplication,mode=3Dprimary,file.driver=3Dnbd,file= .host=3D127.0.0.1,file.port=3D9999,file.export=3Dparent0,node-name=3Dreplic= ation0"}} + {"execute": "x-blockdev-change", "arguments":{ "parent": "colo-disk0",= "node": "replication0" } } + + {"execute": "object-add", "arguments":{ "qom-type": "filter-mirror", "= id": "m0", "insert": "before", "position": "id=3Drew0", "netdev": "hn0", "q= ueue": "tx", "outdev": "mirror0" } } + {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire0", "insert": "before", "position": "id=3Drew0", "netdev": = "hn0", "queue": "rx", "indev": "compare_out" } } + {"execute": "object-add", "arguments":{ "qom-type": "filter-redirector= ", "id": "redire1", "insert": "before", "position": "id=3Drew0", "netdev": = "hn0", "queue": "rx", "outdev": "compare0" } } + {"execute": "object-add", "arguments":{ "qom-type": "iothread", "id": = "iothread1" } } + {"execute": "object-add", "arguments":{ "qom-type": "colo-compare", "i= d": "comp0", "primary_in": "compare0-0", "secondary_in": "compare1", "outde= v": "compare_out0", "iothread": "iothread1" } } + + {"execute": "migrate-set-capabilities", "arguments":{ "capabilities": = [ {"capability": "x-colo", "state": true } ] } } + {"execute": "migrate", "arguments":{ "uri": "tcp:127.0.0.1:9998" } } + +TODO +---- +1. Support shared storage. +2. Develop the heartbeat part. +3. Reduce checkpoint VM=E2=80=99s downtime while doing checkpoint. --=20 2.39.5