Max VM Disk Size?

Harvester uses Longhorn for its Storage. The Space Configuration Suggestions for Volumes section [1] has the following formula:

A general estimation for the maximum space consumption of a volume is

(N + 1) x head/snapshot average actual size

My understanding is that even if you had 0 snapshots, there are still temporary snapshots created for rebuilding the volumes. So the worse case situation for a full volume would be 3x the actual size for a single replica.

From the Longhorn docs [1]:

  • The worst case that leads to so much space usage:
    1. At some point the 1st rebuilding/expansion is triggered, which leads to the 1st system snapshot creation.
      • The purges before and after the 1st rebuilding does nothing.
    2. There is data written to the new volume head, and the 2nd rebuilding/expansion somehow is triggered.
      • The snapshot purge before the 2nd rebuilding may lead to the shrink of the 1st system snapshot.
      • Then the 2nd system snapshot is created and the rebuilding is started.
      • After the rebuilding done, the subsequent snapshot purge would lead to the coalescing of the 2 system snapshots. This coalescing requires temporary space.
  1. During the afterward snapshot purging for the 2nd rebuilding, there is more data written to the new volume head.
  • The explanation of the formula:
    • The 1st 1 means the volume head.
    • The 2nd 1 is the second system snapshot mentioned in the worst case.
    • The 3rd 1 is for the temporary space that may be required by the 2 system snapshot purge/coalescing.

If you were planning to avoid a worse case scenario with a single full VM volume (bit of an edge caes I think), I would guess you can consider 2.5 TB as a safe maximum.

[1] https://longhorn.io/docs/1.9.1/nodes-and-volumes/volumes/volume-size/#space-configuration-suggestions-for-volumes

1 Like