VMware Cloud Community
ganapa2000
Hot Shot
Hot Shot
Jump to solution

Invalid Argument error while assigning IP to VM

Hi,

I am getting the below error, while deploying VM from a template.

Everything works well expect the first part assigning the IP address

Please help.

Set-OSCustomizationNicMapping : 01-04-2019 11:36:34 Set-OSCustomizationNicMapping       When the IpMode parameter is set to UseStaticIp, you must specify the IPAddress, Subnetmask, Dns

(on Windows

specs only), and DefaultGateway parameters.

At D:\deploy_Template\testdeploy.ps1:7 char:74

+ ... icMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIp -IpAddr ...

+             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ CategoryInfo      : InvalidArgument: (:) [Set-OSCustomizationNicMapping], ViError
+ FullyQualifiedErrorId : Core_NicMappingCmdletBase_ValidateParameters_RequiredParametersSaticIp,VMware.VimAutomation.ViCore.Cmdlets.Commands.SetOSCustomizationNicMapping
Reply
0 Kudos
1 Solution

Accepted Solutions
LucD
Leadership
Leadership
Jump to solution

In the script you are using -IpAddress $item.ipaddr while the CSV column says ipaddress


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

View solution in original post

Reply
0 Kudos
2 Replies
LucD
Leadership
Leadership
Jump to solution

In the script you are using -IpAddress $item.ipaddr while the CSV column says ipaddress


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

Reply
0 Kudos
ganapa2000
Hot Shot
Hot Shot
Jump to solution

My bad, i was not able to identify....that way you are called a Champ. Thanks a lot LucD, that worked Smiley Happy

Reply
0 Kudos