Hi
I've been having a bunch of problems with OSCustomization (PowerCLI 4.1u1, vcenter 4.1u1). Luckily with the help from all of you, I found most of my answers: Problems with copying OSCustomization templates resolved here & secondary NIC issues resolved here. I feel pretty good though that my first problem is a bug, and my second problem stumped even LucD.
The last piece is this:
I have this for my primary NIC:
Get-OSCustomizationSpec $newCSpec | Get-OSCustomizationNicMapping | where {$_.Position -eq 1} | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $PriIPAddr -SubnetMask $PriIPSNM -Dns $pridns,$secdns -wins $priwins,$secwins -DefaultGateway $PriIPSNGW
This works great. No problem. I have this for my secondary:
Get-OSCustomizationSpec $newCSpec | Get-OSCustomizationNicMapping | where {$_.Position -eq 2} | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $PriIPAddr -SubnetMask $PriIPSNM -Dns $pridns,$secdns -DefaultGateway $PriIPSNGW
Also, it works, no problem. However, I want to get it to a point where I don't need to provide a DefaultGateway:
Get-OSCustomizationSpec $newCSpec | Get-OSCustomizationNicMapping | where {$_.Position -eq 2} | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $PriIPAddr -SubnetMask $PriIPSNM -Dns $pridns,$secdns
Bu when I do, I get this:
When the IpMode parameter is set to UseStaticIp, you must specify the IPAddress, Subnetmask, Dns(on Windows specs only), and DefaultGateway parameters.
Is there anyway I can drill down at the API level to remove the DefaultGateway NIC setting after the fact, along with removing the Dns settings? I'm not stuck on using "set-oscustomizationnicmapping": I can make all the adjustments to "Position 2" through API as well if need be.
Thank you
So, two corrections:
First, the secondary NIC configuration request looks like this today:
Get-OSCustomizationSpec $newCSpec | Get-OSCustomizationNicMapping | where {$_.Position -eq 2} | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $BakIPAddr -SubnetMask $BakIPSNM
-Dns $pridns,$secdns -
DefaultGateway $BakIPSNGW& I want it to look, theoretically, like this:
Get-OSCustomizationSpec $newCSpec | Get-OSCustomizationNicMapping | where {$_.Position -eq 2} | Set-OSCustomizationNicMapping -IpMode UseStaticIP -IpAddress $BakIPAddr -SubnetMask $BakIPSNM
Also, I know in Windows this can be changed post-deployment with netsh, but I really wish to avoid that.
I'm trying to do the same thing. Did anyone find a resolution?
Well, 184 views and only two replies, so it looks like the community has been stumped.
A while ago I submitted a ticket with VMware with this problem. I received a call back yesterday (voice mail) so I will update this discussion string once I have more information.
I ran across this issue today as well. Any insight you got from VMware would be certainly be helpfu.
So in working with VMware, it turns out there is no workaround within PowerCLI and is a known issue. There is a feature request on file to get this fixed, and from I was told this morning from our VMware technical team, we *should* see the fix with a subsequent version of PowerCLI 5 so we shouldn't have to wait until PowerCLI 6