On 09/03/2012 06:41 AM, yue wang wrote:
Hi:
i used to use linux bridge and specify interfaces
by 'Generic ethernet connection' mode,after
reading this page:
http://libvirt.org/formatdomain.html#elementsNICS
Actually, for a standard linux bridge, you should be using <interface
type='bridge'> rather than <interface type='ethernet'>
("generic
ethernet connection"):
http://www.libvirt.org/formatdomain.html#elementsNICSBridge
type='ethernet' should only be used if there is some special setup that
can't be taken care of by the standard types; type='ethernet' requires
special permissions that aren't normally required, and "taints" the
guest - it's considered to be unsupported.
i am not sure if i need to change to another
mode(eg:'virtual network') to specify interfaces
when switching linux bridge to open vswitch?
any suggestions?
As long as your libvirt version is new enough (0.9.11 or newer), you can
continue to use <interface type='bridge'> (as you should have previously
been), and add a <virtualport type='openvswitch'> element to the
interface definition. For example, if you were previously using a linux
bridge at br0, you would have have used:
<interface type='bridge'>
<source bridge='br0'/>
...
</interface>
and if you switch to using an Open vSwitch bridge named ovsbr0, you
would change that to:
<interface type='bridge'>
<source bridge='ovsbr0'/>
<virtualport type='openvswitch'/>
...
</interface>
(you will notice that after you've edited you interface definition like
this, libvirt will automatically add a "<parameters interfaceid="[some
uuid string]"/> to the <virtualport> element. This is so that the
guest's interface can be known by a stable id that won't change as the
guest is stopped/restarted/migrated.)
If your libvirt is older than 0.9.11,you will need to either use the
Open vSwitch compatibility library to make your Open vSwitch bridge
appear to be a standard Linux host bridge, *or* you wil need to use
<interface type='ethernet'> along with an ifup script. I would
*strongly* recommend that you upgrade to 0.9.11+ if at all possible.