Improve company productivity with a Business Account.Sign Up

x
  • Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1712
  • Last Modified:

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!
0
vn_tech
Asked:
vn_tech
  • 5
  • 2
1 Solution
 
Lee W, MVPTechnology and Business Process AdvisorCommented:
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
0
 
vn_techAuthor Commented:
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!
0
 
SandCCommented:
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.
0
Creating Active Directory Users from a Text File

If your organization has a need to mass-create AD user accounts, watch this video to see how its done without the need for scripting or other unnecessary complexities.

 
vn_techAuthor Commented:
I implemented a powershell workaround which based on a small amount of testing appears to be working.  The details of this workaround follows...

Powershell script :

Start-Sleep -s 10
Disable-NetAdapter -Name "VM NIC" -confirm:$false
Start-Sleep -s 10
Enable-NetAdapter -Name "VM NIC"

NOTE : I renamed our Hyper-V guest NIC to "VM NIC" and its on this NIC that our vm's run

With the script written there were three more things I needed to do to get it to work...

1. I added a task in the Task Scheduler to execute the script at system start up.
2. To make sure VM2 (our Remote Desktop Server) started up rather than resumed when the Hyper-V host was restarted / power-cycled, I had to configure VM2 to shutdown every time the Hyper-V host was shutdown. I also made sure our UPS was configured to shutdown the Hyper-V host if its battery hit the 8 minute "time-to-live" mark.
3. Lastly, I had to change powershell's execution policy from Restricted to RemoteSigned.

With the small amount of testing I've done this appears to work.  While its working, it feels like a hack so I am still VERY interested in ideas on how to fix via built-in server config.
0
 
SandCCommented:
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?
0
 
vn_techAuthor Commented:
@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.
0
 
vn_techAuthor Commented:
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.
0
 
vn_techAuthor Commented:
Its a workaround that will not work in every situation.
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Simplify Active Directory Administration

Administration of Active Directory does not have to be hard.  Too often what should be a simple task is made more difficult than it needs to be.The solution?  Hyena from SystemTools Software.  With ease-of-use as well as powerful importing and bulk updating capabilities.

  • 5
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now