diff --git a/CHANGELOG.md b/CHANGELOG.md index e9b07add6..d56079a4c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,14 @@ # +## 2.8.2 (Not Released) + +BUG FIX: + +* `resource/virtual_machine`: Fixes overflow for the disk sub-resource when running a 32-bit version + of the provider .Modified the call to `GiBToByte` by passing the parameter as `int64` which forces the + function to go through the 64bit case. + ([#2200](https://github.com/terraform-providers/terraform-provider-vsphere/pull/2200)) + ## 2.8.1 (May 08, 2024) BUG FIX: diff --git a/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go b/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go index 3054dc909..77e02cb7e 100644 --- a/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go +++ b/vsphere/internal/virtualdevice/virtual_machine_disk_subresource.go @@ -1858,7 +1858,7 @@ func (r *DiskSubresource) expandDiskSettings(disk *types.VirtualDisk) error { if os.(int) > ns.(int) { return fmt.Errorf("virtual disks cannot be shrunk") } - disk.CapacityInBytes = structure.GiBToByte(ns.(int)) + disk.CapacityInBytes = structure.GiBToByte(int64(ns.(int))) disk.CapacityInKB = disk.CapacityInBytes / 1024 }