VMware Cloud Community
ae_jenkins
Enthusiast
Enthusiast

Set-OSCustomizationNicMapping issues with 2nd NIC

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. Smiley Wink

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

Reply
0 Kudos
5 Replies
ae_jenkins
Enthusiast
Enthusiast

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.

Reply
0 Kudos
Mackopes
Enthusiast
Enthusiast

I'm trying to do the same thing. Did anyone find a resolution?

Reply
0 Kudos
ae_jenkins
Enthusiast
Enthusiast

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.

Reply
0 Kudos
txag1995
Contributor
Contributor

I ran across this issue today as well.  Any insight you got from VMware would be certainly be helpfu.

Reply
0 Kudos
ae_jenkins
Enthusiast
Enthusiast

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

Reply
0 Kudos