From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 5F36866228 for ; Thu, 5 Nov 2020 17:06:59 +0100 (CET) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 5D51B1A790 for ; Thu, 5 Nov 2020 17:06:59 +0100 (CET) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [212.186.127.180]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id C7D701A77E for ; Thu, 5 Nov 2020 17:06:55 +0100 (CET) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id 934DB46038 for ; Thu, 5 Nov 2020 17:06:55 +0100 (CET) From: Stoiko Ivanov To: pve-devel@lists.proxmox.com Date: Thu, 5 Nov 2020 17:06:28 +0100 Message-Id: <20201105160631.26834-1-s.ivanov@proxmox.com> X-Mailer: git-send-email 2.20.1 MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.097 Adjusted score from AWL reputation of From: address KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment RCVD_IN_DNSWL_MED -2.3 Sender listed at https://www.dnswl.org/, medium trust SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [plugin.pm, rbdplugin.pm, snapshot-test.pm, config.pm, storage.pm, lxc.pm, tools.pm] Subject: [pve-devel] [PATCH common/storage/container] add fsfreeze/thaw for rbd snapshots X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 05 Nov 2020 16:06:59 -0000 this patchset addresses #2991 and #2528. As discussed in #2991 (and off-list with Wolfgang B. and Dominik) - it does not address the fundamental problem of the snapshot being created outside of the open krbd block-device, by an independend 'rbd' call (which is most likely the reason for the inconsistency). However according to the reporter in #2991 it does help in their case to actually get backups of their containers. I put the ioctl call inside sync_container_namespace since it: * should happen shortly after the syncfs call * needs to happen inside the container's mount namespace (else we'd need to mount the filesystem in order to freeze/thaw it - see the proposed patch in #2528) and I wanted to avoid to fork+nsenter for each volume twice (in __snapshot_create_vol_snapshs_hook) Would be grateful for feedback if this approach is ok (reading containerconfig + storage config in __snapshot_freeze) or if some other way would be nicer. Tested on my testsetup with a ceph-backed container (and 2 additional mountpoints (one ceph, one on LVM thin). pve-common: Stoiko Ivanov (1): add fsfreeze helper: src/PVE/Tools.pm | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) pve-storage: Stoiko Ivanov (1): add check for fsfreeze before snapshot PVE/Storage.pm | 12 ++++++++++++ PVE/Storage/Plugin.pm | 4 ++++ PVE/Storage/RBDPlugin.pm | 5 +++++ 3 files changed, 21 insertions(+) pve-container: Stoiko Ivanov (1): snapshot creation: fsfreeze mountpoints, if needed src/PVE/LXC.pm | 21 +++++++++++++++++---- src/PVE/LXC/Config.pm | 15 ++++++++++++++- src/test/snapshot-test.pm | 12 +++++++++++- 3 files changed, 42 insertions(+), 6 deletions(-) -- 2.20.1