On 05/28/2014 10:25 AM, Liam MacKenzie wrote:
Hello
I have a virtual server with 3 existing VMs running on it without
issue. The host has 4 NICs installed; em1 for the host, em2 and em3
already in use by other VMs.
I would like to dedicate em4 to my new VM however when I create the
bridge like I did for the others I do not get a vnet3 device show up
in the list as shown below.
I think you are misunderstanding how the vnetX devices come into
existence. They are created automatically when a guest is *started*;
they are *not* created when the guest is being configured and you should
not add a reference to a vnet device anywhere in your config. Rather,
you should select the *bridge device* for the guest's network
connection. (It is actually a bug that virt-manager displays the vnetX
devices in the connection list at all; I had thought that they were now
removed...)
Beyond that, I'm wondering if you really need to completely dedicate a
physical network device to a single guest - once you have a bridge
device, you can connect up to 255 (or maybe 254? I've never gone to the
limit) guests to a single bridge. Of course they share the bandwidth,
but this may be what's happening at your switch anyway (or they may not
have enough traffic for it to matter). So you could save yourself the
trouble of plugging in so many network cards and give yourself more
felxibility by just having a single bridge connected to a single
ethernet, and connect all of your guests to that one bridge.
Alternately, if you want to dedicate each physical card to a single
guest (and not use it for host networking) then you can just select the
"emX macvtap" entry in virt-manager's network connection selection, and
set it to passthrough mode.
I tried using the GUI and virsh to create the bridge. I ended up with
this config:
That's all standard.
[root@cbcvm network-scripts]# cat ifcfg-em4
DEVICE=em4
HWADDR=d4:ae:52:a1:53:a7
ONBOOT=yes
BRIDGE=www_br0
[root@cbcvm network-scripts]# cat ifcfg-www_br0
DEVICE=www_br0
ONBOOT=yes
TYPE=Bridge
STP=on
DELAY=0
[root@cbcvm network-scripts]# virsh iface-list
Name State MAC Address
--------------------------------------------
em1 active d4:ae:52:a1:53:a4
lo active 00:00:00:00:00:00
mon_br0 active d4:ae:52:a1:53:a6
sbs_br0 active d4:ae:52:a1:53:a5
www_br0 active d4:ae:52:a1:53:a7
How to I make the expected vnet3 device become available to my VM?
You tell your guest to connect to whichever bridge device you want, then
start the guest - a "vnetX" device will automatically be created (using
some unused number). That device will attach to the bridge on the front
end, and have a socket connecting to the guest's qemu on the backend.
When the guest is shutdown, the vnetX device will be deleted, and a new
one created the next time the guest is started.
Thanks!