Skip to content

Commit

Permalink
use correct value for discard parameter when disabled
Browse files Browse the repository at this point in the history
  • Loading branch information
jeinwag committed Jul 10, 2023
1 parent 201cf6a commit 551cbba
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions builder/proxmox/common/step_start_vm.go
Original file line number Diff line number Diff line change
Expand Up @@ -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))
}
Expand Down

0 comments on commit 551cbba

Please sign in to comment.