GaelV
Enthusiast
Enthusiast

I've tried the one with "UseStaticIP" parameter because it could help me in the future for using .csv doc.

But i still got an error with my cli (i didn't paste the $VMHost, $Template and $Spec but they're ok)

PS C:\> New-VM -Name 'WEB001' -VMHost $VMHost -Datastore 'DST_XXX' -Template $Template -OSCustomizationSpec $Spec | Set-OSCustomizationNicMapping -IPmode UseStaticIP -IpAddress "192.168.0.1" -SubnetMask "255.255.255.0" -DefaultGateway "192.168.0.1" -Dns "X.X.X.X.X","X.X.X.X.X"

New-VM : 31/07/2019 11:30:12 New-VM          Server task failed: A specified parameter was not correct: nicsettings:adapter:ip

Au caractère Ligne:1 : 1

+ New-VM -Name 'WEB001' -VMHost $VMHost -Datastore 'DST_XXX ...

+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

    + CategoryInfo          : NotSpecified: (:) [New-VM], VimException

    + FullyQualifiedErrorId : Security_Impl_TaskResultConverter_TaskNotSucceeded,VMware.VimAutomation.ViCore.Cmdlets.Commands.NewVM

I tried with simple quote and double quote, nothing changes, i've also tried with only one DNS... but still the same error.

Reply
0 Kudos