From nobody Fri Apr 19 01:31:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) client-ip=216.205.24.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620144996; cv=none; d=zohomail.com; s=zohoarc; b=TP2FDTnFmUubt4Qkvsi/bxqkzFu/corpVe78fsrH6R4WwI2LDzeFoxjDTMP/BC0eD+8YGzHluiIbJmhO/z6nHxj5BKx8e76t3J2LIE2ktUpQXwrZzq27HVe2H4Slr2cbdtpDi819LVQxLyDpZ9dVVwLofEt/CLZuBJQPk3rSwcA= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620144996; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=V/IT1GH3NWBhBJtWUjgQjfY21KX8qyhkK/fQtfe/u6A=; b=B3Okl4c/nxodYIDLxkQxDLHwCXPZU+ciZxB2yAN8j1Bn+LxRJgDjcVqQ9njRqX4r0fy/jIw5fzh+BwGY53/3jmcWiOqvIPuln5/+Ywg1k5h4cdEWf82exwkOMY+9+eq4XbkaOZZ+NLg3oVtYFMG/SEL6UFIfQCO8E5Pgdrx2qPs= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 216.205.24.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [216.205.24.124]) by mx.zohomail.com with SMTPS id 1620144996790528.491298009885; Tue, 4 May 2021 09:16:36 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-603-Sb_jICQ-Pq2WkSQfOGe4Xg-1; Tue, 04 May 2021 12:16:33 -0400 Received: from smtp.corp.redhat.com (int-mx07.intmail.prod.int.phx2.redhat.com [10.5.11.22]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 4542A6D505; Tue, 4 May 2021 16:16:25 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id C45E5106A02F; Tue, 4 May 2021 16:16:24 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id E453C18095C2; Tue, 4 May 2021 16:16:22 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 144GGLsY026819 for ; Tue, 4 May 2021 12:16:21 -0400 Received: by smtp.corp.redhat.com (Postfix) id 8D34F19C71; Tue, 4 May 2021 16:16:21 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-176.ams2.redhat.com [10.36.113.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id 83A7B90BD; Tue, 4 May 2021 16:16:20 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620144995; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=V/IT1GH3NWBhBJtWUjgQjfY21KX8qyhkK/fQtfe/u6A=; b=e62Fhvwwr4sy00ipDHSusqHrlHc9p2R/mfWHUjkU2roey797tN8WS/7wG4QEx7fKtCoDXU LYYw5Y31OwlMcntRDv/VMUJfckYLvfiL9BevHkgGHQ2ucqmNjW6y8cwXrCcCd0HVpPwiZ5 QL/ZNHID0JJvk1UfsZ/zlnKFECIxoN4= X-MC-Unique: Sb_jICQ-Pq2WkSQfOGe4Xg-1 From: Kashyap Chamarthy To: libvir-list@redhat.com Subject: [libvirt PATCH 1/2] docs: kbase: Add a doc on live full disk backup Date: Tue, 4 May 2021 18:16:12 +0200 Message-Id: <20210504161613.159831-2-kchamart@redhat.com> In-Reply-To: <20210504161613.159831-1-kchamart@redhat.com> References: <20210504161613.159831-1-kchamart@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.84 on 10.5.11.22 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This is a rewrite of: https://wiki.libvirt.org/page/Live-disk-backup-with-active-blockcommit Once this commit merges, the above wiki should point to this kbase document. Signed-off-by: Kashyap Chamarthy --- docs/kbase/index.rst | 3 + docs/kbase/live_full_disk_backup.rst | 111 +++++++++++++++++++++++++++ 2 files changed, 114 insertions(+) create mode 100644 docs/kbase/live_full_disk_backup.rst diff --git a/docs/kbase/index.rst b/docs/kbase/index.rst index 532804fe05..5ee3b5fce8 100644 --- a/docs/kbase/index.rst +++ b/docs/kbase/index.rst @@ -12,6 +12,9 @@ Usage Explanation of how disk backing chain specification impacts libvirt's behaviour and basic troubleshooting steps of disk problems. =20 +`Live full disk backup `__ + A walkthrough of how to take effective live full disk backups. + `Virtio-FS `__ Share a filesystem between the guest and the host =20 diff --git a/docs/kbase/live_full_disk_backup.rst b/docs/kbase/live_full_di= sk_backup.rst new file mode 100644 index 0000000000..f4ef7f2cc7 --- /dev/null +++ b/docs/kbase/live_full_disk_backup.rst @@ -0,0 +1,111 @@ +Efficient live full disk backup +=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=3D=3D=3D=3D=3D=3D + +Overview +-------- + +Live full disk backups are preferred in many scenarios, *despite* their +space requirements. The following outlines an efficient method to do +that using libvirt's APIs. This method involves concepts: the notion of +`backing chains `_, +`QCOW2 overlays +`_, +and a special operation called "active block-commit", which allows +live-merging an overlay disk image into its backing file. + +At a high-level, this is the approach to take a live ful disk backup: +Assuming a guest with a single disk image, create a temporary live QCOW2 +overlay (commonly called as "external snapshot") to track the live guest +writes. Then backup the original disk image while the guest (live QEMU) +keeps writing to the temporary overlay. Finally, perform the "active +block-commit" opertion to live-merge the temporary overlay disk contents +into the original image =E2=80=94 i.e. the backing file =E2=80=94 and "piv= ot" the live +QEMU process to point to it. + +The below assumes you're using *at least* these versions (preferably +much newer): QEMU 2.1 and libvirt-1.2.9. + +Detailed procedure +------------------ + +1. Start with a guest with a single disk image, ``base.raw``, which is + where the live QEMU is pointing at, and recording the guest writes:: + + base.raw (live QEMU) + +2. List the current block device(s) in use:: + + $ virsh domblklist vm1 + Target Source + ------------------------------------------------ + vda /var/lib/libvirt/images/base.raw + +3. Create the live "external disk snapshot" (or more correctly, "an + overlay"):: + + $ virsh snapshot-create-as --domain vm1 overlay1 \ + --diskspec vda,file=3D/var/lib/libvirt/images/overlay1.qcow2 \ + --disk-only + + The disk image chain looks as follows:: + + base.raw <-- overlay1.qcow2 (live QEMU) + +.. note:: + Above, if you have QEMU guest agent installed in your virtual + machine, use the ``--quiesce`` option with ``virsh + snapshot-create-as [...]`` to ensure you have a consistent disk + state. + + Optionally, you can also supply the ``--no-metadata`` option to + ``virsh snapshot-create-as`` to tell libvirt not track the snapshot + metadata. Otherwise, when you decide to merge snapshot overlays, + you have to explicitly clean the libvirt metadata using ``virsh + snapshot-delete vm1 --metadata [name|--current]``. + +4. Now, take a backup the orignal image, ``base.raw``, to a different + location using ``cp`` or ``rsync``:: + + $ cp /var/lib/libvirt/images/base.raw + /export/backups/copy1_base.raw + + # Or: + + $ rsync -avhW --progress /var/lib/libvirt/images/base.raw \ + /export/backups/copy1_base.raw + +5. Enumerate the current block device(s) in use, again. Notice that the + current disk image in use is the above-created overlay, + ``overlay1.qcow2``:: + + $ virsh domblklist vm1 + Target Source + ------------------------------------------------ + vda vda,file=3D/var/lib/libvirt/images/overlay1.qcow2 + +6. Once the backup of the original image completes, now perform the + "active block-commit" to live-merge the contents of + ``overlay1.qcow2`` into ``base.raw`` *and* pivot the live QEMU back + to the original:: + + $ virsh blockcommit vm1 vda --active --verbose --pivot + +7. After the above operation completes, again list the current block + device(s) in use. And notice that the live QEMU is now writing to + the original base image:: + + $ virsh domblklist vm1 + Target Source + ------------------------------------------------ + vda /var/lib/libvirt/images/base.raw + + +The final updated disk image "chain" will be a single consolidated +disk:: + + [base.raw] (live QEMU) + + +Now you can safely **discard the overlay image**, ``overlay1.qcow2`` =E2= =80=94 +it is no longer valid; and its contents are now fully merged into the +base image. --=20 2.30.2 From nobody Fri Apr 19 01:31:39 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) client-ip=170.10.133.124; envelope-from=libvir-list-bounces@redhat.com; helo=us-smtp-delivery-124.mimecast.com; Authentication-Results: mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com ARC-Seal: i=1; a=rsa-sha256; t=1620145003; cv=none; d=zohomail.com; s=zohoarc; b=lQ7PZUrwvEU61CO0SSgDHaPvxcjm6jLT3xEmtjb2BbrCmWMvyZRgTLgI7RnNP4npVJIujVcRGH7e3z3t3RLWcbQ8LG53bTZiZMVXIR8pmUZeRzZmmmvkGw9Vwnw1ubXxGvgOngLG8uPXOrNH+Qo8MEgoASgM82K2/Qrhs9qR+Jo= ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=zohomail.com; s=zohoarc; t=1620145003; h=Content-Type:Content-Transfer-Encoding:Date:From:In-Reply-To:List-Subscribe:List-Post:List-Id:List-Archive:List-Help:List-Unsubscribe:MIME-Version:Message-ID:References:Sender:Subject:To; bh=89AFGFS2b9Tkt9XPLvpyN/wvGOlHyi1EkMQaKb/ujuI=; b=I1vhjlshy9PURhYHU62VybFOuoeLFlngHBamqmCBrYnn9L4Y2NaTfS+aZxkPlFXRwl3/raZQy8thjK58o2s9+kYqa1e5TFWy3otYpOp10EIYPtJEjOrVB/bfSmRE6axqX0cNFtqWxQdg9uL27hzvN960eo5dvAFQdtBgXv3LxxE= ARC-Authentication-Results: i=1; mx.zohomail.com; dkim=pass; spf=pass (zohomail.com: domain of redhat.com designates 170.10.133.124 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass header.from= (p=none dis=none) header.from= Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.133.124]) by mx.zohomail.com with SMTPS id 1620145003313861.2937092221698; Tue, 4 May 2021 09:16:43 -0700 (PDT) Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-450-rMbkjn08NL2I1MhNmRZoqw-1; Tue, 04 May 2021 12:16:39 -0400 Received: from smtp.corp.redhat.com (int-mx06.intmail.prod.int.phx2.redhat.com [10.5.11.16]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 9ED1580ED8B; Tue, 4 May 2021 16:16:33 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 77FDF5C238; Tue, 4 May 2021 16:16:33 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 3ACFF5534E; Tue, 4 May 2021 16:16:33 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.phx2.redhat.com [10.5.11.23]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id 144GGNZF026833 for ; Tue, 4 May 2021 12:16:23 -0400 Received: by smtp.corp.redhat.com (Postfix) id 385FA90BD; Tue, 4 May 2021 16:16:23 +0000 (UTC) Received: from localhost.localdomain (ovpn-113-176.ams2.redhat.com [10.36.113.176]) by smtp.corp.redhat.com (Postfix) with ESMTP id F3BF819C71; Tue, 4 May 2021 16:16:21 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1620145001; h=from:from:sender:sender:reply-to:subject:subject:date:date: message-id:message-id:to:to:cc:mime-version:mime-version: content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references:list-id:list-help: list-unsubscribe:list-subscribe:list-post; bh=89AFGFS2b9Tkt9XPLvpyN/wvGOlHyi1EkMQaKb/ujuI=; b=WOFrezomXeJ1cZ82sOrxdjyV5ED4XwLzFjY2s800ntevKn01rZig3NHG3X5v7e0p+f56xw swHOYL6ELOkDkeocCtZEOlHVRFZYDpZ646nZDWIeyuXa+IrESpbH902w32ke+hO1gtR72B hGWgzioe1Bqxx39vmfSPPnpat75Eqnc= X-MC-Unique: rMbkjn08NL2I1MhNmRZoqw-1 From: Kashyap Chamarthy To: libvir-list@redhat.com Subject: [libvirt PATCH 2/2] docs: kbase: Add a doc on merging disk image chains Date: Tue, 4 May 2021 18:16:13 +0200 Message-Id: <20210504161613.159831-3-kchamart@redhat.com> In-Reply-To: <20210504161613.159831-1-kchamart@redhat.com> References: <20210504161613.159831-1-kchamart@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.84 on 10.5.11.23 X-loop: libvir-list@redhat.com X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.16 Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=libvir-list-bounces@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable X-ZohoMail-DKIM: pass (identity @redhat.com) This is a rewrite of: https://wiki.libvirt.org/page/Live-merge-an-entire-disk-image-chain-inc= luding-current-active-disk Once this commit merges, the above wiki should point to this kbase document. Signed-off-by: Kashyap Chamarthy --- docs/kbase/index.rst | 3 + docs/kbase/merging_disk_image_chains.rst | 197 +++++++++++++++++++++++ 2 files changed, 200 insertions(+) create mode 100644 docs/kbase/merging_disk_image_chains.rst diff --git a/docs/kbase/index.rst b/docs/kbase/index.rst index 5ee3b5fce8..8e8d959e92 100644 --- a/docs/kbase/index.rst +++ b/docs/kbase/index.rst @@ -15,6 +15,9 @@ Usage `Live full disk backup `__ A walkthrough of how to take effective live full disk backups. =20 +`Merging disk image chains `__ + Ways to reduce or consolidate disk image chains. + `Virtio-FS `__ Share a filesystem between the guest and the host =20 diff --git a/docs/kbase/merging_disk_image_chains.rst b/docs/kbase/merging_= disk_image_chains.rst new file mode 100644 index 0000000000..07732c4e0d --- /dev/null +++ b/docs/kbase/merging_disk_image_chains.rst @@ -0,0 +1,197 @@ +Merging disk image image chains +=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=3D=3D=3D=3D=3D=3D + +Context +------- + +Sometimes a `disk image chain +`_ can get long and +cumbersome. For the purpose of illustration, consider this smaller disk +image chain:: + + base.raw <-- a.qcow2 <-- b.qcow2 <-- c.qcow2 (live QEMU) + +You may want to reduce the backing chain length, or consolidate *all* +the disk images in the chain into a single image. But you want to +accomplish this *without* incurring guest down time. Here's how to go +about it. + +The same principles used in the `live full disk backup +` document are +used here too. + +Reducing the disk image chain length +------------------------------------ + +Starting the earlier image chain:: + + base.raw <-- a.qcow2 <-- b.qcow2 <-- c.qcow2 (live QEMU) + +Reduce the length of the chain by two images, with the resulting chain +being:: + + base.raw <-- c.qcow2 (live QEMU) + +Where the ``base.raw`` contains the contents of ``a.qcow2`` and +``b.qcow2``. + +1. Start by listing the current active disk image in use:: + + $ virsh domblklist vm1 + Target Source + ------------------------------------------------ + vda /var/lib/libvirt/images/base.raw + +2. Create the image chain by creating three QCOW2 overlays (or "external + snapshots") on top of each other, while adding some differentiating + content in each image:: + + $ virsh snapshot-create-as --domain vm1 snap1 \ + --diskspec vda,file=3D/var/lib/libvirt/images/a.qcow2 \ + --disk-only --no-metadata + + # + + $ virsh snapshot-create-as --domain vm1 snap2 \ + --diskspec vda,file=3D/var/lib/libvirt/images/b.qcow2 \ + --disk-only --no-metadata + + # + + $ virsh snapshot-create-as --domain vm1 snap3 \ + --diskspec vda,file=3D/var/lib/libvirt/images/c.qcow2 \ + --disk-only --no-metadata + +3. Enumerate the backing file chain (here the ``force-share`` option + simply allows ``qemu-img`` to safely query the disk image status + while it is active) :: + + $ qemu-img info --force-share --backing-chain /var/lib/libvirt/images/= cur.qcow2 + [...] + +4. Again, list the current active disk image in use:: + + $ virsh domblklist vm1 + Target Source + ------------------------------------------------ + vda /var/lib/libvirt/images/c.qcow2 + +5. Perform the "block-commit" by specify the "base" and "top" images, + i.e. merge the contents of ``b.qcow2`` *and* ``a.qcow2`` into + ``base.raw``, *and* :: + + $ virsh blockcommit vm1 vda \ + --base=3D/var/lib/libvirt/images/base.raw + --top=3D/var/lib/libvirt/images/b.qcow2 + +A note on accessing 'base' and 'top' images +~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ + +Specifying file paths, as above, make sense when your disks are in the +local filesystem. However, when using more complicated setups such as +network block device (NBD) disks, there are no file paths. Hhere is +where accessing the disk by its index number comes into picture. + +As an example, the below is the ```` element of the guest XML for +with the original disk image chain of four images:: + + ... + + + + + + + + + + + + + + + + + + +
+ + ... + +And we can merge the images ``a.qcow2`` and ``b.qcow2`` into +``base.qcow2`` using the index numbers 1 (for ``base.qcow2``) and :: + + $> virsh blockcommit vm1 vda --base=3D'vda[1]' --top=3D'vda[3]' + +Note that the shell quoting is necessary here, since unquoted ``[1]`` +would do an unexpected shell "globbing" (i.e. file name expansion) if +you have a file '1' in the current directory + +Accessing the disk images via their index numbers is more useful when +you're using blockCommit() API programmatically. + + +Consolidating the entire chain into a single image +-------------------------------------------------- + +Again, starting the original image chain:: + + base.raw <-- a.qcow2 <-- b.qcow2 <-- c.qcow2 (live QEMU) + +Reduce the length of the chain by two images, with the resulting chain +being:: + + base.raw (live QEMU) + +Where the ``base.raw`` contains the contents of ``a.qcow2``, ``b.qcow2`` +and ``c.qcow2``; *and* the live QEMU is piovoted to point to the +``base.raw``. + + +1. Use the same procedure discussed earlier to create the disk image + chain. + + +2. Now perform the "active block-commit" operation:: + + $ virsh blockcommit vm1 vda --verbose --pivot --active + Block Commit: [100 %] + Successfully pivoted + + Notes: + + - ``--active``: It performs a two-stage operation: first, the contents + from top images (``a.qcow2``, ``b.qcow2``, and ``c.qcow2``) are + committed into the base image; and in the second stage, the the + "block-commit" operation remains awake to synchronize any further + changes from top images into base. Here the user can take two + actions: cancel the job, or pivot the job, i.e. adjust the base + image as the current active image. + + - ``--pivot``: Once data is committed from sn1, sn2 and current into + base, it pivots the live QEMU to use base as the active image. + + - ``--verbose``: It shows the progress of block operation. + + +3. Again, check the current active block device in use:: + + $ virsh domblklist vm1 + Target Source + ------------------------------------------------ + vda /var/lib/libvirt/images/base.raw + + +4. Enumerate the backing file chain:: + + $ qemu-img info --backing-chain /var/lib/libvirt/images/base.raw + [...] + + And the final resulting disk image "chain" will be a single, + consolidated disk image:: + + [base] (live QEMU) + +It is worth bearing in mind that once the above pivot completes, *all* +three overlay files =E2=80=94 ``a.qcow2``, ``b.qcow2``, and ``c.qcow2`` = =E2=80=94 are no +longer valid, and can be safely discarded. --=20 2.30.2