Search code examples
opendaylightopenflow

Error while adding flow using OpenDaylight REST API


I have an OpenDaylight controller set up as the mechanism driver in an OpenStack cloud. The installation was done with DevStack in an all-in-one virtual machine.

Everything is working fine. I have two VM in my OpenStack cloud and they can ping each other. Then I want to add a new flow to my Open vSwitch, I have the following error:

curl -u admin:admin -H 'Content-Type: application/yang.data+xml' -X PUT -d @flow_data.xml http://192.168.100.100:8181/restconf/config/opendaylight-inventory:nodes/node/openflow:1/table/234/flow/100770 | python -m json.tool
  % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
                                 Dload  Upload   Total   Spent    Left  Speed
100  1347    0   638  100   709  42078  46761 --:--:-- --:--:-- --:--:-- 50642
{
    "errors": {
        "error": [
            {
                "error-info": "Data from case (urn:opendaylight:flow:inventory?revision=2013-08-19)output-action-case are specified but other data from case (urn:opendaylight:flow:inventory?revision=2013-08-19)drop-action-case were specified earlier. Data aren't from the same case.",
                "error-message": "Error parsing input: Data from case (urn:opendaylight:flow:inventory?revision=2013-08-19)output-action-case are specified but other data from case (urn:opendaylight:flow:inventory?revision=2013-08-19)drop-action-case were specified earlier. Data aren't from the same case.",
                "error-tag": "malformed-message",
                "error-type": "protocol"
            }
        ]
    }
}

flow_data.xml :

<?xml version="1.0"?>
<flow xmlns="urn:opendaylight:flow:inventory">
  <priority>14865</priority>
  <flow-name>jpsampleFlow</flow-name>
  <idle-timeout>12000</idle-timeout>
  <match>
    <ethernet-match>
      <ethernet-type>
        <type>2048</type>
      </ethernet-type>
    </ethernet-match>
    <ipv4-source>10.0.0.1/32</ipv4-source>
    <ipv4-destination>10.0.0.2/32</ipv4-destination>
    <ip-match>
      <ip-dscp>28</ip-dscp>
    </ip-match>
  </match>
  <id>9</id>
  <table_id>0</table_id>
  <instructions>
    <instruction>
      <order>6555</order>
    </instruction>
    <instruction>
      <order>0</order>
      <apply-actions>
        <action>
          <order>0</order>
          <drop-action/>
          <output-action>
            <output-node-connector>1</output-node-connector>
          </output-action>
        </action>
      </apply-actions>
    </instruction>
  </instructions>
</flow>

Any idea what am I doing wrong ? Thank you.


Solution

  • you have one action to drop and another action to forward. aren't those mutually exclusive? try without one or the other.