VMware {code} Community
StevenZhg
Contributor
Contributor

Customize VM with C# SDK, failed by invalid productId

I'm trying to clone VM from a template with C# API, and do some guest OS customization for Windows. The CustomizationUserData.productId always cause failure.

1. If I don't specify it, the program receives an exception "Required property productId is missing from data object of type CustomizationUserData".

2. I copied one key from an existing VM, after the new VM was cloned, it failed to do customization.

3. However from vSphere Client, Deploy VM dialog can do the clone and customization with an empty productId.

4. VMware Orchestrator has an example workflow, "Library\vCenter\Virtual Machine Management\Clone\Windows Customization\Clone, Windows Sysprep with single NIC and credential", the productId could be left empty too, and it notes that "Microsoft Sysprep requires that a valid serial number be included in the answer file when mini-setup runs. The serial number is ignored if the original guest operating system was installed using a volume-licensed CD".

This sample can run without productId, but my C# program never.

5. Steve237 provides a sample code on customizing VM. It mentions "String productId = queryProductId("OS");", but not sure what does "queryProductId()" do.

I believe our template has the "volumn-licensed CD", otherwise item No. 3 and 4 won't work. Does anybody have the same issue? Who knows how to resolve it?

Appreciate for any response.

0 Kudos
0 Replies