Skip to content

Commit

Permalink
fix(backups): use VDI virtual_size instead of physical_size
Browse files Browse the repository at this point in the history
`physical_size` appears to be broken
  • Loading branch information
fbeauchamp authored and julien-f committed Oct 30, 2023
1 parent 2b1ee3b commit 0b5f5a3
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions @xen-orchestra/backups/_runners/_vmRunners/FullXapi.mjs
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 0b5f5a3

Please sign in to comment.