JIRA: OVSDB-482
Currently the Hwvtep TransactionHistory is not collected for some of the important
hwvtep tables/objects like Global,PhysicalSwitch, Manager etc.
Collecting these information in the TransactionHistory will help in analyzing/debugging
the issue by looking at the karaf cli command instead of logging and looking at the switch.
Sample output
opendaylight-user@root>hwvtep:txlog -nodeid hwvtep://uuid/
f800aea8-f7c7-4f61-ae71-
fe8b5813bd25
Printing for Node : hwvtep://uuid/
f800aea8-f7c7-4f61-ae71-
fe8b5813bd25
Fri Jan 10 06:12:08 UTC 2020 DEVICE ADD ClientConnected [port=58030]
Fri Jan 10 06:12:08 UTC 2020 DEVICE ADD Global : Row [columns={other_config=[other_config={}], switches=[switches=[
ca786e4b-3355-423d-8bd2-
c7645193e8d7]], _uuid=[_uuid=
f800aea8-f7c7-4f61-ae71-
fe8b5813bd25], managers=[managers=[
7f75566c-6181-4059-b33f-
dfd326bf3499]]}]
Fri Jan 10 06:12:08 UTC 2020 DEVICE ADD Physical_Switch : Row [columns={tunnels=[tunnels=[]], tunnel_ips=[tunnel_ips=[172.18.0.7]], other_config=[other_config={}], management_ips=[management_ips=[]], name=[name=s3], description=[description=OVS VTEP Emulator], _uuid=[_uuid=
ca786e4b-3355-423d-8bd2-
c7645193e8d7], ports=[ports=[
d6b07d34-c924-430c-aaa2-
c3679287adeb,
e600b737-22ea-489a-9232-
0d64ee787b43,
d724ca83-c192-46fa-8d71-
fbcfbfffd579,
1d3a727f-4d37-466f-9e2c-
06ffa006636c,
2ce0fec1-9231-4b31-ba6c-
bec80ab8ca8f,
0939560b-02f1-4ce0-9ef5-
db1cd8de4c90,
09a9235b-021f-4988-8c94-
5173de4e56d7,
f8625113-f3ab-40fe-99eb-
83709456e80d,
083feeec-a272-4d7f-a55d-
04b126d9de43]], switch_fault_status=[switch_fault_status=[]]}]
Fri Jan 10 06:12:08 UTC 2020 DEVICE ADD Manager : Row [columns={is_connected=[is_connected=false], other_config=[other_config={ha_id=s3, ha_enabled=true}], max_backoff=[max_backoff=[]], _uuid=[_uuid=
7f75566c-6181-4059-b33f-
dfd326bf3499], inactivity_probe=[inactivity_probe=[]], target=[target=tcp:172.18.0.3:6640]}]
Signed-off-by: Chandra Shekar S <chandra.shekar.s@ericsson.com>
Change-Id: Ifeaa84087cb625004d6c27daeec8b04b04eb9ed0
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
import org.opendaylight.ovsdb.schema.hardwarevtep.Global;
+import org.opendaylight.ovsdb.utils.mdsal.utils.TransactionType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentationBuilder;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
nodeBuilder.addAugmentation(HwvtepGlobalAugmentation.class, hwvtepGlobalAugmentation);
transaction.merge(LogicalDatastoreType.OPERATIONAL, nodePath, nodeBuilder.build());
getOvsdbConnectionInstance().setHwvtepGlobalAugmentation(hwvtepGlobalAugmentation);
+ addToDeviceUpdate(TransactionType.ADD, hwvtepGlobal);
+ LOG.info("DEVICE - {} {}", TransactionType.ADD, hwvtepGlobal);
}
}
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
import org.opendaylight.ovsdb.schema.hardwarevtep.Manager;
+import org.opendaylight.ovsdb.utils.mdsal.utils.TransactionType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Managers;
.child(Managers.class, new ManagersKey(new Uri(manager.getTargetColumn().getData())));
// TODO Delete any references
transaction.delete(LogicalDatastoreType.OPERATIONAL, managerIid);
+ addToDeviceUpdate(TransactionType.DELETE, manager);
+ LOG.info("DEVICE - {} {}", TransactionType.DELETE, manager);
}
}
}
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
import org.opendaylight.ovsdb.schema.hardwarevtep.Manager;
+import org.opendaylight.ovsdb.utils.mdsal.utils.TransactionType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.Uri;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
LOG.debug("Connection {} is present", connection.get());
Node connectionNode = buildConnectionNode(manager);
transaction.merge(LogicalDatastoreType.OPERATIONAL, connectionIId, connectionNode);
+ addToDeviceUpdate(TransactionType.ADD, manager);
+ LOG.info("DEVICE - {} {}", TransactionType.ADD, manager);
// TODO: Delete entries that are no longer needed
}
}
import org.opendaylight.ovsdb.lib.schema.DatabaseSchema;
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalSwitch;
+import org.opendaylight.ovsdb.utils.mdsal.utils.TransactionType;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepGlobalAugmentation;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.HwvtepPhysicalSwitchRef;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.Switches;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.ovsdb.hwvtep.rev150901.hwvtep.global.attributes.SwitchesKey;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.network.topology.topology.Node;
import org.opendaylight.yangtools.yang.binding.InstanceIdentifier;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
public class HwvtepPhysicalSwitchRemoveCommand extends AbstractTransactionCommand {
+ private static final Logger LOG = LoggerFactory.getLogger(HwvtepPhysicalSwitchRemoveCommand.class);
+
public HwvtepPhysicalSwitchRemoveCommand(HwvtepConnectionInstance key, TableUpdates updates,
DatabaseSchema dbSchema) {
super(key, updates, dbSchema);
transaction.delete(LogicalDatastoreType.OPERATIONAL, nodeIid);
transaction.delete(LogicalDatastoreType.OPERATIONAL, switchIid);
getDeviceInfo().clearDeviceOperData(Node.class, switchIid);
+ addToDeviceUpdate(TransactionType.DELETE, phySwitch);
+ LOG.info("DEVICE - {} {}", TransactionType.DELETE, phySwitch);
}
}
}
import org.opendaylight.ovsdb.lib.schema.typed.TyperUtils;
import org.opendaylight.ovsdb.schema.hardwarevtep.PhysicalSwitch;
import org.opendaylight.ovsdb.schema.hardwarevtep.Tunnel;
+import org.opendaylight.ovsdb.utils.mdsal.utils.TransactionType;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddress;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.inet.types.rev130715.IpAddressBuilder;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.Uuid;
InstanceIdentifier<Node> psIid = getInstanceIdentifier(phySwitch);
Node psNode = buildPhysicalSwitchNode(connection.get(), phySwitch);
transaction.merge(LogicalDatastoreType.OPERATIONAL, psIid, psNode);
+ addToDeviceUpdate(TransactionType.ADD, phySwitch);
+ LOG.info("DEVICE - {} {}", TransactionType.ADD, phySwitch);
PhysicalSwitch oldPSwitch = oldPSRows.get(uuid);
updateTunnelIps(phySwitch, oldPSwitch, transaction);