2

I have setup ovs switch on ubuntu and configured network xml and guest VM xml files respectively(Set-up for KVM hypervisor). Created new network for openVswitch by creating and defining new vlans.xml

<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>

edited the guest vm xml file

   <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>

By doing the above changes my guest vm is connected to correct port of ovs bridge, which i verified by running the command sudo ovs-vsctl show and the output is something like this

 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"

However my guest vm's are not assigned any IP ? unable to figure it out. Any help appreciated.

Bruce_Wayne
  • 121
  • 1
  • 5
  • 1
    Why should the OVS bridge assign IPs? It should be a DHCP server on the same network, libvirt uses built-in dnsmasq for the NAT based VMs. – dyasny Nov 27 '14 at 19:17
  • Actually i am trying all this in my institute's network where IP-addresses are assigned according to the registered MAC addresses. Could that be the reason behind this ? if yes, please guide about how to proceed? – Bruce_Wayne Nov 28 '14 at 08:37
  • From which IP-stack the OVS take the IP's from ? will it take from my host network IP-stack only? or can I provide different IP-stack via libvirt to be used by OVS ? – Bruce_Wayne Nov 28 '14 at 10:24

0 Answers0