The vSphere Web Services API offers several methods that implement different parts of the instant clone operation. By dividing the functionality into separate methods, the API provides flexibility in the timing and customization of the operation.
You can think of the instant clone operation as having three divisions: preparation, cloning, and customization.
- Installing the guest customization engine. The engine assists with customization of the guest network from the Web Services API. For more information, see Installing the Guest Customization Engine.
- Disconnecting virtual NICs. You have the option to disconnect the NICs in the source virtual machine before you start the clone operation, to avoid network collisions between the source and its clones. For more information, see Avoiding Network Collisions after Instant Clone Operations.
- Freezing the source virtual machine. If you need to create a large number of clones, consider cloning from a frozen source. For more information, see Run State of the Instant Clone Source.
Creating a clone of the source virtual machine requires a single method call. The VirtualMachine.InstantClone_Task
method takes a parameter of type InstantCloneSpec
, which enables you to give the clone a new name and configuration values. By using the key-value pairs in the config
array, you can specify that the virtual NICs of the clone will start in a disconnected state, which avoids network conflicts with the source virtual machine. The location
property of InstantCloneSpec
is ignored.
Customization of a clone virtual machine takes place after the InstantClone_Task
method completes. To customize, you invoke methods of the VirtualMachineGuestCustomizationManager
managed object, as well as optional steps for application-dependent customization. For more information, see Guest Network Customization for Instant Clone Virtual Machines.