重新审视libvirt-ovs配置vlan问题

原文:http://blog.scottlowe.org/2012/11/12/libvirt-ovs-integration-revisited/

A few days ago, I posted an article about using VLANs with Open vSwitch (OVS) and libvirt. In that article, I stated that libvirt 1.0.0 was needed. Unfortunately (or maybe fortunately?), I was wrong. The libvirt-OVS integration works in earlier versions, too.

In my earlier OVS-libvirt post, I supplied this snippet of XML to define a libvirt network that you could use with OVS:

123456789101112131415161718192021222324
         
         
<network>
<name>ovs-network</name>
<forward mode='bridge'/>
<bridge name='ovsbr0'/>
<virtualport type='openvswitch'/>
<portgroup name='vlan-01' default='yes'>
</portgroup>
<portgroup name='vlan-02'>
<vlan>
<tag id='2'/>
</vlan>
</portgroup>
<portgroup name='vlan-03'>
<vlan>
<tag id='3'/>
</vlan>
</portgroup>
<portgroup name='vlan-all'>
<vlan trunk='yes'>
<tag id='2'/>
<tag id='3'/>
</vlan>
</portgroup>
</network>
view raw libvirt-xml-ovs hosted with ❤ by  GitHub

You would use that libvirt network definition in conjunction with a domain configuration like this:

1234
         
         
<interface type='network'>
<mac address='11:22:33:44:55:66'/>
<source network='ovs-network' portgroup='vlan-02'/>
</interface>
view raw domain-libvirt-xml-ovs hosted with ❤ by  GitHub

I just tested this on Ubuntu 12.04.1 with libvirt 0.10.2, and it worked just fine. I think the problems I experienced in my earlier testing were all related to incorrect XML configurations. Some other write-ups of the libvirt-OVS integration seem to imply that you need to use the profileid parameter to link the domain XML configuration and the network XML configuration, but my testing seems to show that the real link is the portgroup name.

I haven’t yet tested this on earlier versions of libvirt, but I can confirm that it works with Ubuntu 12.04 using manually compiled versions of libvirt 0.10.2 and libvirt 1.0.0.

If anyone has any additional information to share, please speak up in the comments.



评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值