From 059fc57896d4c345f9a09f9682171d3ee104d5cc Mon Sep 17 00:00:00 2001 From: v0l Date: Tue, 23 Jun 2026 14:35:10 +0100 Subject: [PATCH] fix(reinstall): remove redundant disk resize causing 500 The reinstall pipeline ran import_template_disk (which already imports AND resizes the primary disk to the template size) followed by a separate resize_disk step. The second resize asks Proxmox to resize to the same size, which it rejects as a disallowed shrink, surfacing as a generic 500. Removes the redundant resize_disk step, restoring the original pre-pipeline reinstall behaviour. Fixes #142 --- lnvps_api/src/api/routes.rs | 10 ++++------ 1 file changed, 4 insertions(+), 6 deletions(-) diff --git a/lnvps_api/src/api/routes.rs b/lnvps_api/src/api/routes.rs index eec090e..38aa0b8 100644 --- a/lnvps_api/src/api/routes.rs +++ b/lnvps_api/src/api/routes.rs @@ -857,16 +857,14 @@ async fn v1_reinstall_vm( }) .step("import_template_disk", |ctx| { Box::pin(async move { + // import_template_disk already imports AND resizes the primary + // disk to the template size; a separate resize step here would + // ask Proxmox to resize to the same size, which it rejects as a + // disallowed shrink and surfaces as a 500 (see issue #142). info!("Importing template disk for VM {}", ctx.vm_id); ctx.client.import_template_disk(&ctx.info).await }) }) - .step("resize_disk", |ctx| { - Box::pin(async move { - info!("Resizing disk for VM {}", ctx.vm_id); - ctx.client.resize_disk(&ctx.info).await - }) - }) .step("start_vm", |ctx| { Box::pin(async move { info!("Starting VM {} after reinstall", ctx.vm_id);