From 551cbbaf03e82320f4be602147e682fa04fd4ea6 Mon Sep 17 00:00:00 2001 From: Julian Einwag Date: Mon, 10 Jul 2023 06:10:01 +0000 Subject: [PATCH] use correct value for discard parameter when disabled --- builder/proxmox/common/step_start_vm.go | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/builder/proxmox/common/step_start_vm.go b/builder/proxmox/common/step_start_vm.go index 6d6e2336..0d448eca 100644 --- a/builder/proxmox/common/step_start_vm.go +++ b/builder/proxmox/common/step_start_vm.go @@ -287,12 +287,12 @@ func generateProxmoxDisks(disks []diskConfig) proxmox.QemuDevices { if devs[idx]["type"] == "scsi" || devs[idx]["type"] == "virtio" { setDeviceParamIfDefined(devs[idx], "iothread", strconv.FormatBool(disks[idx].IOThread)) } - // Proxmox API expects the value of discard to be either "off" or "on" + // Proxmox API expects the value of discard to be either "on" or "ignore" setDeviceParamIfDefined(devs[idx], "discard", func() string { if disks[idx].Discard { return "on" } - return "off" + return "ignore" }()) setDeviceParamIfDefined(devs[idx], "ssd", strconv.FormatBool(disks[idx].IOThread)) }