Quantcast
Channel: VMware Communities : All Content - vSphere Management SDK
Viewing all articles
Browse latest Browse all 1860

The current virtual disk format of the template is “Thin provision” and It must be converted to “Thick Provision Lazy Zeroed” after cloning

$
0
0

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


Viewing all articles
Browse latest Browse all 1860

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>