Skip to content

Commit c10d8f4

Browse files
olethanhnesitor
authored andcommitted
Fix disk usage calculation being to small
Wrong unit was used
1 parent 675943a commit c10d8f4

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

src/aleph/vm/pool.py

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -105,8 +105,9 @@ def teardown(self) -> None:
105105
def calculate_available_disk(self):
106106
"""Disk available for the creation of new VM.
107107
108-
This take into account the disk request (but not used) for Volume of executions in the pool"""
109-
free_space = shutil.disk_usage(str(settings.PERSISTENT_VOLUMES_DIR)).free // 1000
108+
This take into account the disk request (but not used) for Volume of executions in the pool
109+
Result in bytes."""
110+
free_space = shutil.disk_usage(str(settings.PERSISTENT_VOLUMES_DIR)).free
110111
# Free disk space reported by system
111112

112113
# Calculate the reservation
@@ -115,7 +116,7 @@ def calculate_available_disk(self):
115116
if not execution.resources:
116117
continue
117118
delta = execution.resources.get_disk_usage_delta()
118-
logger.warning("Disk usage delta: %d for %s", delta, execution.vm_hash)
119+
logger.debug("Disk usage delta: %d for %s", delta, execution.vm_hash)
119120
total_delta += delta
120121
available_space = free_space - total_delta
121122
logger.info(

0 commit comments

Comments
 (0)