在桥上启动 KVM 客户机时主机网络连接挂起

在桥上启动 KVM 客户机时主机网络连接挂起

我有一个 KVM 系统,我在该系统上运行一个网桥,直接连接所有虚拟机和主机操作系统上的 bond0(eth0、eth1)。因此,所有机器都位于同一个子网上,可在机箱外使用。绑定正在执行模式 1 主动/被动,并将 arp_ip_target 设置为默认网关,这本身就引起了一些问题,但我自己看不出绑定配置在这里有什么关系。

当我在平台上停止和启动客户机时,大多数时候我都会看到奇怪的事情,即在主机上,我会失去网络连接(icmp、ssh)约 30 秒。但是,我不会失去其他已在运行的 VM 的连接……它们始终可以 ping 默认 GW,但主机不能。我说“大约 30 秒”,但从一些测试来看,实际上通常是 28 秒(或者至少,我失去了 28 次 ping……),我想知道这是否与桥接配置有关。

我根本没有在网桥上运行 STP,并且转发延迟设置为 1 秒,bond0 上的路径成本降低到 10,bond0 的端口优先级也降低到 1。因此,我认为网桥不应该认为 b​​ond0 未正确连接(正如持续的客户连接所暗示的那样),但网桥设备上的主机 IP(...这有关系吗?)变得无法访问。

我相当确定这与桥接网络有关,但在启动虚拟机时发生这种情况的同时,显然还有很多其他事情发生,所以也许我的判断完全错误。

缺乏连通性:

# ping 10.20.11.254                                          
PING 10.20.11.254 (10.20.11.254) 56(84) bytes of data.                          
64 bytes from 10.20.11.254: icmp_seq=1 ttl=255 time=0.921 ms                    
64 bytes from 10.20.11.254: icmp_seq=2 ttl=255 time=0.541 ms                    
type=1700 audit(1293462808.589:325): dev=vnet6 prom=256 old_prom=0 auid=42949672
95 ses=4294967295                                                               
type=1700 audit(1293462808.604:326): dev=vnet7 prom=256 old_prom=0 auid=42949672
95 ses=4294967295                                                               
type=1700 audit(1293462808.618:327): dev=vnet8 prom=256 old_prom=0 auid=42949672
95 ses=4294967295                                                               
kvm: 14116: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x130079               
kvm: 14116: cpu0 unimplemented perfctr wrmsr: 0xc1 data 0xffdd694a              
kvm: 14116: cpu0 unimplemented perfctr wrmsr: 0x186 data 0x530079               
64 bytes from 10.20.11.254: icmp_seq=30 ttl=255 time=0.514 ms                   
64 bytes from 10.20.11.254: icmp_seq=31 ttl=255 time=0.551 ms                   
64 bytes from 10.20.11.254: icmp_seq=32 ttl=255 time=0.437 ms                   
64 bytes from 10.20.11.254: icmp_seq=33 ttl=255 time=0.392 ms 

相关桥的brctl输出:

# brctl showstp brdev
brdev
 bridge id      8000.b2e1378d1396
 designated root    8000.b2e1378d1396
 root port         0            path cost          0
 max age          19.99         bridge max age        19.99
 hello time        1.99         bridge hello time      1.99
 forward delay         0.99         bridge forward delay       0.99
 ageing time         299.95
 hello timer           0.50         tcn timer          0.00
 topology change timer     0.00         gc timer           0.04
 flags          


vnet5 (3)
 port id        8003            state            forwarding
 designated root    8000.b2e1378d1396   path cost        100
 designated bridge  8000.b2e1378d1396   message age timer      0.00
 designated port    8003            forward delay timer    0.00
 designated cost       0            hold timer         0.00
 flags          

vnet0 (2)
 port id        8002            state            forwarding
 designated root    8000.b2e1378d1396   path cost        100
 designated bridge  8000.b2e1378d1396   message age timer      0.00
 designated port    8002            forward delay timer    0.00
 designated cost       0            hold timer         0.00
 flags          

bond0 (1)
 port id        0001            state            forwarding
 designated root    8000.b2e1378d1396   path cost         10
 designated bridge  8000.b2e1378d1396   message age timer      0.00
 designated port    0001            forward delay timer    0.00
 designated cost       0            hold timer         0.00
 flags          

我确实看到新端口被列为学习,但与转发延迟一致,在循环轮询 brctl 输出时仅持续 1 或 2 秒。

不含示例虚拟机的 ifconfig:

bond0     Link encap:Ethernet  HWaddr D4:85:64:65:FA:4E  
          inet6 addr: fe80::d685:64ff:fe65:fa4e/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:21168629 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9280285 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8777768179 (8.1 GiB)  TX bytes:2671736365 (2.4 GiB)

bradSP1   Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1656 (1.6 KiB)  TX bytes:6592 (6.4 KiB)

brawSP1   Link encap:Ethernet  HWaddr 00:00:00:00:00:00  
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:109 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4996 (4.8 KiB)  TX bytes:6592 (6.4 KiB)

brdev     Link encap:Ethernet  HWaddr B2:E1:37:8D:13:96  
          inet addr:10.20.11.129  Bcast:10.20.11.255  Mask:255.255.255.0
          inet6 addr: fe80::d685:64ff:fe65:fa4e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16663718 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8800468 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3268513274 (3.0 GiB)  TX bytes:2587834869 (2.4 GiB)

brmgtSP1  Link encap:Ethernet  HWaddr 1A:CA:AE:08:1C:42  
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:699322 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:928721301 (885.6 MiB)  TX bytes:6706 (6.5 KiB)

eth0      Link encap:Ethernet  HWaddr D4:85:64:65:FA:4E  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:20412120 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9280285 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8720799421 (8.1 GiB)  TX bytes:2671736365 (2.4 GiB)
          Interrupt:169 Memory:f4000000-f4012800 

eth1      Link encap:Ethernet  HWaddr D4:85:64:65:FA:4E  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:756509 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:56968758 (54.3 MiB)  TX bytes:0 (0.0 b)
          Interrupt:186 Memory:f2000000-f2012800 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3937 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3937 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:6641553 (6.3 MiB)  TX bytes:6641553 (6.3 MiB)

vnet0     Link encap:Ethernet  HWaddr B2:E1:37:8D:13:96  
          inet6 addr: fe80::b0e1:37ff:fe8d:1396/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:59861 errors:0 dropped:0 overruns:0 frame:0
          TX packets:5924530 errors:0 dropped:0 overruns:2 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:6405635 (6.1 MiB)  TX bytes:1987480170 (1.8 GiB)

vnet1     Link encap:Ethernet  HWaddr 1A:CA:AE:08:1C:42  
          inet6 addr: fe80::18ca:aeff:fe08:1c42/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:541798 errors:0 dropped:0 overruns:0 frame:0
          TX packets:61998 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:802746110 (765.5 MiB)  TX bytes:6498514 (6.1 MiB)

使用示例虚拟机的 ifconfig:

bond0     Link encap:Ethernet  HWaddr D4:85:64:65:FA:4E  
          inet6 addr: fe80::d685:64ff:fe65:fa4e/64 Scope:Link
          UP BROADCAST RUNNING MASTER MULTICAST  MTU:1500  Metric:1
          RX packets:21285120 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9291457 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:8948482155 (8.3 GiB)  TX bytes:2673235824 (2.4 GiB)

bradSP1   Link encap:Ethernet  HWaddr 2A:18:E1:2D:1A:EC  
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:36 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:1656 (1.6 KiB)  TX bytes:6592 (6.4 KiB)

brawSP1   Link encap:Ethernet  HWaddr 96:55:AA:14:67:07  
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:109 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:4996 (4.8 KiB)  TX bytes:6592 (6.4 KiB)

brdev     Link encap:Ethernet  HWaddr 16:5C:BC:E5:90:11  
          inet addr:10.20.11.129  Bcast:10.20.11.255  Mask:255.255.255.0
          inet6 addr: fe80::d685:64ff:fe65:fa4e/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:16673094 errors:0 dropped:0 overruns:0 frame:0
          TX packets:8801611 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:3279365967 (3.0 GiB)  TX bytes:2587927761 (2.4 GiB)

brmgtSP1  Link encap:Ethernet  HWaddr 1A:CA:AE:08:1C:42  
          inet6 addr: fe80::200:ff:fe00:0/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:699342 errors:0 dropped:0 overruns:0 frame:0
          TX packets:26 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:928723605 (885.6 MiB)  TX bytes:6706 (6.5 KiB)

eth0      Link encap:Ethernet  HWaddr D4:85:64:65:FA:4E  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:20528382 errors:0 dropped:0 overruns:0 frame:0
          TX packets:9291457 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:8891497316 (8.2 GiB)  TX bytes:2673235824 (2.4 GiB)
          Interrupt:169 Memory:f4000000-f4012800 

eth1      Link encap:Ethernet  HWaddr D4:85:64:65:FA:4E  
          UP BROADCAST RUNNING SLAVE MULTICAST  MTU:1500  Metric:1
          RX packets:756738 errors:0 dropped:0 overruns:0 frame:0
          TX packets:0 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:1000 
          RX bytes:56984839 (54.3 MiB)  TX bytes:0 (0.0 b)
          Interrupt:186 Memory:f2000000-f2012800 

lo        Link encap:Local Loopback  
          inet addr:127.0.0.1  Mask:255.0.0.0
          inet6 addr: ::1/128 Scope:Host
          UP LOOPBACK RUNNING  MTU:16436  Metric:1
          RX packets:3937 errors:0 dropped:0 overruns:0 frame:0
          TX packets:3937 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:0 
          RX bytes:6641553 (6.3 MiB)  TX bytes:6641553 (6.3 MiB)

vnet0     Link encap:Ethernet  HWaddr B2:E1:37:8D:13:96  
          inet6 addr: fe80::b0e1:37ff:fe8d:1396/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:69818 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6034715 errors:0 dropped:0 overruns:2 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:7763947 (7.4 MiB)  TX bytes:2149238089 (2.0 GiB)

vnet1     Link encap:Ethernet  HWaddr 1A:CA:AE:08:1C:42  
          inet6 addr: fe80::18ca:aeff:fe08:1c42/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:650557 errors:0 dropped:0 overruns:0 frame:0
          TX packets:72519 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:964153780 (919.4 MiB)  TX bytes:7896728 (7.5 MiB)

vnet2     Link encap:Ethernet  HWaddr AA:4B:22:76:D2:EC  
          inet6 addr: fe80::a84b:22ff:fe76:d2ec/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:10521 errors:0 dropped:0 overruns:0 frame:0
          TX packets:108765 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:1398214 (1.3 MiB)  TX bytes:161408138 (153.9 MiB)

vnet3     Link encap:Ethernet  HWaddr 96:55:AA:14:67:07  
          inet6 addr: fe80::9455:aaff:fe14:6707/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 b)  TX bytes:468 (468.0 b)

vnet4     Link encap:Ethernet  HWaddr 2A:18:E1:2D:1A:EC  
          inet6 addr: fe80::2818:e1ff:fe2d:1aec/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:6 errors:0 dropped:0 overruns:0 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 b)  TX bytes:468 (468.0 b)

vnet5     Link encap:Ethernet  HWaddr 16:5C:BC:E5:90:11  
          inet6 addr: fe80::145c:bcff:fee5:9011/64 Scope:Link
          UP BROADCAST RUNNING MULTICAST  MTU:1500  Metric:1
          RX packets:0 errors:0 dropped:0 overruns:0 frame:0
          TX packets:241 errors:0 dropped:0 overruns:1 carrier:0
          collisions:0 txqueuelen:500 
          RX bytes:0 (0.0 b)  TX bytes:47167 (46.0 KiB)

欢迎提供所有指点、提示或启发。

答案1

您能发布ifconfig -a启动虚拟机之前和之后的信息吗?

答案2

我运行的几乎是相同的设置,但遇到了相同的问题(同样没有使用 STP)。当我运行更多 VM 时,问题几乎消失了。主机保持可用。您可以尝试在后台从主机 ping 您的网关,然后尝试通过停止/销毁 VM 来重现该问题吗?这似乎对我有用。我认为,如果主机或主机上的 VM 在同一个 VLAN 或桥上发出信号,则会触发某些操作以保持主机本身可用。

相关内容