From 442b60c8f984ec2aed9e5ed29e0ac66735dd801e Mon Sep 17 00:00:00 2001 From: Pavel Boldyrev <627562+bpg@users.noreply.github.com> Date: Fri, 29 Jul 2022 21:54:58 -0400 Subject: [PATCH] Fix storing of "disk.iothread" in TF state Add missing doc entry Relates to #87 --- docs/resources/virtual_environment_vm.md | 1 + proxmoxtf/resource_virtual_environment_vm.go | 6 ++++++ 2 files changed, 7 insertions(+) diff --git a/docs/resources/virtual_environment_vm.md b/docs/resources/virtual_environment_vm.md index 1e93cbfa..64ce3c7a 100644 --- a/docs/resources/virtual_environment_vm.md +++ b/docs/resources/virtual_environment_vm.md @@ -195,6 +195,7 @@ output "ubuntu_vm_public_key" { * `read_burstable` - (Optional) The maximum burstable read speed in megabytes per second. * `write` - (Optional) The maximum write speed in megabytes per second. * `write_burstable` - (Optional) The maximum burstable write speed in megabytes per second. + * `iothread` - (Optional) Whether to use iothreads for this disk (defaults to `false`). * `initialization` - (Optional) The cloud-init configuration. * `datastore_id` - (Optional) The identifier for the datastore to create the cloud-init disk in (defaults to `local-lvm`). diff --git a/proxmoxtf/resource_virtual_environment_vm.go b/proxmoxtf/resource_virtual_environment_vm.go index a263d18b..6dbdc6a9 100644 --- a/proxmoxtf/resource_virtual_environment_vm.go +++ b/proxmoxtf/resource_virtual_environment_vm.go @@ -2619,6 +2619,12 @@ func resourceVirtualEnvironmentVMReadCustom(ctx context.Context, d *schema.Resou disk[mkResourceVirtualEnvironmentVMDiskSpeed] = []interface{}{} } + if dd.IOThread != nil { + disk[mkResourceVirtualEnvironmentVMDiskIOThread] = *dd.IOThread + } else { + disk[mkResourceVirtualEnvironmentVMDiskIOThread] = false + } + diskMap[di] = disk }