Before you customize the guest network, you should disconnect the virtual NICs to quiesce network traffic during the operation. Disconnecting virtual NICs is a key step in the instant clone process.
- In the
spec
parameter to theInstantClone_Task
method you can specify that the virtual NIC should be disconnected during the instant clone operation. This way leaves the NIC in the source virtual machine active immediately after the clone operation, while the NIC in the clone is idle and ready for customization. - In the
spec
parameter to theReconfigVM_Task
method you can change the connection state of a virtual NIC. This way is available either with or without an instant clone operation.
Disconnecting a Virtual NIC with InstantClone_Task
To disconnect a virtual NIC during an instant clone operation, prepare a VirtualMachineInstantCloneSpec
data object that specifies the device should be in the disconnected state after the clone operation completes. You pass the clone specification in the spec
parameter of InstantClone_Task
. Assign a value of disconnect
to the property spec.location.deviceChange[].device.connectable.migrateConnect
.
Disconnecting a Virtual NIC with ReconfigVM_Task
To disconnect a virtual NIC by reconfiguring the virtual machine, prepare a VirtualMachineConfigSpec
data object that specifies a disconnected virtual NIC. You pass the config specification in the spec
parameter of the ReconfigVM_Task
method. Assign a value of False
to the property spec.deviceChange[].device.connectable.connected
.