While cloning a VM from a template I need to change its network. How can I do that?
I was thinking to go through the VirtualMachineCloneSpec, however I don't know how.
Below the snippet of code that I use to clone the virtual machine:
// Get customization specifications
CustomizationSpec customizationSpec = serviceInstance.getCustomizationSpecManager().getCustomizationSpec(customizationSpecName).getSpec();
// Setup customization
VirtualMachineCloneSpec virtualMachineCloneSpec = new VirtualMachineCloneSpec();
virtualMachineCloneSpec.setCustomization(customizationSpec);
// Get folder reference
Folder folder = Utilities.getFolder(serviceInstance, datacenterName, folderName);
// Clone VM
LOG.info("Cloning the VM. Please wait...");
Task task = vm.cloneVM_Task(folder, newCloneName, virtualMachineCloneSpec);
Thank you
If you would like to refer to this comment somewhere else in this project, copy and paste the following link:
Hi
While cloning a VM from a template I need to change its network. How can I do that?
I was thinking to go through the VirtualMachineCloneSpec, however I don't know how.
Below the snippet of code that I use to clone the virtual machine:
Thank you
ping :)