This had worked previously. But now while setting it, it doesn't throw an error but while getting the mapping results it has no output.
[vSphere PowerCLI] > Get-OSCustomizationSpec Blarg | Get-OSCustomizationNicMapping | Set-OSCustomizationNicMapping -IpMode UseStaticIp -IPAddress 1.1.1.1 -Subnetmask 255.255.255.0 -Dns 1.1.1.1,1.1.1.1 -DefaultGateway 1.1.1.1
[vSphere PowerCLI] > get-OSCustomizationSpec Blarg | Get-OSCustomizationNicMapping
and nothing returns
Need help on this one.
Message was edited by: Derek Purdy fixed IP Address, bad copy/paste
That could explain the original problem.
Your OSCustomization spec doesn't seem to contain any NIC information.
That can have been done with
Remove-OSCustomizationNicMapping -OSCustomizationNicMapping (Get-OSCustomizationSpec Blarg | Get-OSCustomizationNicMapping)
Create a new NIC entry with
Get-OSCustomizationSpec -Name Test | New-OSCustomizationNicMapping
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
I think your IPAddress value is incorrect.
Shouldn't that be -IPAddress 1.1.1.1 without the dot at the end ?
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
sorry that was just a bad edit while i was taking my real ip values out.
Doesn't the first line produce any output on the console ?
Does
Get-OSCustomizationSpec Blarg
return anything ?
And is there anything returned from
Get-OSCustomizationSpec Blarg | Get-OSCustomizationNicMapping
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Yes, it does get the Spec details
[vSphere PowerCLI] > get-OSCustomizationSpec Blarg | fl
Name : Blarg
Type : Persistent
ServerId : /VIServer=domain\user@host.domain:443/
Server : host.domain
LastUpdate : 8/11/2011 7:36:00 PM
DomainAdminUsername :
DomainUsername :
Description : Blarg Customization Specification File.
-> IP Address: Specified in Template
-> Default g/w: 1.1.1.1
-> NTP Servers: 1.1.1.1[1-3]
AutoLogonCount : 1
ChangeSid : True
DeleteAccounts : False
DnsServer :
DnsSuffix : {subdomain.domain}
Domain :
FullName : User
GuiRunOnce :
NamingPrefix :
NamingScheme : Vm
OrgName : XXX
OSType : Windows
ProductKey :
TimeZone : GMT (Greenwich Mean Time)
Workgroup : XXX
LicenseMode : PerServer
LicenseMaxConnections : 5
EncryptionKey :
ExtensionData : VMware.Vim.CustomizationSpecItem
Id : Blarg
Uid : /VIServer=domain\user@host.domain:443/OSCustomizationSpec=Blarg/a
[vSphere PowerCLI] > get-OSCustomizationSpec Blarg | Get-OSCustomizationNicMapping
Nothing here.
That could explain the original problem.
Your OSCustomization spec doesn't seem to contain any NIC information.
That can have been done with
Remove-OSCustomizationNicMapping -OSCustomizationNicMapping (Get-OSCustomizationSpec Blarg | Get-OSCustomizationNicMapping)
Create a new NIC entry with
Get-OSCustomizationSpec -Name Test | New-OSCustomizationNicMapping
Blog: lucd.info Twitter: @LucD22 Co-author PowerCLI Reference
Thats it!
Thanks