VMware {code} Community
jeremyb
Contributor
Contributor

Using ConverterStorageParams.resizeRatio

Anyone have experience using "ConverterStorageParams.resizeRatio"?

I am trying to automate a P2V for a physical machine that has 1 TB of (available) local storage with only about 30 GB used. I am wanting to create the VM with a hard disk of USED + 20% where in this case it would come out at 36 GB.

Any help would be very much appreciated.

Thanks!

0 Kudos
1 Reply
ivivanov
Expert
Expert

I have not tried this feature, but looking at the code it looks like it does exactly what you need:


resizeRatio = storageParams.resizeRatio;
resizedVolumeCapacityInBytes = sourceVolumeInfo.spaceUsedInBytes *(1 + resizeRatio / 100.);
if (storageParams.minVolumeSize > resizedVolumeCapacityInBytes) {
   resizedVolumeCapacityInBytes = storageParams.minVolumeSize;
}
newVolumeCapacityInBytes = (resizedVolumeCapacityInBytes < sourceVolumeCapacityInBytes) ?
   resizedVolumeCapacityInBytes : sourceVolumeCapacityInBytes

Description of resizeRatio option can be found in Converter API Reference at https://www.vmware.com/support/developer/converter-sdk/conv50_apireference/index.html. The description is pretty much matching the code. In order for this to work you need to keep volumesToClone unset. Have you tried it and actually observed it is not working? You also have an option to directly specify the new desired target disk size in newCapacityInBytes property together with resize flag in ConverterStorageParamsVolumeCloningParams type, however if you use this approach you need to provide VolumeCloningParams entry for each volume you want to transfer in volumesToClone array (if you specify just one volume, only it will be copied).

__________
It is worse!
0 Kudos