Máquina Virtual Hyper-V pede conexão de rede após Failover (0x80070003)

Por Alessandro Goncalves

Há pouco atrás trabalhei em um incidente interessante , não pela complexidade técnica mas sim por o erro ser causado por uma falta de atenção na configuração.

O cenário é o seguinte:

Hyper-V cluster com 3 nós. O failover entre os nós do cluster 1 e 2 acontece sem nenhum problema. Todavia quando qualquer máquina virtual era movida para o nó 3 , ela perdia a conexão de rede. Quando abrimos as propriedades da máquina virtual que acabou de ser iniciada no nó 3 , verificamos que a placa de rede não está associada a nenhum switch virtual.

image

Como sempre verificamos o log de eventos e vemos o seguinte :

Log Name: System
Source: Microsoft-Windows-Hyper-V-High-Availability
Date: 3/5/2009 1:35:26 PM
Event ID: 21502C
Task Category: None
Level: Error
Keywords:
User: SYSTEM
Computer: NODE3
Description:
'Virtual Machine E2k7-Full Org' failed to start.
'E2k7-Full Org' failed to restore. (Virtual machine 14A5E87F-F4F3-46A9-A2DC-FAD3AC3A0695)
'AAA' Microsoft Synthetic Ethernet Port (Instance ID
{42F9AF50-6B3D-40B5-8E3D-56A476A6F28A}): Failed to restore with error 'The system
cannot find the path specified.' (0x80070003). (Virtual machine
14A5E87F-F4F3-46A9-A2DC-FAD3AC3A0695)
The virtual machine cannot be started because the virtual network adapter is
configured to use a network that is unavailable. To fix this problem, modify the
virtual machine settings to reconfigure the network adapter and then try to start
the virtual machine again.
cannot find the path specified.' (0x80070003). (Virtual machine
14A5E87F-F4F3-46A9-A2DC-FAD3AC3A0695)
The virtual machine cannot be started because the virtual network adapter is
configured to use a network that is unavailable. To fix this problem, modify the
virtual machine settings to reconfigure the network adapter and then try to start
the virtual machine again.

 

O erro 0x80070003 - The system cannot find the path specified - já nos indica qual é o problema e nos dá a solução. Como diria um professor meu... Trívial :-)...

Bem vamos a explicação. Para quem ainda não descobriu o problema.

Neste caso , os nomes indicados para os v-switches estavam diferentes no servidor número 3.

Aqui está a parte do registro que indica as configurações de rede do servidor Hyper-V.

 

CLUSTER NODE1
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VMSMP\Parameters\NicList\812C7
B46-FF71-4D6A-A872-18ADE6694961]
"SwitchName"="DEE49B1C-CE66-4519-A3B4-B19BECE654A3"
"PortName"="37ECF929-B07F-4352-BF74-4EC67D57C0D1"
"NicType"=dword:00000001
"OriginalName"="812c7b46-ff71-4d6a-a872-18ade6694961"
"FriendlyName"="Virtual Switch 18-54-500"
"DeviceGuid"="\\Device\\{8CED6D96-ECF8-423B-9A1F-AE249D8D35DE}"
"CurrentMacAddress"=hex:00,1c,c4,46,43,b8
"PermanentMacAddress"=hex:00,1c,c4,46,43,b8

CLUSTER NODE3
[HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\VMSMP\Parameters\NicList\8E9C0
B58-F7C2-484D-A0FC-0E89ED082555]
"SwitchName"="5DD6FFCA-E837-449F-B4B3-398F50E7A831"
"PortName"="D9469203-F0FE-4AA7-BCCB-4854954B1605"
"NicType"=dword:00000001
"OriginalName"="8e9c0b58-f7c2-484d-a0fc-0e89ed082555"
"FriendlyName"="Virtual Switch - VLAN 18-54-500"
"DeviceGuid"="\\Device\\{25AE0C72-73B6-417E-BD91-B8D11072C845}"
"CurrentMacAddress"=hex:00,1a,4b,ff,34,f6
"PermanentMacAddress"=hex:00,1a,4b,ff,34,f6

Em uma configuração de alta disponibilidade em Hyper-V , todos os nós do cluster devem ter exatamente o mesmo Friendly Name para os switches virtuais , pois cada máquina virtual tem isso registrado no seu arquivo de configuração. Quando o failover acontecia não se podia encontrar a rede chamada Virtual Switch 18-54-500 pois o host NODE3 não possuia mesma rede , mas sim este v-switch Virtual Switch - VLAN 18-54-500 assim explicando o erro 21502 com a exceção 0x80070003 .

Aqui está o link do passo a passo para Hyper-V and Failover Clustering , e na parte 3 temos o ponto de configuração da rede virtual e a menção de que os nomes devem ser idênticos.

 

 Step 3: Create a virtual network

You will need to perform this step on both physical computers if you did not create the virtual network when you installed the Hyper-V role. This virtual network provides the highly available virtual machine with access to the physical network. 

To create a virtual network 
1.    Open Hyper-V Manager.
2.    From the Actions menu, click Virtual Network Manager.
3.    Under Create virtual network, select External.
4.    Click Add. The New Virtual Network page appears.
5.    Type a name for the new network. Make sure you use exactly the same name on both servers running Hyper-V.
6.    Under Connection Type, click External and then select the physical network adapter. 
7.    Click OK.

Outra dica muito importante é sempre que fizermos uma modificação em máquinas virtuais em cluster , ou seja VM's como recurso de cluster , deve-se fazer um "Refresh Virtual Machine Configuration" para que os nós do cluster tenham a mesma informação. Para mais informações vejam o seguinte blog.

Obrigado e até a próxima.