在KVMpipe理程序上使用时,Open-VSwitch网桥如何将IP地址分配给guest虚拟机?

我已经安装ovs切换在Ubuntu和分别configurationnetworkingxml和来宾虚拟机xml文件(设置为KVMpipe理程序)。 通过创build和定义新的vlans.xml为openVswitch创build了新的networking

<network> <name>vlans</name> <uuid>9c6e3f37-f2b9-447d-a62f-a06e31e7e4f3</uuid> <forward mode='bridge'/> <bridge name='mybridge'/> <virtualport type='openvswitch'/> <portgroup name='vport1'> <vlan> <tag id='1'/> </vlan> </portgroup> <portgroup name='vport2'> <vlan> <tag id='2'/> </vlan> </portgroup> </network> 

编辑guest vm xml文件

  <interface type='network'> <mac address='XX:XX:XX:XX:XX:XX'/> <source network='vlans' portgroup='vport1'/> <virtualport type='openvswitch'> <parameters interfaceid='439c8b58-4752-437f-ac46-62994360bbb4'/> </virtualport> <model type='virtio'/> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/> </interface> 

通过执行上述更改,我的guest虚拟机连接到正确的ovs桥的端口,我通过运行命令sudo ovs-vsctl show和输出是这样的东西

  Bridge mybridge Port "eth0" Interface "eth0" Port "vnet0" tag: 1 Interface "vnet0" Port "vport2" Interface "vport2" Port mybridge Interface mybridge type: internal Port "vport1" Interface "vport1" ovs_version: "2.0.2" 

然而,我的guest虚拟机没有分配任何IP? 无法弄清楚。 任何帮助赞赏。