Hi, recently I installed Openvswitch 2.1.0 and KVM for a CentOS 6.5 host, and 
created a VM with qemu-kvm command. Every thing looks find but can't get IP 
address from DHCP. I'm listing the steps I did here, hope anyone can point out 
what I missed.

1. Install KVM
...(installation)

2. Remove default bridge and start libvirtd daemon
...

# service libvirtd status
libvirtd (pid  1950) is running...



3. Install and start openvswitch daemon.
...(installation)
# service openvswitch status
ovsdb-server is running with pid 1299
ovs-vswitchd is running with pid 1309

# ovs-vsctl add-br br0
# ovs-vsctl show
409b63f5-36d3-4bac-a490-8f63e2cce0c7
    Bridge "br0"
        Port "br0"
            Interface "br0"
                type: internal
    ovs_version: "2.1.0


4. Config and restart NIC:

# vi /etc/sysconfig/network-scripts/ifcfg-eth0
DEVICE="eth0"
NM_CONTROLLED="yes"
ONBOOT="yes"
IPV6INIT=no
TYPE="OVSPort"
DEVICETYPE="ovs"
OVS_BRIDGE=br0

# vi /etc/sysconfig/network-scripts/ifcfg-br0
DEVICE=br0
HWADDR=00:22:19:13:FB:64
TYPE=OVSBridge
DEVICETYPE="ovs"
UUID=2b794195-debf-4b2a-944f-bc03530b7c86
ONBOOT=yes
NM_CONTROLLED=yes
BOOTPROTO=dhcp

# ovs-vsctl add-port br0 eth0; service network restart; service openvswitch 
restart

# sudo ovs-vsctl show
409b63f5-36d3-4bac-a490-8f63e2cce0c7
    Bridge "br0"
        Port "br0"
            Interface "br0"
                type: internal
        Port "eth0"
            Interface "eth0"
    ovs_version: "2.1.0"

# ifconfig
br0      Link encap:Ethernet  HWaddr 00:22:19:13:FB:64
            inet addr:192.168.1.98  Bcast:192.168.1.255  Mask:255.255.255.0
            ...
lo         Link encap:Local Loopback
            inet addr:127.0.0.1  Mask:255.0.0.0
            ...

eth0 has gone! the IP assigned to eth0 now is bundled with br0. Looks great.



5. create up/down scripts for KVM
# vi /etc/qemu-ifup

#!/bin/sh
switch='br0'
/sbin/ifconfig $1 0.0.0.0 up
ovs-vsctl add-port ${switch} $1


# vi /etc/qemu-ifdown
#!/bin/sh
switch='br0'
/sbin/ifconfig $1 0.0.0.0 down
ovs-vsctl del-port ${switch} $1


6. Start KVM
# virsh vol-create-as default CentOS_v6.5.img 8192M
# sudo /usr/libexec/qemu-kvm -m 1024 \
    -daemonize \
    -vga qxl -spice port=5910,addr=0.0.0.0,disable-ticketing \
   -drive file=/var/lib/libvirt/images/CentOS_v6.5.img \
   -cdrom /var/isos/CentOS-6.5-x86_64-bin-DVD1.iso \
   -net nic,model=virtio,macaddr=52:54:00:93:06:08,netdev=nic-0 \
   -netdev tap,id=nic-0


# ovs-vsctl show
409b63f5-36d3-4bac-a490-8f63e2cce0c7
    Bridge "br0"
        Port "eth0"
            Interface "eth0"
        Port "tap0"
            Interface "tap0"
        Port "br0"
            Interface "br0"
                type: internal
    ovs_version: "2.1.0"


tap0 port has been added to br0


# ifconfig
br0

             ...(same as above)
lo
             ...(same as above)
tap0      Link encap:Ethernet  HWaddr B6:16:C9:E6:2E:E9
             inet6 addr: fe80::b416:c9ff:fee6:2ee9/64 Scope:Link
             ....

The first question here is the MAC address for tap0 is different to the one 
sent for KVM, and it changed every time when I ran the command


Second question is, yes you can see there's not IP assigned.



7. In the guest
# ifconfig
lo
            ...

eth0     Link encap: Ethernet HWaddr 52:54:00:93:06:08
            inet6 addr: fe80::5054:ff:fe93:608/64 Scope:Link
            ...

# service network restart
...
Determining IP information for eth0... failed         [FAILED]



As you can see, there's no IP in the guest either, but the MAC address is 
correct !

I already spent 3 days to try to figure out what's wrong with my steps but 
failed. Please! any advice is appreciated.


Yours

Jeff
_______________________________________________
discuss mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/discuss

Reply via email to