Hello, everybody
I would like to ask
whether cloned it and specified the size of the disk at the same time
CloneVM_Task whether can specify a disk size
My English is not good
-----------------------------------------------------
My code
VirtualMachineConfigSpec vmConfigSpec = new VirtualMachineConfigSpec();
VirtualDeviceConfigSpec diskSpec = new VirtualDeviceConfigSpec();
VirtualDisk disk = new VirtualDisk();
int size = 1024 * 1024 * (int.Parse(cb.get_option("disksize")));
disk.capacityInKB = size;
diskSpec.device = disk;
VirtualDeviceConfigSpec[] vdiskSpecArray = { diskSpec };
vmConfigSpec.deviceChange = vdiskSpecArray;
vmConfigSpec.memoryMB = 2048;
vmConfigSpec.memoryMBSpecified = true;
vmConfigSpec.numCPUs = 2;
vmConfigSpec.numCPUsSpecified = true;
cloneSpec.config = vmConfigSpec;
String clonedName = cloneName;
Console.WriteLine("Launching clone task to create a clone: " + clonedName);
try
{
ManagedObjectReference cloneTask = _service.CloneVM_Task(vmRef, vmFolderRef, clonedName, cloneSpec);
}
--------------------