So I've been working on this project for work and have started a thread (http://communities.vmware.com/message/2194869#2194869) that has more or less turned into a build log since nobody has responded to it but me.
If you look at the last post there is an attachment that has the functions that i'm using in my web app. I'm using the vmware.vim.dll to do everything i need, and for the most part i feel that i'm about 80% complete. My current hangup is handling the computername property of the resulting vm. Now we have a basic customization spec that I load in
VirtualMachineCloneSpec mySpec = new VirtualMachineCloneSpec();
mySpec.Location = new VirtualMachineRelocateSpec();
mySpec.Location.Datastore = itmDatastore.MoRef;
//mySpec.Location.Transform = VirtualMachineRelocateTransformation.sparse;
mySpec.Location.Host = selectedHost.MoRef;
mySpec.Customization = itmSpecItem.Spec;
mySpec.Customization.Identity = itmSpecItem.Spec.Identity;
at runtime I can see that mySpec.Customization.Identity has everything in it specifically, UserData.ComputerName.Name and it's set to some name. We have a PowerShell script that we've been using that will Get-OsCustomizationSpec and then Set-OsCustomizationSpec, or something similar. I'm having a difficult time accessing the the userdata stuff in the spec while I'm writing my code.
For the record outside of the computername thing, this works perfectly. I've spent most of the morning tweaking my code that will customizes the vm and clones it. I get a working vm, in the right network, with the proper addressing, my problem is only the name of it. I had missed this and actually broke a production vm, because my clone came up with the same name.
I've seen several examples where everyone is creating new customizationsysprep, but that info is already in mine, i just need to know how to programatically access and modify it, there must be a way to do that, as i'm doing it now for setting networking information.
Hopefully someone can help me out, as everything i've seen thus far has been dated circa 2005-2008. i get that there is powercli, i'm writing a web app so that's not an option for me now.
thanks in advance!