Link to home
Start Free TrialLog in
Avatar of vn_tech
vn_tech

asked on

Hyper-V VM looses Gateway IP after each reboot

Here's the environment...

Server 2012 Hyper-V Host :

VM1 = Domain Controller
VM2 = Remote Desktop Server (RDS)

Both VMs are accessed via static IP through the Hyper-V host's Virtual Switch.

Problem...

After each reboot of the Hyper-V host the Domain Controller's NIC comes up fine but the RDS's NIC doesn't.  The RDS NIC "looses" its Default Gateway...the field is blank in the NIC's Network Connections > IPv4 Settings...and the only way to recover it is to disable / enable the NIC.

I've written a powershell script to disable > enable the NIC but before testing wanted to table this issue here to see if anyone has any idea of how to fix without implementing a hack / work around?

Look forward to feedback!
Avatar of Lee W, MVP
Lee W, MVP
Flag of United States of America image

What's the guest OS?  I doubt this is a Hyper-V issue and more likely an issue with the guest OS.  I think it was the 2008 days (maybe 2008 R2) there was a bug where if you set the gateway using a certain way, I think it put a null character or something like that before the entry for the gateway in the registry.  

I think this was the blog entry... and I *THINK* I remember seeing it happen on non-SBS systems:
http://blogs.technet.com/b/sbs/archive/2010/04/22/you-may-lose-the-default-gateway-on-sbs-2008-every-time-you-reboot.aspx
Avatar of vn_tech
vn_tech

ASKER

Thanks for the feedback.  I actually saw this post or one similar yesterday and confirmed the registry is not the problem.  As for the OS everything is Server 2012...

Host = Hyper-V Host on Server 2012 Standard < we're running 2 VM's on this host
VM1 = Domain Controller (AD / DS, DNS, DHCP) on Server 2012 Std
VM2 = Remote Desktop Server on Server 2012 Std

VM1 & VM2 are accessed through a virtual switch but both have been configured with static IP addresses via their respective Local Area Connections.  Every time I reboot the Host, VM1's connection comes up fine but VM2 (Remote Destop Server) "looses" its Default Gateway rendering it inaccessible until I login to the vm directly on the server and disable / enable the adapter.  I've written a powershell script to perform this task after startup but would prefer determining root-cause & resolving rather than implementing a hack.

Any thoughts / ideas are VERY welcome as I'm stumped!
We have the same problem with a pair of 2012 servers (non-HyperV). When I reboot them both one will have no gateway and the other will be fine, and it's not always the same server!

If I look in the registry the gateway is there, and in the GUI the gateway is there. IPCONFIG shows the gateway is there. However, until I do a network validate or repair it doesn't work and then I get the message "Gateway fixed".

I suspect it's to do with the Broadcom NIC teaming we're using.
ASKER CERTIFIED SOLUTION
Avatar of vn_tech
vn_tech

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
As you suggested, bringing my NICs down and up again on every boot fixes the problem for me, even though no changes are being made.

Are you also using NIC teaming by any chance in your hypervisor?
Avatar of vn_tech

ASKER

@SandC

I'm running a Server 2012 STD -based Hyper-V Host on a Dell T320 which shipped with two Broadcom-based LOM's.  I configured one statically to manager the Hyper-V Host.  The other was configured as a Virtual Switch for the vm's; I believe this was configured during initial setup of the Hyper-V Host.  This Virtual Switch supports two NICs for two vm's.

After getting your note I looked in the NIC Teaming section and only see the NIC for the Hyper-V Host so assume its handled differently than NIC Teaming.
Avatar of vn_tech

ASKER

Since I've gotten no additional feedback / ideas I'm going to accept my workaround as the solution.  That said, the weakness in this solution is if the server shuts down abnormally VM2 will likely be paused / suspended rather than shutting down too at which point I will need to manually execute the script to recover its NIC.
Avatar of vn_tech

ASKER

Its a workaround that will not work in every situation.