Table of Contents
This spec addresses following enhancement in Openflowplugin module:
Addition of user triggered reconciliation via karaf cli command or rpc in Openflowplugin.
Whenever there is a state (flow/group) mismatch between config inventory and Openflow switch, user has to either restart the Openflow switch or odl controller. This will sync the state again between odl controller and Openflow switch.
User can trigger reconciliation to sync the state between controller and Openflow switch. It can be done either via karaf cli command or rest rpc.
Reconciliation alarm will be generated whenever user trigger the reconciliation via cli command or rest rpc and the same will be cleared once reconciliation is completed.
Karaf CLI command will be added to trigger reconciliation for the given Openflow nodes. Rest rpc will be exposed to trigger reconciliation for the given Openflow nodes.
Feature odl-openflowplugin-app-southbound-cli should be installed in order to get these karaf cli and rest rpc. This feature is not part of any existing openflowplugin features and has to be installed explicitly by user.
Ref: Southbound CLI
Below two CLIs will be added,
None
container reconciliation-counter {
description "Number of reconciliation triggered for openflow nodes";
config false;
list reconcile-counter {
key node-id;
uses counter;
}
}
grouping counter {
leaf node-id {
type uint64;
}
leaf success-count {
type uint32;
default 0;
}
leaf failure-count {
type uint32;
default 0;
}
leaf last-request-time {
description "Timestamp when reconciliation was last requested";
type string;
}
}
container reconciliation-state {
description "Reconciliation state for the given openflow nodes";
config false;
list reconciliation-state-list {
key node-id;
uses node-reconcile-state;
}
}
grouping node-reconcile-state {
leaf node-id {
type uint64;
}
leaf state {
description "Expresses the current state of the reconcile on a specific NODE";
type enumeration {
enum IN_PROGRESS;
enum COMPLETED;
enum FAILED;
}
}
}
rpc reconcile {
description "Request the reconciliation for given device or set of devices to the controller."
input {
leaf-list nodes {
description "List of nodes to be reconciled";
type uint64;
}
leaf reconcile-all-nodes {
description "Flag to indicate that all nodes to be reconciled";
type boolean;
mandatory false;
default false;
}
}
output {
leaf result {
type boolean;
}
leaf-list inprogress-nodes {
description "List of nodes that are already in reconciling mode";
type uint64;
}
}
}
Flourine
Disconnect the device from controller and reconnect or restart the controller.
Install odl-openflowplugin-app-southbound-cli
feature.
Trigger reconciliation for a connected openflow node via cli command openflow:reconcile
.
opendaylight-user@root>openflow:reconcile 244711506862915
reconcile successfully completed for the nodes
Trigger reconciliation for all the connected openflow nodes via cli command openflow:reconcile -all
.
opendaylight-user@root>openflow:reconcile -all
reconcile successfully completed for the nodes
Get details about number of times user triggered reconciliation for openflow nodes via openflow:getreconciliationcount
.
opendaylight-user@root>openflow:getreconcilecount
NodeId ReconcileSuccessCount ReconcileFailureCount LastReconcileTime
------------------------------------------------------------------------------------------------
244711506862915 2 0 2018-06-06T11:51:51.989
Trigger reconciliation for a single datapath node.
POST /restconf/operations/reconciliation:reconcile
{
"input" : {
"nodes":["244711506862915"]
}
}
Get reconciliation counter details
GET /restconf/operational/reconciliation:reconciliation-counter
OUTPUT:
=======
Request URL
http://localhost:8181/restconf/operational/reconciliation:reconciliation-counter
Response Body
{
"reconciliation-counter": {
"reconcile-counter": [
{
"node-id": 244711506862915,
"success-count": 4,
"last-request-time": "2018-06-06T12:09:53.325"
}
]
}
}
Trigger reconciliation for a openflow switch using routed rpc. This rpc will be exposed without installing southbound-cli feature and user can trigger reconciliation for the given Openflow node. This will not affect the counter and alarm.
POST /restconf/operations/reconciliation:reconcile-node
{
"input": {
"nodeId": "244711506862915",
"node": "/opendaylight-inventory:nodes/opendaylight-inventory:node[opendaylight-inventory:id='openflow:244711506862915']"
}
}
Request URL
http://localhost:8181/restconf/operations/reconciliation:reconcile-node
Response Body
{
"output": {
"result": true
}
}
Primary assignee:
Contributors:
No new dependencies.
None