I have a powershell script I use to clone Windows and Linux VM's. It all appears to work great except the DNS isn't being set on linux. Does the DNS setting need to be set differently then on Windows? Below is the network configuration part of the script. Any help or suggestions would be greatly appricated.
#CREATE OBJECT CUSTOMIZATIONADAPTERMAPPING
$vmcSpec.Customization.NicSettingMap = @(New-Object VMware.Vim.CustomizationAdapterMapping)
#CREATE OBJECT CUSTOMIZATIONIPSETTINGS
$vmcSpec.Customization.NicSettingMap[0].Adapter = New-Object VMware.Vim.CustomizationIPSettings
#CREATE OBJECT CUSTOMIZATIONFIXEDIP
$vmcSpec.Customization.NicSettingMap[0].Adapter.Ip = New-Object VMware.Vim.CustomizationFixedIp
#NETWORK SPECIFICATIONS
$vmcSpec.Customization.NicSettingMap[0].Adapter.Ip.IpAddress = $ip
$vmcSpec.Customization.NicSettingMap[0].Adapter.SubnetMask = $subnetmask
$vmcSpec.Customization.NicSettingMap[0].Adapter.Gateway = $gateway
$vmcSpec.Customization.NicSettingMap[0].Adapter.DnsServerList = $dns
#CREATE OBJECT CUSTOMIZATIONGLOBALIPSETTINGS
$vmcSpec.Customization.GlobalIPSettings = New-Object VMware.Vim.CustomizationGlobalIPSettings
$vmcSpec.Customization.GlobalIPSettings.DnsServerList = $dns
If you look at the description of the dnsServerList property in the CustomizationIPSettings object, it says "...the Linux guest customization process ignores this setting and looks for its DNS servers in the globalIPSettings object.".
Try commenting out this line
... # $vmcSpec.Customization.NicSettingMap[0].Adapter.DnsServerList = $dns ...
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
If you look at the description of the dnsServerList property in the CustomizationIPSettings object, it says "...the Linux guest customization process ignores this setting and looks for its DNS servers in the globalIPSettings object.".
Try commenting out this line
... # $vmcSpec.Customization.NicSettingMap[0].Adapter.DnsServerList = $dns ...
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
yep figured this out just after my post. Thanks for the info.