Skip to content

Commit fd15cdb

Browse files
fix: change vm disk devices limit to constant
Signed-off-by: Justas Umbrasas <justas.umbrasas@hostinger.com>
1 parent 1bc0794 commit fd15cdb

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

proxmoxtf/resource/vm/disk/schema.go

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,10 @@ const (
2222
dvDiskDiscard = "ignore"
2323
dvDiskCache = "none"
2424

25+
// see /usr/share/perl5/PVE/QemuServer/Drive.pm
26+
// Using SCSI limit (31) as the highest value (IDE: 4, SCSI: 31, VirtIO: 16, SATA: 6).
27+
maxResourceVirtualEnvironmentVMDiskDevices = 31
28+
2529
// MkDisk is the name of the disk resource.
2630
MkDisk = "disk"
2731
mkDiskAIO = "aio"
@@ -271,7 +275,7 @@ func Schema() map[string]*schema.Schema {
271275
},
272276
},
273277
},
274-
MaxItems: 31,
278+
MaxItems: maxResourceVirtualEnvironmentVMDiskDevices,
275279
MinItems: 0,
276280
},
277281
}

0 commit comments

Comments
 (0)