<div class="gmail_extra">Hello Jaime,<br><br><div class="gmail_quote">On Tue, Apr 24, 2012 at 4:19 PM, Jaime Melis <span dir="ltr"><<a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="gmail_extra"><br></div><div class="gmail_extra">If you're using virbr0, it means you're using the bridge created by libvirt, which isn't the best approach.</div>
<div class="gmail_extra">...</div><div class="gmail_extra">Imagine your hosts are all connected through the eth0 interface (they all have eth0 and they're all plugged in to the same switch). You have to create a bridge (for instance br0) and attach eth0 to br0. Then, you need to use br0 as your bridge in your network definition.</div>
<div class="gmail_extra"><br></div><div class="gmail_extra">If eth0 used to have an ip, now you should set:</div><div class="gmail_extra">$ ifconfig eth0 0.0.0.0 up</div><div class="gmail_extra">$ ifconfig br0 <yourip>/<yournetmask> up</div>
</blockquote><div><br></div><div><br></div><div>I think I followed your instructions, but this is still not working as I expect.</div><div>I created a new bridge, br0 and attached it to eth0. Before deploying a VM in this host, ifconfig shows the following:</div>
<div><br></div><div><div>br0 Link encap:Ethernet HWaddr 00:24:81:b4:59:ea </div><div> inet addr:192.168.128.100 Bcast:192.168.255.255 Mask:255.255.0.0</div><div> inet6 addr: fe80::224:81ff:feb4:59ea/64 Scope:Link</div>
<div> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1</div><div> RX packets:3121589 errors:0 dropped:0 overruns:0 frame:0</div><div> TX packets:1695191 errors:0 dropped:0 overruns:0 carrier:0</div>
<div> collisions:0 txqueuelen:0 </div><div> RX bytes:17388947109 (17.3 GB) TX bytes:119234875 (119.2 MB)</div><div><br></div><div>eth0 Link encap:Ethernet HWaddr 00:24:81:b4:59:ea </div><div> inet6 addr: fe80::224:81ff:feb4:59ea/64 Scope:Link</div>
<div> UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1</div><div> RX packets:12456040 errors:0 dropped:612 overruns:0 frame:0</div><div> TX packets:1695652 errors:0 dropped:0 overruns:0 carrier:0</div>
<div> collisions:0 txqueuelen:1000 </div><div> RX bytes:18098932654 (18.0 GB) TX bytes:126060179 (126.0 MB)</div><div> Interrupt:16 </div><div><br></div><div>lo Link encap:Local Loopback </div>
<div> inet addr:127.0.0.1 Mask:255.0.0.0</div><div> inet6 addr: ::1/128 Scope:Host</div><div> UP LOOPBACK RUNNING MTU:16436 Metric:1</div><div> RX packets:490 errors:0 dropped:0 overruns:0 frame:0</div>
<div> TX packets:490 errors:0 dropped:0 overruns:0 carrier:0</div><div> collisions:0 txqueuelen:0 </div><div> RX bytes:110476 (110.4 KB) TX bytes:110476 (110.4 KB)</div><div><br></div><div>virbr0 Link encap:Ethernet HWaddr d2:29:38:84:e5:bf </div>
<div> inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0</div><div> UP BROADCAST MULTICAST MTU:1500 Metric:1</div><div> RX packets:0 errors:0 dropped:0 overruns:0 frame:0</div>
<div> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0</div><div> collisions:0 txqueuelen:0 </div><div> RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)</div></div><div><br></div><div><br></div><div>
The bridge br0 is correctly attached to eth0:</div>
<div><br></div><div><div>oneadmin@newcluster-0:~$ brctl show</div><div>bridge name<span class="Apple-tab-span" style="white-space:pre"> </span>bridge id<span class="Apple-tab-span" style="white-space:pre"> </span>STP enabled<span class="Apple-tab-span" style="white-space:pre"> </span>interfaces</div>
<div>br0<span class="Apple-tab-span" style="white-space:pre"> </span>8000.002481b459ea<span class="Apple-tab-span" style="white-space:pre"> </span>no<span class="Apple-tab-span" style="white-space:pre"> </span>eth0</div>
<div>virbr0<span class="Apple-tab-span" style="white-space:pre"> </span>8000.000000000000<span class="Apple-tab-span" style="white-space:pre"> </span>yes<span class="Apple-tab-span" style="white-space:pre"> </span></div>
</div><div><br></div><div><br></div><div>the bridge virbr0 was created by libvirt when it was installed, i guess. </div><div>Should I remove it ?</div><div><br></div><div>Now, I deploy a VM on this host. The intended VM IP is 10.0.0.1. Given the chosen MAC prefix of 02:00, the expected mac address is. </div>
<div>This is what ifconfig shows when a VM is deployed:</div><div><br></div><div><br></div><div><div>$ ifconfig </div><div>br0 Link encap:Ethernet HWaddr 00:24:81:b4:59:ea </div><div> inet addr:192.168.128.100 Bcast:192.168.255.255 Mask:255.255.0.0</div>
<div> inet6 addr: fe80::224:81ff:feb4:59ea/64 Scope:Link</div><div> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1</div><div> RX packets:3121136 errors:0 dropped:0 overruns:0 frame:0</div><div>
TX packets:1694908 errors:0 dropped:0 overruns:0 carrier:0</div><div> collisions:0 txqueuelen:0 </div><div> RX bytes:17388903328 (17.3 GB) TX bytes:119185044 (119.1 MB)</div><div><br></div><div>
eth0 Link encap:Ethernet HWaddr 00:24:81:b4:59:ea </div><div> inet6 addr: fe80::224:81ff:feb4:59ea/64 Scope:Link</div><div> UP BROADCAST RUNNING PROMISC MULTICAST MTU:1500 Metric:1</div><div> RX packets:12455384 errors:0 dropped:605 overruns:0 frame:0</div>
<div> TX packets:1695364 errors:0 dropped:0 overruns:0 carrier:0</div><div> collisions:0 txqueuelen:1000 </div><div> RX bytes:18098863628 (18.0 GB) TX bytes:126007486 (126.0 MB)</div><div> Interrupt:16 </div>
<div><br></div><div>lo Link encap:Local Loopback </div><div> inet addr:127.0.0.1 Mask:255.0.0.0</div><div> inet6 addr: ::1/128 Scope:Host</div><div> UP LOOPBACK RUNNING MTU:16436 Metric:1</div>
<div> RX packets:490 errors:0 dropped:0 overruns:0 frame:0</div><div> TX packets:490 errors:0 dropped:0 overruns:0 carrier:0</div><div> collisions:0 txqueuelen:0 </div><div> RX bytes:110476 (110.4 KB) TX bytes:110476 (110.4 KB)</div>
<div><br></div><div>virbr0 Link encap:Ethernet HWaddr d2:29:38:84:e5:bf </div><div> inet addr:192.168.122.1 Bcast:192.168.122.255 Mask:255.255.255.0</div><div> UP BROADCAST MULTICAST MTU:1500 Metric:1</div>
<div> RX packets:0 errors:0 dropped:0 overruns:0 frame:0</div><div> TX packets:0 errors:0 dropped:0 overruns:0 carrier:0</div><div> collisions:0 txqueuelen:0 </div><div> RX bytes:0 (0.0 B) TX bytes:0 (0.0 B)</div>
<div><br></div><div>vnet0 Link encap:Ethernet HWaddr fe:00:0a:00:00:01 </div><div> inet6 addr: fe80::fc00:aff:fe00:1/64 Scope:Link</div><div> UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1</div>
<div> RX packets:239 errors:0 dropped:0 overruns:0 frame:0</div><div> TX packets:1146 errors:0 dropped:0 overruns:0 carrier:0</div><div> collisions:0 txqueuelen:500 </div><div> RX bytes:16270 (16.2 KB) TX bytes:75554 (75.5 KB)</div>
</div><div><br></div><div><br></div><div>I see how the vnet0 interface has the expected mac address. </div><div>The VM was started with this command (seen via ps aux):</div><div><br></div><div><div>/usr/bin/kvm -S -M pc-0.14 -cpu qemu32 -enable-kvm -m 128 -smp 1,sockets=1,cores=1,threads=1 -name one-49 -uuid d09f1a8a-dccf-e721-a904-fd14ee3a308f -nodefconfig -nodefaults -chardev socket,id=charmonitor,path=/var/lib/libvirt/qemu/one-49.monitor,server,nowait -mon chardev=charmonitor,id=monitor,mode=readline -rtc base=utc -boot c -drive file=/var/lib/one//datastores/0/49/disk.0,if=none,id=drive-ide0-0-0,format=raw -device ide-drive,bus=ide.0,unit=0,drive=drive-ide0-0-0,id=ide0-0-0 -netdev tap,fd=19,id=hostnet0 -device rtl8139,netdev=hostnet0,id=net0,mac=02:00:0a:00:00:01,bus=pci.0,addr=0x3 -usb -vnc <a href="http://0.0.0.0:34100">0.0.0.0:34100</a> -vga cirrus -device virtio-balloon-pci,id=balloon0,bus=pci.0,addr=0x4</div>
</div><div><br></div><div>This is what is shown by "brctl show" at this moment:</div><div><br></div><div><div> brctl show</div><div>bridge name<span class="Apple-tab-span" style="white-space:pre"> </span>bridge id<span class="Apple-tab-span" style="white-space:pre"> </span>STP enabled<span class="Apple-tab-span" style="white-space:pre"> </span>interfaces</div>
<div>br0<span class="Apple-tab-span" style="white-space:pre"> </span>8000.002481b459ea<span class="Apple-tab-span" style="white-space:pre"> </span>no<span class="Apple-tab-span" style="white-space:pre"> </span>eth0</div>
<div><span class="Apple-tab-span" style="white-space:pre"> </span>vnet0</div><div>virbr0<span class="Apple-tab-span" style="white-space:pre"> </span>8000.000000000000<span class="Apple-tab-span" style="white-space:pre"> </span>yes<span class="Apple-tab-span" style="white-space:pre"> </span></div>
</div><div><br></div><div>(there's an empty line after br0 that ends with vnet0)</div><div><br></div><div>The problem with the above scenario is (apparently) I have no way to log into the VM. </div><div>Although the VNC icon is clickable and i got a message saying "VM startvnc: 48", nothing shows up. </div>
<div>The oned logs do not show any error.</div><div>The user oneadmin can still ssh into the host.</div><div><br></div><div>Therefore...i'm stuck with this situation..so close to the achievement :-/</div></div></div>