Quantcast
Channel: VMware Communities: Message List
Viewing all articles
Browse latest Browse all 225804

Re: New-VM: Specifying a static IP address for the -OSSpecification parameter

$
0
0

Found another discussion in these forums that is related, and it looks like LucD pretty well answered my question already.  A bit more experimentation yielded the following, which was successful, although a bit ugly:

 

PowerCLI C:\Scripts> Get-OSCustomizationSpec -Name $customization | New-OSCustomizationSpec -Name tempcust -Type NonPersistent

PowerCLI C:\Scripts> $osCust = Get-OSCustomizationSpec -Name tempcust | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $ipaddress -SubnetMask $netmask -DefaultGateway $gateway -Dns $DNS

PowerCLI C:\Scripts> New-VM -Name $servername -ResourcePool $clustername -Template $templatename -OSCustomizationSpec $osCust


Viewing all articles
Browse latest Browse all 225804

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>