Uploaded image for project: 'netconf'
  1. netconf
  2. NETCONF-52

Using restconf rpc to edit the configuration of netconf enabled device, controller will remove the attribute of content

XMLWordPrintable

    • Icon: Bug Bug
    • Resolution: Unresolved
    • 8.0.0
    • None
    • restconf-nb
    • None
    • Operating System: Linux
      Platform: PC

    • 3930

      ODL Version: Release/Helium-SR3
      Netconf enabled device: OF-CONFIG server for Open vSwitch (https://github.com/openvswitch/of-config)

      I mount a netconf enabled device (name:netconf-device-1), and use edit-config rpc by postman.
      URL: http://controller_ip:8181/restconf/operations/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/ietf-netconf:edit-config
      Method: POST
      Accept: application/xml
      Content-Type: application/xml

      <edit-config>
      <target>
      <candidate/>
      </target>
      <default-operation>none</default-operation>
      <error-option>rollback-on-error</error-option>
      <config>
      <capable-switch xmlns="urn:onf:config:yang">
      <logical-switches>
      <switch>
      <id>ofc-bridge</id>
      <controllers xmlns:a="urn:ietf:params:xml:ns:netconf:base:1.0" a:operation="replace">
      <controller>
      <id>controller-1</id>
      <ip-address>172.19.66.176</ip-address>
      <protocol>tcp</protocol>
      <port>6633</port>
      <local-ip-address>0.0.0.0</local-ip-address>
      </controller>
      </controllers>
      </switch>
      </logical-switches>
      </capable-switch>
      </config>
      </edit-config>

      But the controller removes all attributes of the xml and sends it to the entconf server.
      The netconf server does not know how to process this operation.
      The xml received by netconf server list as below:

      <rpc xmlns="urn:ietf:params:xml:ns:netconf:base:1.0" message-id="m-76">
      <edit-config>
      <target>
      <candidate/>
      </target>
      <default-operation>none</default-operation>
      <error-option>rollback-on-error</error-option>
      <config>
      <capable-switch>
      <logical-switches>
      <switch>
      <id>ofc-bridge</id>
      <controllers>
      <controller>
      <id>controller-1</id>
      <ip-address>172.19.66.176</ip-address>
      <protocol>tcp</protocol>
      <port>6633</port>
      <local-ip-address>0.0.0.0</local-ip-address>
      </controller>
      </controllers>
      </switch>
      </logical-switches>
      </capable-switch>
      </config>
      </edit-config>
      </rpc>

      And ODL responses
      "error-type": "application",
      "error-tag": "operation-failed",
      "error-message": "Request is not applicable to the data managed by the server"

      There is other operation to use for editing controller configuration:

      http://controller_ip:8181/restconf/config/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/of-config:capable-switch/logical-switches/switch/ofc-bridge/controllers
      Method: PUT
      Accept: application/xml
      Content-Type: application/xml
      <controllers>
      <controller>
      <id>controller-1</id>
      <ip-address>172.19.66.176</ip-address>
      <protocol>tcp</protocol>
      <port>6633</port>
      <local-ip-address>0.0.0.0</local-ip-address>
      </controller>
      </controllers>

      Yes, it can edit the controller ip for the entconf enabled switch.
      But this approach will trigger the controller to do two actions continually, edit candidate configuration and then commit from candidate to running.

      If we want to operate the configuration step by step, not continuous actions. Like as
      1. Edit candidate configuration
      2. Verify candidate configuration
      3. Commit

      For the first step, it should operate netconf rpc directly, the restconf api should like as below
      POST http://controller_ip:8181/restconf/operations/opendaylight-inventory:nodes/node/netconf-device-1/yang-ext:mount/ietf-netconf:edit-config

      If we want to modify running configuration directly not edit candidate first, it will also encounter the same issue.

      Best Regards

            Unassigned Unassigned
            ato_wu@yahoo.com.tw dacheng wu
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

              Created:
              Updated: