[openstack-dev] 回复: Add tap device to ovs bridge when attach aninterface to vm.

thuanqin qthdaidai at qq.com
Mon May 25 07:37:23 UTC 2015


Hi zhi,


I'm diving into nova vif codes this morning so I think I can give you an answer about it.


Your guess is correct. If you use libvirt, you can find a xml file in your nova data directory. You can find following codes in this xml file:


    <interface type="bridge">
      <mac address="fa:16:3e:ff:c5:b6"/>
      <model type="virtio"/>
      <driver name="qemu"/>
      <source bridge="qbr8b77eaa3-00"/>
      <target dev="tap8b77eaa3-00"/>
    </interface>



So, when nova-compute create and start this domain, it will plug dev 'tap8b77eaa3-00' into bridge 'qbr8b77eaa3-00' by libvirtd automatically.


You can get more information from here: https://libvirt.org/formatdomain.html#elementsNICS


------------------ 原始邮件 ------------------
发件人: "zhi";<changzhi1990 at gmail.com>;
发送时间: 2015年5月25日(星期一) 中午1:59
收件人: "openstack-dev"<openstack-dev at lists.openstack.org>; 

主题: [openstack-dev] Add tap device to ovs bridge when attach aninterface to vm.



Hi, all. I want to add tap device to br-ex rather than linux bridge when attaching an interface to a vm. I find some code in nova/virt/libvirt/vif.py in function plug_ovs_hybrid like this " utils.execute('brctl', 'addbr', br_name, run_as_root=True) ". I find no place which add tap device to linux bridge. Does libvirt do it? Could some helps me? thx.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.openstack.org/pipermail/openstack-dev/attachments/20150525/df0a472c/attachment.html>


More information about the OpenStack-dev mailing list