xfs migration - skip on nvidia failure

This commit is contained in:
clore 2025-01-03 17:39:47 +00:00
parent 777365adf8
commit 76bc70ad56
1 changed files with 6 additions and 1 deletions

View File

@ -59,7 +59,7 @@ def get_to_use_storage_values(max_free_space):
else:
return GENERIC_LEAVE_FREE_SPACE_MB, GENERIC_MIN_XFS_PARTITION_SIZE
else:
return None, None
return "no-gpus", "no-gpus"
except Exception as e:
return None, None
@ -105,6 +105,9 @@ def migrate():
max_free_space = utils.get_free_space_mb('/') + utils.get_directory_size_mb(DOCKER_ROOT)
leave_free_space, min_xfs_size = get_to_use_storage_values(max_free_space)
if leave_free_space == "no-gpus":
return "nvidia-failure"
if leave_free_space == None:
migrate_log("can't get free space")
return "failure"
@ -247,6 +250,8 @@ def init():
with open(XFS_STATE_FILE, 'w') as file:
file.write("not-supported-boot-device")
return 'failed'
elif migarion_status == "nvidia-failure":
return 'failed'
else:
with open(XFS_STATE_FILE, 'w') as file:
file.write("failed-migration")