From 0b5f5a3848b698f2e5af8f3ed310d85f75ac7ec7 Mon Sep 17 00:00:00 2001 From: Florent BEAUCHAMP Date: Mon, 30 Oct 2023 15:28:04 +0100 Subject: [PATCH] fix(backups): use VDI virtual_size instead of physical_size `physical_size` appears to be broken --- @xen-orchestra/backups/_runners/_vmRunners/FullXapi.mjs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/@xen-orchestra/backups/_runners/_vmRunners/FullXapi.mjs b/@xen-orchestra/backups/_runners/_vmRunners/FullXapi.mjs index 10d22d6fe45..a75c058746e 100644 --- a/@xen-orchestra/backups/_runners/_vmRunners/FullXapi.mjs +++ b/@xen-orchestra/backups/_runners/_vmRunners/FullXapi.mjs @@ -41,9 +41,10 @@ export const FullXapi = class FullXapiVmBackupRunner extends AbstractXapi { for (const vdiRef of vdis) { const vdi = await this._xapi.getRecord('VDI', vdiRef) - // at most the xva will take the physical usage of the disk - // the resulting stream can be smaller due to the smaller block size for xva than vhd, and compression of xcp-ng - maxStreamLength += vdi.physical_utilisation + // the size a of fully allocated vdi will be virtual_size exaclty, it's a gross over evaluation + // of the real stream size in general, since a disk is never completly full + // vdi.physical_size seems to underevaluate a lot the real disk usage of a VDI, as of 2023-10-30 + maxStreamLength += vdi.virtual_size } const sizeContainer = watchStreamSize(stream)