VMware Cloud Community
larsmas
Contributor
Contributor

Change link status on vNICs attached to a vSwitch if physical link goes down?

I have a problem and I wonder if anyone here have a solution.

I have an ESXi with two physical NIC's. The first physical NIC is connected to vSwitch0 and the other physical NIC is connected to vSwitch1.

On the ESX I run a few virtual machines, all of them connected to both vSwitch0 and vSwitch1 with vNIC's.

The problem is that IF the link to the first physical NIC (connected to vSwitch0) or the link to the other physical NIC goes down I need the vSwitches to send LINK DOWN to the virtual machines vNIC's.

By default the virtual machines still think that the link is up and running.

Basicly. I need a solution where my vSwitches will set link status to down on my virtual machines vNIC's too if the physical link to that switch goes down.

Is it possible?

Tags (2)
Reply
0 Kudos
10 Replies
AndreTheGiant
Immortal
Immortal

Is not simple.

Is the same with two physical swichtes... if the uplink goes down the other switch port still works.

With some scripting could be possible, but it not so easy Smiley Happy

Andre

Andrew | http://about.me/amauro | http://vinfrastructure.it/ | @Andrea_Mauro
Reply
0 Kudos
kiranmehta1981
Contributor
Contributor

Hi,

Can you please let me know if there is any document/KB article from VMware where this is documented ?

Thanks,

    Kiran

Reply
0 Kudos
vMario156
Expert
Expert

Why did you split this up into two vSwichtes? Why not using both nics on one vSwitch with loadbalancing (which also would eliminate your problem)?

Regards,

Mario

Blog: http://vKnowledge.net
Reply
0 Kudos
kiranmehta1981
Contributor
Contributor

Mario,

The thing is that I am facing a similar issue. I have a vnic which is mapped to a physical nic. I read several posts where it is mentioned that when cable is pulled from physical nic, status of vnic will remain up. I am just looking for a document that mentions this situation/issue.

Thanks,

Kiran

Reply
0 Kudos
a_p_
Leadership
Leadership

I doubt there's anything documented related to this. As mentioned by AndreTheGiant you may need to find a manual/scripted solution. The only feature I know of which brings the downlinks to the down status if the uplink goes down is Cisco's Link State Tracking.

André

Reply
0 Kudos
rickardnobel
Champion
Champion

kiranmehta1981 wrote:

I have a vnic which is mapped to a physical nic. I read several posts where it is mentioned that when cable is pulled from physical nic, status of vnic will remain up.

There might be some confusion based on what you wrote above. The vNIC in the VM is actually not mapped to a physical vmnic, it is attached to a (virtual) switch. And as written above, if you have several machines on a switch (physical or virtual) and one cable is pulled then the other will remain connected.

Could you describe the actual problem some more? As also mentioned earlier, the best situation is often to make sure the virtual switch has redundancy with multiple uplinks.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
kiranmehta1981
Contributor
Contributor

Sorry for the confusion. I meant what you mentioned. vnic->vswitch->pnic. I know that redundancy would help. I am curious to know if there is some way that a guest OS is notified about existence of NO path from vnic to physical nic (through which it could send traffic

out on the physical network.). During some tests, I noticed that tools such as ethtool/mii-tool show link connected even though physical cable is pulled. Was hoping to get some authentic VMware link to KB article/doc where this issue is listed.

Reply
0 Kudos
kiranmehta1981
Contributor
Contributor

And yes, If a vnic has multiple paths to physical network and if all the paths are lost, this particular vnic is of no use until at least one link comes back up. So it would have been helpful if OS could have been made aware of real state of vnic (whether it has path to physical network or not)

Reply
0 Kudos
rickardnobel
Champion
Champion

kiranmehta1981 wrote:

Was hoping to get some authentic VMware link to KB article/doc where this issue is listed.

I would actually not call this an issue. The vSwitch is an emulated physical Ethernet Switch and this is exactly the same behavior you would get on a physical switch. There are really no difference here.

kiranmehta1981 wrote:

And yes, If a vnic has multiple paths to physical network and if all the paths are lost, this particular vnic is of no use until at least one link comes back up.

The keywords I think is this "particular vNIC", I do understand that your VM needs to do this detection, but from the VMware side it is not "natural". Imagine having 20 VM servers on a vSwitch and the uplink to the outside world fails. This will of course make the VMs lose all outside connection, but they still could communicate perfectly with each other. If the Vmkernel should shut down all their vNICs too it would cause a much higher degree of disruption in most cases.

As for your situation, could you perhaps build some logic inside the VM? Like a script that monitors one (or several) addresses on the outside with just simple ICMP Echo (ping) and if they are lost then the script informs your application / system that the network is temporarely lost and could act from that.

My VMware blog: www.rickardnobel.se
Reply
0 Kudos
kiranmehta1981
Contributor
Contributor

Thanks Richard. I appreciate your informative replies.

Reply
0 Kudos