vmware / govmomi

Go library for the VMware vSphere API
Apache License 2.0
2.26k stars 896 forks source link

api: Add ExtendVirtualDisk method on VirtualDiskManager #3479

Closed spacegospod closed 1 day ago

spacegospod commented 2 days ago

Description

Adding a binding for extendVirtualDisk on VirtualDiskManager.

https://github.com/hashicorp/terraform-provider-vsphere/issues/851

Type of change

Please mark options that are relevant:

How Has This Been Tested?

Extended the tests for virtual_disk_manager.go with new scenarios that cover 1.[POSITIVE] Extending a disk 2.[NEGATIVE] Attempting to shrink a disk 3.[NEGATIVE] Attempting to extend a disk that does not exist

The simulation for virtual disks did not include metadata for the disk size. I've modified it so that it writes the size value (in KB) in the file itself.

Manually verified the same scenarios on a real VMDK.

Checklist:

spacegospod commented 1 day ago

Thanks @spacegospod , lgtm. Although, VirtualDiskManager has been deprecated for quite some time. Has TF considered switching to First Class Disks (aka VStorageObjectManager) ? That'd be ExtendDisk in this case.

Hey @dougm I will try switching the TF provider to VStorageObjectManager. Lets still have this merged, just as a back up