0
0
mirror of https://github.com/bpg/terraform-provider-proxmox.git synced 2025-06-30 02:31:10 +00:00

fix(vm): Fix file_format setting for new empty disks (#259)

This commit is contained in:
Pavel Boldyrev 2023-03-13 23:45:08 -04:00 committed by GitHub
parent 5b9e6eba05
commit d29fd97bab
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 6 additions and 0 deletions

View File

@ -1075,6 +1075,10 @@ func (r CustomStorageDevice) EncodeValues(key string, v *url.Values) error {
values = append(values, fmt.Sprintf("mbps_wr_max=%d", *r.BurstableWriteSpeedMbps))
}
if r.Format != nil {
values = append(values, fmt.Sprintf("format=%s", *r.Format))
}
if r.MaxReadSpeedMbps != nil {
values = append(values, fmt.Sprintf("mbps_rd=%d", *r.MaxReadSpeedMbps))
}

View File

@ -2442,6 +2442,7 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(
block := diskEntry.(map[string]interface{})
datastoreID, _ := block[mkResourceVirtualEnvironmentVMDiskDatastoreID].(string)
fileFormat, _ := block[mkResourceVirtualEnvironmentVMDiskFileFormat].(string)
fileID, _ := block[mkResourceVirtualEnvironmentVMDiskFileID].(string)
size, _ := block[mkResourceVirtualEnvironmentVMDiskSize].(int)
diskInterface, _ := block[mkResourceVirtualEnvironmentVMDiskInterface].(string)
@ -2468,6 +2469,7 @@ func resourceVirtualEnvironmentVMGetDiskDeviceObjects(
diskDevice.ID = &datastoreID
diskDevice.Interface = &diskInterface
diskDevice.Format = &fileFormat
diskDevice.FileID = &fileID
sizeString := fmt.Sprintf("%dG", size)
diskDevice.Size = &sizeString