VMware

This Question is Answered

2 "helpful" answers available (6 pts)
7 Replies Last post: Dec 16, 2008 2:42 AM by LucD  

Cannot create new VM with OS Customization posted: Dec 15, 2008 11:30 PM

Click to view yanivamrami's profile Enthusiast 34 posts since
Mar 14, 2006
Hi,

I am trying to run the following:
New-VM -VMHost $esxHost -NAME vmamqa124 -ResourcePool $resPool -Location $fName -Datastore $lunName -Template $templateName -OSCustomizationSpec $customSpec

When the clone completes, I get this error about the OS Customization:
New-VM : 12/16/2008 9:25:33 AM New-VM F6175716-EC1B-42B2-A6F6-37949D8690B8 The operation for the entity vm-47729 failed with the following message: "Customization failed."
At line:1 char:7
+ New-VM <<<< -VMHost $esxHost -NAME vmamqa124 -ResourcePool $resPool -Location $fName -Datastore $lunName -Template $templateName -OSCustomizationSpec $customSpec

Running the same command w/o the -OSCustomizationSpec parameter works fine...

Do you have any idea?!

Thanks.

Re: Cannot create new VM with OS Customization

1. Dec 15, 2008 11:37 PM in response to: yanivamrami
Click to view LucD's profile Champion 2,435 posts since
Oct 31, 2005
There are some problems with the implementation fo the OSCustomizationSpec in the current VITK build.
See for example Re: OSCustomizationSpec, and there are other entries ..

The next build will hopefully resolve most of these problems ;-)

Re: Cannot create new VM with OS Customization

3. Dec 16, 2008 12:28 AM in response to: yanivamrami
Click to view LucD's profile Champion 2,435 posts since
Oct 31, 2005
You could have a look at my Guest Provisioning System (cloning from templates), which I entered for the VITK scripting contest.
It allows you to do the things you asked.

Re: Cannot create new VM with OS Customization

5. Dec 16, 2008 2:36 AM in response to: yanivamrami
Click to view LucD's profile Champion 2,435 posts since
Oct 31, 2005
Yes, you can.
The CustomizationIpGeneratorobject is extended by several other objects, one of these being the CustomizationDhcpIpGenerator.
CustomizationFixedIp is another of these extensions.

If you use CustomizationDhcpIpGenerator the customisation will set the adapter to use DHCP.

As a side note, be aware that this is only valid for Windows guests.
For Linux guests another approach is required.

Re: Cannot create new VM with OS Customization

7. Dec 16, 2008 2:42 AM in response to: yanivamrami
Click to view LucD's profile Champion 2,435 posts since
Oct 31, 2005
Yes, resource pools with the same name on different clusters is one of the problems that are still present in the script.
I'm working on a new version that should fix that problem.
Hopefully I will find the time to publish that in the coming weeks.

The spec.PowerOn is a apparently a catch-all error message for the CloneVM_Task method.
If the other problems, like the one with the resource pools above, are fixed I suspect this will disappear (I suspect).

Indicating mandatory parameters is a good suggestion, I will take that into account for the new version.

VMware Developer

SDKs, APIs, Videos, Learn and much more in the Developer community.

Learn More

Developer Sample Code

Increase your developer productivity with VMware API sample code.

Learn More

VMworld Sessions & Labs

Online access to the latest VMworld Sessions & Labs and online services.

Learn more

Purchase PSO Credits Online

Purchase credits to redeem training and consulting services online.

Buy Now

Community Hardware Software

View reported configurations or report your own.

Learn More

VMware vSphere

Come witness the next giant leap in virtualization.

Register Today

Communities