Automation

 View Only
  • 1.  Cannot create new VM with OS Customization

    Posted Dec 16, 2008 07:30 AM

    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.



  • 2.  RE: Cannot create new VM with OS Customization

    Posted Dec 16, 2008 07:37 AM

    There are some problems with the implementation fo the OSCustomizationSpec in the current VITK build.

    See for example , and there are other entries ..

    The next build will hopefully resolve most of these problems :smileywink:



  • 3.  RE: Cannot create new VM with OS Customization

    Posted Dec 16, 2008 08:20 AM

    Thank you.

    So, is there other way to run sysprep right after the VM is starting?

    All I want to do is:

    - create a new SID and get

    - Rename the hostname to the vmname

    - Get the VM into the domain

    Thanks



  • 4.  RE: Cannot create new VM with OS Customization

    Posted Dec 16, 2008 08:29 AM

    You could have a look at my , which I entered for the VITK scripting contest.

    It allows you to do the things you asked.



  • 5.  RE: Cannot create new VM with OS Customization

    Posted Dec 16, 2008 10:18 AM

    Well,

    Before I look into it further, is it possible to define a DHCP for a VM thru vmclonespec?

    I can only find the object VMware.Vim.CustomizationFixedIp, is there something like VMware.Vim.CustomizationDHCP?!

    Thanks



  • 6.  RE: Cannot create new VM with OS Customization
    Best Answer

    Posted Dec 16, 2008 10:36 AM

    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.



  • 7.  RE: Cannot create new VM with OS Customization

    Posted Dec 16, 2008 10:37 AM

    LucD,

    I am trying to work with your application and I have few comments, if I may...

    I have the same Resource Pool names on different clusters, can this drop down list be populated with the relevant resource pools?

    e.g. I have to choose a cluster before I can get the drop down list...

    When I try to execute a job, each time I get a different error in VI Client.

    The current one is "A specified parameter was not correct. spec.PowerOn"

    It will be nice to know which parameters are mendatory...

    Thank you for your help.



  • 8.  RE: Cannot create new VM with OS Customization

    Posted Dec 16, 2008 10:43 AM

    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.