I'll try to elaborate a little more about what I'm trying to do:
I'm using the CloneVM_Task to clone an existing template into a new VM. The CloneVM_Task needs a CloneSpec, which in turn can containg both a ConfigSpec and a CustomizationSpec.
The ConfigSpec is used to add a device, change RAM, CPU etc. while the CustomizationSpec is used for customizing elements within the operating system like IP settings for NICs, change computer name, joining the Domain etc.
When I used only the ConfigSpec to add NICs, it worked. The clone operation was completed and I had a new VM with the new NIC.
When I used only the CustomizationSpec with a template that already had NICs, it worked. The Clone operation was followed by a sysprep that configured the NICs.
Then I tried using both specs on a template with no NICs, the clone task immediately failed stating a "mismatch" between the number of NICs in the spec and the number of NICs in the VM.
What I'm trying to find out is if there is a way to force the clone
task to skip this check and continue, since the NICs will eventually be
there when the clone task completes.
BTW - From my tests I've noticed that customization takes place after the
clone completes, and (I guess) it involves injecting the sysprep files
and answer file into the VM's vmdk. So basicaly there should be no problem doing this AFTER the NICs are added.