Hi all,
Recently I have developed a VMware automation tool deploying Virtual Machine from a template through vSphere SDK
The current virtual disk format of the template is “Thin provision” and It must be converted to “Thick Provision Lazy Zeroed” after cloning
I have tried many different ways but I have not resolved the issue.
Could anyone help me to convert the existing virtual disk format through vSphere SDK?
$diskfileBacking = new VirtualDiskFlatVer2BackingInfo();
$diskfileBacking->fileName = '[Test] RHEL 6.6 Non-Prod/RHEL 6.6 Non-Prod.vmdk';
$diskfileBacking->diskMode = "persistent";
$diskfileBacking->thinProvisioned = false;
$desc = new Description();
$desc->label = "testvm_disk_0";
$desc->summary = "Disk 0";
$disk = new VirtualDisk();
$disk->capacityInKB = '58720256';
$disk->controllerKey = 1000;
$disk->unitNumber = 0;
$disk->backing = $diskfileBacking;
$disk->key = 2000;
$disk->deviceInfo = $desc;
$spec = new VirtualDeviceConfigSpec();
$spec->operation = 'edit';
$spec->device = $disk;
Regards