<div dir="ltr"><div>Hello Jamie,<br><br></div><div>Well, I'm able to ssh from the host to the VM, so we're making progress at least :)<br></div><div><br></div>When I add vnet0 to the in_port= I get the following error:<br>
<div><br>>> root@loki:~# ovs-ofctl add-flow ovsbr0 "in_port=vnet0,dl_src=02:00:44:47:83:43,priority=40000,actions=normal"<br>>> ovs-ofctl: vnet0: bad syntax for in_port<br><br></div><div>When I set in_pot=LOCAL, the command is accepted, but the server is unable to make outbound connections, so I don't think that's the solution:<br>
<br>>> root@loki:~# ovs-ofctl add-flow ovsbr0 "in_port=LOCAL,dl_src=02:00:44:47:83:43,priority=40000,actions=normal"<br><br>>> root@loki:~# ovs-ofctl show ovsbr0<br>>> OFPT_FEATURES_REPLY (xid=0x1): ver:0x1, dpid:000000259030761a<br>
>> n_tables:255, n_buffers:256<br>>> features: capabilities:0xc7, actions:0xfff<br>>> 1(eth0): addr:00:25:90:30:76:1a<br>>> config: 0<br>>> state: 0<br>>> current: 1GB-FD COPPER AUTO_NEG<br>
>> advertised: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG<br>>> supported: 10MB-HD 10MB-FD 100MB-HD 100MB-FD 1GB-FD COPPER AUTO_NEG<br>>> 2(br0): addr:22:de:1a:d5:63:74<br>>> config: 0<br>
>> state: 0<br>>> 7(vnet0): addr:fe:00:44:47:83:43<br>>> config: 0<br>>> state: 0<br>>> current: 10MB-FD COPPER<br>>> 8(vnet1): addr:fe:00:44:47:83:44<br>
>> config: 0<br>>> state: 0<br>>> current: 10MB-FD COPPER<br>>> LOCAL(ovsbr0): addr:00:25:90:30:76:1a<br>>> config: PORT_DOWN<br>>> state: LINK_DOWN<br>
>> OFPT_GET_CONFIG_REPLY (xid=0x3): frags=normal miss_send_len=0<br><br></div><div>I guess I really don't understand what the correct syntax is to create a flow in this manner, so I'm kinda spinning my wheels. (I've been creating ports with `ovs-vsctl add-port`).<br>
<br></div><div>Thanks for all your help,<br></div><div>Jon A<br></div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 10, 2013 at 4:16 PM, Jon <span dir="ltr"><<a href="mailto:three18ti@gmail.com" target="_blank">three18ti@gmail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div dir="ltr"><div><div><div>Hello Jamie,<br><br></div>Thanks for getting back to me.<div class="im"><br><br>>> Yes, brcompat is now no longer required, and we recommend that if you're
using kvm/libvirt you shouldn't enable the brcompat module<br><br></div></div>Awesome, thanks for clarifying that for me.<div class="im"><br><br>>> We recommend doing it like this:
<div>>> oneadmin ALL=(ALL) NOPASSWD: /usr/bin/ovs-ofctl<br><br></div></div><div>Gotcha, so ovs-ofctl is the only command that oneadmin needs to use.<br></div>That makes perfect sense, thanks.<br><br></div>Ok, I'm reporting your steps out of order because I think the pertinent information is this first bit.<br>
<div><br>--5) finally, do $ sudo ovs_ofctl dump-ports ovsbr0 <vnet><br><div><br>Here we go:<br><br>>> root@loki:~# ovs-ofctl dump-ports ovsbr0 vnet0<br>>> OFPST_PORT reply (xid=0x1): 1 ports<br>>> port 7: rx pkts=34, bytes=1644, drop=0, errs=0, frame=0, over=0, crc=0<br>
>> tx pkts=277, bytes=16622, drop=0, errs=0, coll=0<br><br><br>--3) do virsh dumpxml one-<vmid><br><br></div><div>Here's the relevant stanza:<br><br>>> <interface type='bridge'><br>
>> <mac address='02:00:44:47:83:43'/><div class="im"><br>>> <source bridge='ovsbr0'/><br>>> <virtualport type='openvswitch'><br></div>>> <parameters interfaceid='79c73248-4ebf-cc14-9f98-98be2d2a785b'/><br>
>> </virtualport><br>>> <target dev='vnet0'/><br>>> <alias name='net0'/><br>>> <address type='pci' domain='0x0000' bus='0x00' slot='0x03' function='0x0'/><br>
>> </interface><br><br>-- 4) this bit of code should be able to extract the tap interface from the previous output:<br></div><div>Honestly, my ruby is a bit rusty, what do I have to provide as "vm"? is that just the virsh xml config?<br>
<br></div><div>maybe something along the lines of:<br><pre>#!/usr/bin/ruby<br><br>def get_tap(vm)<br> dumpxml = vm.vm_info[:dumpxml]<br> if dumpxml<br> dumpxml_root = REXML::Document.new(dumpxml).root<br>
xpath = "devices/interface[@type='bridge']/"<br> xpath << "mac[@address='#{self[:mac]}']/../target"<br> tap = dumpxml_root.elements[xpath]<br> if tap<br>
self[:tap] = tap.attributes['dev']<br> end<br> end<br> self<br>end<br><br>get_tap(STDIN)<br></pre><br></div><div>then I could:<br><br>>> root@loki:~# virsh dumpxml one-37 | ruby interface.rb <br>
<br></div><div>This results in the following error:<br><br>>> interface.rb:5:in `get_tap': undefined method `vm_info' for #<IO:<STDIN>> (NoMethodError)<br>>> from interface.rb:18:in `<main>'<br>
<br></div><div>so I think my input is not valid... I -think- vm should be some sort of object so maybe the problem is getting from XML to an object of "vm" type?<br><br></div><div>Thanks for the assistance,<br>
</div><div>Jon A<br></div><br><div><br></div><br></div></div><div class="HOEnZb"><div class="h5"><div class="gmail_extra"><br><br><div class="gmail_quote">On Wed, Apr 10, 2013 at 5:01 AM, 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 dir="ltr">Hi,<div> <div class="gmail_extra"><div class="gmail_quote"><div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>I know that previous versions of opennebula required openvswitch-brcompat </div><div><br></div><div>>> <a href="http://opennebula.org/documentation:rel3.8:openvswitch#hosts_configuration" target="_blank">http://opennebula.org/documentation:rel3.8:openvswitch#hosts_configuration</a></div>
<div><br></div><div>but the 4.0 docs seem to indicate that with KVM brcompat is not required:</div><div><br></div><div>>> <a href="http://opennebula.org/documentation:rel4.0:openvswitch#ovswitch_and_ovswitch_brcompat" target="_blank">http://opennebula.org/documentation:rel4.0:openvswitch#ovswitch_and_ovswitch_brcompat</a></div>
<div><br></div><div>Anyway, I did install the openvswitch-brcompat package, but got the same error.</div><div>(looking at the docs now, it seems that you have to tell the OpenNebula to use a different openvswitch driver, </div>
<div>specifically openvswitch_brcompat, so I think this test may have been incomplete)</div><div><br></div></div></blockquote><div><br></div></div><div>Yes, brcompat is now no longer required, and we recommend that if you're using kvm/libvirt you shouldn't enable the brcompat module</div>
<div>
<div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div dir="ltr"><div>
</div><div>Then I attempted to run the ovs command at the command line, when I do so, I get the following error:</div>
<div><br></div><div>>> root@loki:~# sudo /usr/bin/ovs-ofctl add-flow ovsbr0 in_port=,dl_src=02:00:44:47:83:44,priority=40000,actions=normal</div><div>>> ovs-ofctl: dl_src=02:00:44:47:83:44: bad syntax for in_port</div>
<div><br></div><div>I think this might be the root cause of the issue? Where is "in_port" defined? </div><div>I don't see it in the onevnet template, but that doesn't mean I didn't just miss it.</div>
</div></blockquote><div><br></div></div><div>Exactly, that's the root cause, the in_port is not being found correctly. I propose you do this to figure things out:</div><div><br></div><div>1) (in the worker node i.e. 'loki') disable /var/lib/one/remotes/vnm/ovswitch/post by adding exit 0 at line 2 of that script</div>
<div>2) launch the virtual machine, it should get to running</div><div>3) do virsh dumpxml one-<vmid></div><div>4) this bit of code should be able to extract the tap interface from the previous output:</div>
<div><a href="https://github.com/OpenNebula/one/blob/master/src/vnm_mad/remotes/OpenNebulaNic.rb#L59" target="_blank">https://github.com/OpenNebula/one/blob/master/src/vnm_mad/remotes/OpenNebulaNic.rb#L59</a> (get_tap for the NicKVM class)<br>
</div><div>can you try so manually extracting that bit of code and providing the info it needs see if it's working correctly?</div><div>Otherwise, you can figure it out manually, we're looking for something like vnetX (let's call that <vnet>)</div>
<div>5) finally, do</div><div>$ sudo ovs_ofctl dump-ports ovsbr0 <vnet></div><div><div> </div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div dir="ltr"><div>But this seems less than ideal. Also, I think the incorrect syntax is the root cause of the issue, if there are other issues.</div></div></blockquote><div><br></div></div><div>We recommend doing it like this:</div>
<div>oneadmin ALL=(ALL) NOPASSWD: /usr/bin/ovs-ofctl</div><div><br></div><div>cheers,<br>Jaime</div></div><div><div><br></div>-- <br>Jaime Melis<br>Project Engineer<br>OpenNebula - The Open Source Toolkit for Cloud Computing<br>
<a href="http://www.OpenNebula.org" target="_blank">www.OpenNebula.org</a> | <a href="mailto:jmelis@opennebula.org" target="_blank">jmelis@opennebula.org</a>
</div></div></div></div>
</blockquote></div><br></div>
</div></div></blockquote></div><br></div>