Files
ProxmoxVE/misc
CanbiZ (MickLesk) 6b249d9533 feat(vm): add smart recovery for VM creation failures (Phase 1-3)
Adds error classification, recovery menu, and retry mechanism for VM
creation failures in docker-vm.sh.

vm-core.func:
- vm_classify_error(): classifies errors into 7 categories
  (download, disk_import, virt_customize, vmid_conflict,
   storage_full, network, unknown)
- is_vm_download_error(), is_vm_disk_import_error(),
  is_vm_virt_customize_error(), is_vm_vmid_conflict(),
  is_vm_storage_full(), is_vm_network_error(): detection helpers
- vm_show_recovery_menu(): dynamic whiptail menu with options
  based on error category (retry, retry w/ settings, skip
  virt-customize, new VMID, keep VM, abort)
- vm_handle_recovery(): orchestrates classification, menu, and
  chosen action (cleanup + retry / keep / abort)
- vm_log_cmd(): stderr capture wrapper for VM_ERROR_LOG
- VM_MAX_RETRIES=2 (bounded recursion depth)

docker-vm.sh:
- Wrapped VM creation in create_vm() function for retry
- error_handler(): during VM_CREATION_PHASE, delegates to
  vm_handle_recovery; on retry, temporarily disables ERR trap,
  re-invokes create_vm recursively (bounded by VM_MAX_RETRIES)
- SKIP_VIRT_CUSTOMIZE flag: virt-customize failure recovery
  can skip it and use first-boot Docker install fallback
- Critical commands (qm create, disk import) now capture
  stderr to VM_ERROR_LOG for error classification
2026-02-16 18:49:53 +01:00
..