Hi,
I am using the following snippet(based on the code snippet u sent)
OVSDB_REMOTE_ADDR = "tcp:192.168.56.102:6634"
# Initialize a VSCtl instance.
vsctl = ovs_vsctl.VSCtl(OVSDB_REMOTE_ADDR)
# Define a command instance which is equivalent to
# `ovs-vsctl set interface gre0 bfd:enable=true`
cmd = ovs_vsctl.VSCtlCommand('set', ('Interface', 'eth2',
'bfd=enable=true'))
# Run it.
vsctl.run_command([cmd])
The inet address of the remote host in which openvswitch is running is
192.168.56.102.
Thanks and Regards,
Padma V
On Mon, Feb 16, 2015 at 7:47 PM, Wei-Li Tang <[email protected]> wrote:
> 2015-02-16 21:01 GMT+08:00 Padma Jayasankar <[email protected]>:
>
>> Hi,
>> Thanks for the detailed information. I tried with this code. But i am
>> getting some 'protocol error'. i am getting the following error message
>>
>> File "/home/padma/ryu/ryu/app/simple_switch.py", line 87, in
>> _packet_in_handler
>> vsctl.run_command([cmd])
>> File "/usr/local/lib/python2.7/dist-packages/ryu/lib/ovs/vsctl.py",
>> line 1100, in run_command
>> self._run_command(commands)
>> File "/usr/local/lib/python2.7/dist-packages/ryu/lib/ovs/vsctl.py",
>> line 1096, in _run_command
>> self._do_main(commands)
>> File "/usr/local/lib/python2.7/dist-packages/ryu/lib/ovs/vsctl.py",
>> line 1012, in _do_main
>> self._init_schema_helper()
>> File "/usr/local/lib/python2.7/dist-packages/ryu/lib/ovs/vsctl.py",
>> line 897, in _init_schema_helper
>> vswitch_idl.OVSREC_DB_NAME)
>> File "/usr/local/lib/python2.7/dist-packages/ryu/lib/ovs/vsctl.py",
>> line 889, in _rpc_get_schema_json
>> vsctl_fatal(os.strerror(error))
>> File "/usr/local/lib/python2.7/dist-packages/ryu/lib/ovs/vsctl.py",
>> line 132, in vsctl_fatal
>>
>> * raise Exception(msg) # not call ovs.utils.ovs_fatal for
>> reusabilityException: Protocol error*
>>
>> Generally when i execute ovs-vsctl commands in the remote host, i have to
>> run those commands as super user(sudo). Is this error bcoz of that? if so
>> how to execute these cmds as super user? Please clarify.
>>
>
> AFAIK there's no need to be a super user to manage remote host if you
> connect ovsdb via tcp. I can execute the code as a normal user successfully.
>
> How do you connect to your ovsdb server? What is your remote ovsdb server
> address?
>
>
>>
>> Thanks and Regards,
>> Padma V
>>
>>
>>
>> On Sat, Feb 14, 2015 at 11:41 AM, Wei-Li Tang <[email protected]>
>> wrote:
>>
>>> Hello,
>>>
>>> Please refer to the following codes which enables bfd for a gre
>>> interface.
>>>
>>> ===
>>>
>>> from ryu.lib.ovs import vsctl as ovs_vsctl
>>>
>>> # proto:addr where your OVSDB server listens to.
>>> OVSDB_REMOTE_ADDR = "tcp:192.168.0.1:6634"
>>>
>>> # Initialize a VSCtl instance.
>>> vsctl = ovs_vsctl.VSCtl(OVSDB_REMOTE_ADDR)
>>>
>>> # Define a command instance which is equivalent to
>>> # `ovs-vsctl set interface gre0 bfd:enable=true`
>>> cmd = ovs_vsctl.VSCtlCommand('set', ('Interface', 'gre0',
>>> 'bfd=enable=true'))
>>>
>>> # Run it.
>>> vsctl.run_command([cmd])
>>>
>>>
>>> 2015-02-11 14:46 GMT+08:00 Padma Jayasankar <[email protected]>:
>>>
>>>> Hi,
>>>> Thanks for the information. I went through the files in ryu/lib/ovs. I
>>>> thought that i have to use vsctl.py as i have to run ovs-vsctl set
>>>> interface command. But i couldn't understand , hoow to use that? Can u give
>>>> some more information on that.
>>>>
>>>> Thanks and Regards,
>>>> Padma V
>>>>
>>>> On Tue, Feb 10, 2015 at 7:22 AM, Wei-Li Tang <[email protected]>
>>>> wrote:
>>>>
>>>>> 2015-02-09 22:30 GMT+08:00 Padma Jayasankar <[email protected]>:
>>>>>
>>>>>> Hi,
>>>>>> Is it possible to enable bfd for a switch from the controller? I
>>>>>> have to do this dynamically for my project. I am able to do this
>>>>>> statically
>>>>>> using ovs-vsctl commands? Is there any way to do it dynamically from the
>>>>>> controller.
>>>>>>
>>>>>
>>>>> Hi,
>>>>>
>>>>> Are you using an openvswitch? You may do this through OVSDB and take a
>>>>> look at ryu/lib/ovs/ which is an OVSDB interaction library for Ryu.
>>>>>
>>>>>
>>> --
>>> Sincerely,
>>>
>>> Wei-Li Tang
>>> RD Engineer, Xinguard Inc.
>>>
>>
>>
>
>
> --
> Sincerely,
>
> Wei-Li Tang
> RD Engineer, Xinguard Inc.
>
------------------------------------------------------------------------------
Download BIRT iHub F-Type - The Free Enterprise-Grade BIRT Server
from Actuate! Instantly Supercharge Your Business Reports and Dashboards
with Interactivity, Sharing, Native Excel Exports, App Integration & more
Get technology previously reserved for billion-dollar corporations, FREE
http://pubads.g.doubleclick.net/gampad/clk?id=190641631&iu=/4140/ostg.clktrk
_______________________________________________
Ryu-devel mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/ryu-devel