Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-0.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id C2582C4360C for ; Tue, 8 Oct 2019 18:09:14 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id A5CBA21721 for ; Tue, 8 Oct 2019 18:09:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1729426AbfJHSJN (ORCPT ); Tue, 8 Oct 2019 14:09:13 -0400 Received: from mail1.tango.lu ([212.66.75.102]:42473 "EHLO mail.tango.lu" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726439AbfJHSJN (ORCPT ); Tue, 8 Oct 2019 14:09:13 -0400 X-Greylist: delayed 480 seconds by postgrey-1.27 at vger.kernel.org; Tue, 08 Oct 2019 14:09:12 EDT Received: from mail.tango.lu (localhost [127.0.0.1]) by mail.tango.lu (Postfix) with ESMTP id F3B00382FC2 for ; Tue, 8 Oct 2019 20:01:11 +0200 (CEST) MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit Date: Tue, 08 Oct 2019 20:01:11 +0200 From: freebsd@tango.lu To: kvm@vger.kernel.org Subject: Easy way to track Qcow2 space consumption Message-ID: X-Sender: freebsd@tango.lu User-Agent: Roundcube Webmail/1.2.0 X-Virus-Scanned: clamav-milter 0.98.7 at mail.tango.lu X-Virus-Status: Clean Sender: kvm-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: kvm@vger.kernel.org Hello List, I'm using a fairly old KVM version ii pve-qemu-kvm 2.2-28 amd64 Full virtualization on x86 hardware don't see much point upgrading either since everything works but I could still use a feature to keep track of the actual space used by the VMs without SSHing into all of them and doing a df -h. The VM images (especially the DBs with high rw operation will just grow and grow with time), for this to free up space the standard process was: 1, Zero-fill the drive (dd if=/dev/zero of=/some/file until you run out of space) 1B, sdelete -z c: < windows VM 2, Shut down the VM 3, cd to where the images for the VM are kept and run qemu-img convert -O qcow2 original_image.qcow2 deduplicated_image.qcow2 I wonder if there were any improvements done in the KVM for addressing this space issue. A lot of us using qcow2 because it's easier to backup due to the small size (eg: a basic configured webserver might only uses 3-4 Gb vs a 40GB preallocated empty image full of 0s). Thanks.