VMware Cloud Community
snoopj
Enthusiast
Enthusiast

CloneVM_Task question

I've been going over the SDK and I can't seem to find it.  I know I could just as easily build a VM with the New-VM cmdlet, but for my own sake of understanding, I'm not finding the right area using CloneVM_Task to tell do something similar to creating a spec using a predefined configured customization.

Example:  $custVMSpec = Get-OSCustomizationSpec "Windows 2008 Server"

Am I just missing the right variable or function to assign a pre-existing customization using CloneVM_Task?

0 Kudos
3 Replies
mattboren
Expert
Expert

Hello, snoopj-

Customizing the VM would be a separate task from cloning it, if using the API.  There is a "CustomizeVM_Task()" method for customizing the given VM.  Give that a try...

snoopj
Enthusiast
Enthusiast

Looked into that.  I'm in the same situation I'm at with CloneVM_Task.  Each wants to create an object type of CustomizationSpec.  I think I may have found it, however.

There's an object type of CustomizationSpecItem.  This object type is returned by GetCustomizationSpec.  One of the properties of the object is a CustomizationSpec, which is what I need to pass the object needed by CloneVM_Task.

Oh what a tangled web the SDK is sometimes.

0 Kudos
mattboren
Expert
Expert

Ah, yes -- right you are about CloneVM_Task() accepting that parameter, so that customization can be handled in the same call.  And, yes, GetCustomizationSpec() should do for getting the necessary spec object.  Thanks for pointing that out.