From nobody Sat Feb 28 03:10:45 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=1771617231; cv=none; d=zohomail.com; s=zohoarc; b=mjOwYO7y+J2Xpn1PLNQbLZuNsK2xE/tIBhI7b7XmfTXDum4aYByOiKugHJvAgxwX4MxZMUpZzwvWPtgnJsdN3f4OTnH5pUcwYXUwGhWG4n9HES7r+RaMJQoMMMmRA5VOy+68O4jOnUcX8SNfa9CUKclZksnDEYj65llwnptfaFQ= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1771617231; 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=tm2GuqhPzDQglqiU9unalx2iQFmY16oh1Y5nzSaxNkU=; b=Q2s+YD9MmwRmid73kFjWI7Hb6epTVo8E+fkMRxd3txoHv7/ke0qv+AYW0fPgVFxO4l3GkRCSppBj8r8up+48JhnMJnK5Hx4vOMek2JjIQChyP0cLcM9ystq2R93cSPJUl41xUfcZzltnA2UyYVzk3qag0mWQ99CdYDMQt84KUms= 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 1771617230985909.7302873084839; Fri, 20 Feb 2026 11:53:50 -0800 (PST) Received: from localhost ([::1] helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1vtWXp-0000WF-2u; Fri, 20 Feb 2026 14:52:09 -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 1vtWXl-0000Vn-H1 for qemu-devel@nongnu.org; Fri, 20 Feb 2026 14:52:05 -0500 Received: from mout.web.de ([212.227.15.14]) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1vtWXg-0001T9-B6 for qemu-devel@nongnu.org; Fri, 20 Feb 2026 14:52:05 -0500 Received: from [127.0.1.1] ([84.133.37.84]) by smtp.web.de (mrweb005 [213.165.67.108]) with ESMTPSA (Nemesis) id 1MNwfU-1w4Z8p0YO0-00O65o; Fri, 20 Feb 2026 20:51:51 +0100 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=web.de; s=s29768273; t=1771617111; x=1772221911; i=lukasstraub2@web.de; bh=tm2GuqhPzDQglqiU9unalx2iQFmY16oh1Y5nzSaxNkU=; 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=IHMTsvV6/cj06RI/8tY7DGntUTZq5jpTTVL8ZOQn0vdm8cu4vXM0FgoEh0cTxsxn 1y61v79d8VcRo8CWO5R+FypzT5yCIHs5zQskJKUTDjal47hkfEx0IiOlhYA7fPD/T 6AMocH+XZcQX58ivlyzLgdtxOse8S+UuG6IrIOMCLQ1+ZIbV52vzFJnr6iSXGuhTK ZAnQF9u+yVebi4bNLRHQs+hUKDATc7+/nJ+H5sybVu9+nkXMRdKYHyOPOCUjbFsHo fV6d7eVITLeeZlyUxLALr4PnyrNj0cYT75ku06L7hrIMgqlVO6J9HyXEXLzUCHj9L SveBkhdsqwEx08ZW5w== X-UI-Sender-Class: 814a7b36-bfc1-4dae-8640-3722d8ec6cd6 From: Lukas Straub Date: Fri, 20 Feb 2026 20:51:36 +0100 Subject: [PATCH v10 14/19] Convert colo main documentation to restructuredText MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Message-Id: <20260220-colo_unit_test_multifd-v10-14-bfe67d422ef1@web.de> References: <20260220-colo_unit_test_multifd-v10-0-bfe67d422ef1@web.de> In-Reply-To: <20260220-colo_unit_test_multifd-v10-0-bfe67d422ef1@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=41531; i=lukasstraub2@web.de; h=from:subject:message-id; bh=iT0yKWdgPjIrLAMyRRhfEz9UKNNM/A4TaDEqfoojmL4=; b=owEBbQKS/ZANAwAKATWrCyicXbJYAcsmYgBpmLtOUaKYKgoTo4StRHNY3GlcV0krIwwtXPTw9 HvHjmTdZqyJAjMEAAEKAB0WIQSD+rFYoNm4+3Jij6Q1qwsonF2yWAUCaZi7TgAKCRA1qwsonF2y WIPkD/9dLoOPfZzObLd/OihacZTpu7Yuj2VgG6vlT0NbUOKsHJtcShFlbQQbuOg/0qh+lkcH8Z7 kpBC6zHztb68gRRfhCvjLBuCQqJica71SqRXgrDNXw4YoDpEVRQbthg7YVDAg9zphVJp+Qm9HcA CYW6atPzTA5zPZbUJXQMJpsRVpSBMhRPhGrTJ5zCwKD0yahFITHGtcIAd/Uyq0rrEsxzqY3spAi h2gcVUfDyNZztB8eDXRpWYN8F51jX/JOdIMQsIIXISG9H1Ct9gfhqKahP2ZvkNgVQIahu+Lnm+y 8wzAZ1SG6Y63hVJXK3pxG/E5wwGN4dk4tnvk2b5DTjgtcXwdz7VCEKiMvttVhoIV3c+d+PaJAsp ynoI3aL1t0bdcYvyMKDdILww3ZS6enS6GzGAnNHpDOz6YtAw5McXuTF5qi18YIaUiEP5pdMsXcL u0eUIva9ZogKYtSgvI9btjaD79BcW6lasd54CPXv/drcUxuWXY+KRR5GkIF4t2l1NjNFQbsaOr0 eZ3rsHYDIXHrdNDNUPiMAmwV/SWfmK37nSPpBrlZcF00iRwLzJicIhmMSNN8Rf9ZChGFv1aHyto /F/+TMeFLNS31Z6vtNZIJuDSjdmnK+eSjHSOSV2UWM5tDlOFZxlzSZKFIVoyLkHudAl2Ap6kDtT BbMTFZ3MF9ZleDQ== X-Developer-Key: i=lukasstraub2@web.de; a=openpgp; fpr=83FAB158A0D9B8FB72628FA435AB0B289C5DB258 X-Provags-ID: V03:K1:ImepbSKhqJoELp+6LjZkecujlglgiwepl/I/nSoXUsj0b1L4KfL vOsz7XqNAKERPPFNmVeW7H5imRsL7evdDk+OcPrf40S+MN/AmMUZb2sIqTSJJ8jscNWQ+jB Ter2edKjxkbSKiPC1QdGb9KHdsR7tRk+G6xq3H883tDKKIKPawPBUob6zLcX0DcoPsxMg/x OAMFCQ9Q9g0MTnj1JmZAQ== UI-OutboundReport: notjunk:1;M01:P0:nCqL8/b3DMI=;UHw1hcDjHj9S6qB2gcWjGhDEDtv z+dvUu+vtgBlFnVP1J4jF5CpN9doC4teqpNjPTrn9aX2i4l30XMDS/ajD2NumlAhe1AIKNn/h LXvyFASolDL8DsUQ7yWNX/avh6YO9PMZi0+YIYCtdAVSJNPnDmVW6UHuX5F7JmpF8zJGJL3cd NxYcQ5dk48mxvnleKTyuKt5dBgCrBu7psfvfaAVFKpQwwQf6es74Q8TnF4uJeX2gRYVIQ7H3f D/ziBYmGxud5KM/wxztDJiErJ8hw8dOJmGkPL5sb6fwrqU9RoakPM4tIBzJsr3L+JIxhMoGNa yr7XwciyofvRqXjdEW8tWcOTvMQmdepudx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w/Qtx14jX8bc/X5PUAEoQVhMA8 sMY2sMPcrtq0ey2MciKW17F45ZjXUsFQ5jb5oygRSJgFKJNy06oqdO8w/UR9haB73Vt6xaLFj uSOgJHYpCBQazn+iFvI7+GBpJwkRWahPVssZT4Q81tHxGDpNG3WLmKYOoxEuOdYRbEy+/VZLh f81XZRS78r4jVA3qGPQf5bD+pqadqjCLOMw7/5xDDfh/aGKVS+muSx5nGI10B4aQF5c6QnQ6g grNHdMbr3rAEKUH+G+beN+YijYItCZf8TRh8s3PY348px13E3Dn4+Vwie6CuX8ieLuVx2kGzY 4vKP5KrEiaZIWdM/YggN31mJCFOLL8M/xv1o4V/Bcj5P7tb9qWX9BX4NtNNgtS4e/HhIW5wZZ HfHVDwRmoC5t95gXcS5l9mF9BNE/5Qo+Zs5m7WoX7S8WuplMfcHQ+64XodZSUFdbD9yF/wAyw 1II6cGhonF3I3uwxjoy+Kb1yXfMX9zIJIwIc+78MjsP4GOCY4geQY26xYa14x7pGMcA/3bBo7 4T1wEiCxV3iEKFGtQ9Kq9o+WqZraSHvNymBZladN6a8uTAXkN6ATVZErMrWN+1jHkErU1nmJP n4qY3VwLLdhtf6mx7oxGEuXGktYNYVfnSbdQuF8UFadn2dIanMiI6fB3U1Ons+W7ubBS5Kz61 B9ESJnD/gPIUY3koDmJxA/7NC9neMorc3QU9OE25UGwHz+U1ZfMnyWAdy7ULyeRwGYf+nxGbe oOCcInOqduiKaq+rmkLX 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.15.14; envelope-from=lukasstraub2@web.de; helo=mout.web.de X-Spam_score_int: -24 X-Spam_score: -2.5 X-Spam_bar: -- X-Spam_report: (-2.5 / 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_H4=0.001, RCVD_IN_MSPIKE_WL=0.001, RCVD_IN_VALIDITY_CERTIFIED_BLOCKED=0.001, RCVD_IN_VALIDITY_RPBL_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: 1771617231941158500 Reviewed-by: Fabiano Rosas Reviewed-by: Zhang Chen 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 a587a9233ac556a420f8784c4e3217e5c5b99f34..486c361ceac893175a8cb4f9ae2= e8ac8202137ea 100644 --- a/MAINTAINERS +++ b/MAINTAINERS @@ -3872,7 +3872,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