VMware Cloud Community
yanivamrami
Enthusiast
Enthusiast
Jump to solution

Cannot create new VM with OS Customization

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.

Please rate helpful / correct answers. Thank you
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

View solution in original post

Reply
0 Kudos
7 Replies
LucD
Leadership
Leadership
Jump to solution

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 Smiley Wink


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
yanivamrami
Enthusiast
Enthusiast
Jump to solution

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

Please rate helpful / correct answers. Thank you
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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

It allows you to do the things you asked.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
yanivamrami
Enthusiast
Enthusiast
Jump to solution

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

Please rate helpful / correct answers. Thank you
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos
yanivamrami
Enthusiast
Enthusiast
Jump to solution

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.

Please rate helpful / correct answers. Thank you
Reply
0 Kudos
LucD
Leadership
Leadership
Jump to solution

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.


Blog: lucd.info  Twitter: @LucD22  Co-author PowerCLI Reference

Reply
0 Kudos