VMware {code} Community
sahmed24
Contributor
Contributor

Time and size of linked clone?

Hi

i am creating linked clone using vsphere web services sdk 4.0. i have pasted the code below, thats how i am trying to create linked clone. I want to know that i am doing right, secondly it takes me around 10 min to create linked clone, and the clone is of 2GB which far too much for linked clone, its should be in KBs. on the otherhand full clone took 40 min and was of 20GB.

why the size of linked clone is so huge?

ManagedObjectReference vmFolderRef

= (ManagedObjectReference)cb.getServiceUtil().GetMoRefProp(datacenterRef, "vmFolder");

ManagedObjectReference vmRef

= service.FindByInventoryPath(sic.searchIndex, vmPath);

VirtualMachineCloneSpec cloneSpec = new VirtualMachineCloneSpec();

VirtualMachineRelocateSpec relocSpec = new VirtualMachineRelocateSpec();

relocSpec.diskMoveType = "moveChildMostDiskBacking";

cloneSpec.location = relocSpec;

cloneSpec.powerOn = false;

cloneSpec.template = false;

ManagedObjectReference cloneTask

= service.CloneVMTask(vmRef, vmFolderRef, clonedName, cloneSpec);

//Rizwan

Reply
0 Kudos
1 Reply
sahmed24
Contributor
Contributor

ok, i have the answer now.

the size and the time, is comparable to what it was in vmware workstation, i.e. few kilobytes, and couple of seconds (even less).

i failed in creating linked clone from the current state of the machine, but i succeeded in creating linked clone from the snapshot. thats what i changed from the code in my previous post

relocSpec.diskMoveType = "createNewChildDiskBacking";

//VMSnapshot.VMSnapshot snapshot = new VMSnapshot.VMSnapshot();

ManagedObjectReference ssRef = getSnapshotReference(vmRef, "WinXP", "snapshot_name");

cloneSpec.snapshot = ssRef;

Reply
0 Kudos