KVM 虚机热添加网卡

KVM 虚机怎么热添加网卡

查看当前虚机有几块网卡 

virsh domiflist  虚机名  

root@testyk:~# virsh domiflist test-vm
Interface Type Source Model MAC
-------------------------------------------------------
vnet0 bridge br-oam rtl8139 52:54:00:81:19:e1
vnet1 bridge br-oam rtl8139 52:54:00:71:e8:57

热添加网卡    (添加完网卡需要手动配置新添加得网卡配置文件)

virsh attach-interface test-vm(虚机名) --type bridge (网卡类型) --source br-oam (网桥名)--model  rtl8139  (驱动模式)--live --config

--type   网卡类型

--source   宿主机的网卡

--model    驱动模式

--live    在线添加

--config  保存到配置文件

热删除网卡

virsh detach-interface test-vm --type bridge --mac 52:54:00:82:99:a4 --config

原文地址:https://www.cnblogs.com/yk0625/p/14027582.html