VMware {code} Community
j_a_y
Contributor
Contributor

Storage resize converterStorageParams.resizeRatio is ignored

Hi,

I am trying to use the parameters resizeRatio and minVolumeSize to increase the size of the virtual disks during the conversion process.

http://www.vmware.com/support/developer/converter-sdk/conv50_apireference/converter.params.StoragePa...

They are in the object converterStorageParams.

But these parameters are ignored all the time. I do not know why. They appear in the vmware-converter-worker.log so they are submitted correctly. But the storage is not resized. In the storagemapping section resize is always on false.

The manual says:

Specifies the virtual volume resize ratio.  If a non-zero value is set and volumesToClone is unset,  all virtual volumes will be resized to  min(volume capacity,      max(minVolumeSize, volume used space * (1 + resizeRatio / 100)))

volumesToClone is not set as you see below.

I am using Windows 2003 and Windows 2008 VMs with NTFS on the VMDKs.

Does anyone managed to get the resizeRatio working?

My code:

private ConverterCloningParams
        BuildCloningParams()
        {
            ConverterCloningParams cloningParams = new ConverterCloningParams(

            ConverterTargetVmSpec targetVMSpec = new ConverterTargetVmSpec();
            targetVMSpec.name = _vcVMToCreate;
            targetVMSpec.location = BuildTargetVMLocation();
            targetVMSpec.productVersion = "PRODUCT_MANAGED";

            cloningParams.target = targetVMSpec;

            ConverterStorageParams converterStorageParams = new ConverterStorageParams();
            converterStorageParams.cloningMode = "volumeBasedCloning";
            converterStorageParams.vmxDatastoreName = _destdatastore;
            converterStorageParams.diskControllerType = "keepSource";
            converterStorageParams.optimizedPartitionAlignment = true;
            converterStorageParams.optimizedPartitionAlignmentSpecified = true;
         
           converterStorageParams.resizeRatio = 30;
            converterStorageParams.resizeRatioSpecified = true;
            converterStorageParams.minVolumeSize = 38162185216;
            converterStorageParams.minVolumeSizeSpecified = true;

          
            cloningParams.storageParams = converterStorageParams;
            ConverterBasicHardwareParams hardwareParams = new ConverterBasicHardwareParams();

            ConverterNetworkParams networkParams = new ConverterNetworkParams();
            networkParams.preserveNicCount = true;
            networkParams.preserveNicCountSpecified = true;
            networkParams.preserveNicMapping = true;
            networkParams.preserveNicMappingSpecified = true;
            cloningParams.networkParams = networkParams;

            cloningParams.basicHardwareParams = hardwareParams;
           

            return cloningParams;
        }

vmware-converter-worker.log

-->       storageParams = (converter.params.StorageParams) {
-->          dynamicType = <unset>,
-->          cloningMode = "volumeBasedCloning",
-->          diskControllerType = "keepSource",
-->          skipUnwantedFiles = <unset>,
-->          useBitmapDriver = <unset>,
-->          intermediateImage = <unset>,
-->          modifiedClustersOnly = <unset>,
-->          vmxDatastoreName = "_prod_vf-esx3_NFS1",
-->          resizeRatio = 30,
-->          minVolumeSize = 38162185216,

-->          optimizedPartitionAlignment = true,
-->       },

-->    storageMapping = (converter.agent.params.StorageMapping) {
-->       dynamicType = <unset>,
-->       volumeMapping = (converter.agent.params.StorageMapping.VolumeMapping) [
-->          (converter.agent.params.StorageMapping.VolumeMapping) {
-->             dynamicType = <unset>,
-->             sourceVolumeId = "3+<+3+<+00>7000000000000",
-->             targetVolumeId = "3+<+3+<+0000010000000000",
-->             resizeRequested = false,
-->             clusterSizeInBytes = <unset>,
-->          },
-->          (converter.agent.params.StorageMapping.VolumeMapping) {
-->             dynamicType = <unset>,
-->             sourceVolumeId = "44=494?4:39444:32.65249267:):)348)710*57969(4,26",
-->             targetVolumeId = ":,:4:+6-0000020000000000",
-->             resizeRequested = false,
-->             clusterSizeInBytes = <unset>,
-->          }
-->       ],
-->       diskMapping = (converter.agent.params.StorageMapping.DiskMapping) [
-->          (converter.agent.params.StorageMapping.DiskMapping) {
-->             dynamicType = <unset>,
-->             sourceDiskId = "disk-2000",
-->             targetDiskId = "disk-2000",
-->             diskCreateType = "vmfsMonolithicFlat",
-->             lvg = false,
-->          },
-->          (converter.agent.params.StorageMapping.DiskMapping) {
-->             dynamicType = <unset>,
-->             sourceDiskId = "disk-2001",
-->             targetDiskId = "disk-2001",
-->             diskCreateType = "vmfsMonolithicFlat",
-->             lvg = false,
-->          }
-->       ],
-->    },
-->    nextBitmapId = <unset>,
-->    snapshotSource = true,
-->    p2vdr = <unset>,
-->    doPersistNextBitmapId = false,
-->    cloningMode = "volumeBasedCloning",
-->    throttlingParams = (converter.params.ThrottlingParams) null,
-->    skipCopyingRestoreCheckpointData = true,
-->    skipUnwantedFiles = <unset>,
-->    doReconfig = true,
-->    helperVmNetworkParams = (converter.params.HelperVmNetworkParams) null,
-->    optimizedPartitionAlignment = true,

Thanks for any hint!

Jay

0 Kudos
1 Reply
ivivanov
Expert
Expert

As you have posted resizeRatio is used in calculations based on the used space in the volume. So the used space is increased with resizeRatio percents, it is compared with the minVolumeSize specified and the larger of two is used as a resize value candidate (the idea is that if you have a 1 GB volume with only 100 MB used and you want min 200 MB volume, if you set resizeRatio to 30 you will get only 130 MB volume after the calculation, so in this case the value of 200 will be used).

The other restriction is not to allow the resizeRatio to exceed the original volume size. So if the original volume is 80 GB with 50 GB used and you set resizeRatio to 100, the calculated resizeVolumeSize based on resizeRatio would be 100 GB, but this would exceed the initial 80 GB size, so the value of 80 GB will be used in this case.

It is not clear what is your problem since there is no information about the initial size and used space of your volumes.

If you want to set size to specific values why not use newCapacityInBytes member in volumesToClone array?

__________
It is worse!
0 Kudos