vmware / govmomi

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

How to expand a block storage by methods.ExpandVmfsDatastore? #3452

Open jiangbo202 opened 1 month ago

jiangbo202 commented 1 month ago

I want to expand a block storage that is currently in use through "methods.ExpandVmfsDatastore".

Actual testing found that it is necessary to specify the "EndSection" after expansion But I couldn't find how to get the "EndSection" after expansion.

I can obtain the last sectors on esxi by using the command "partedUtil getUsableSectors"/vmfs/devices/disks/naa.600a0980383047526e3f4c6c31625xxx".

I tried using "methods. ComputeDiskPartitionInfoForResize" and the result was "Returnval.Spec.Partition[0].EndSector", but what I got was the last sections before the expansion, not the last sections after the expansion.

If I directly use the "EndSection" before expansion, an error message will appear: "ServerFaultCode: Cannot change the host configuration."

I generated code by enabling developer mode on the vmware page, and the EndSection was set directly in the result. I don't know where to obtain it, as shown in the figure

image
github-actions[bot] commented 1 month ago

Howdy 🖐   jiangbo202 ! Thank you for your interest in this project. We value your feedback and will respond soon.

If you want to contribute to this project, please make yourself familiar with the CONTRIBUTION guidelines.