-
Notifications
You must be signed in to change notification settings - Fork 211
Description
I'd like to propose a new gNMI extension to perform config diff on a device. Details are described below.
Objective
Define an approach to validating that a configuration candidate sent using gNMI.Set() would result in zero configuration differences if applied to a device. If differences are identified, then they would need to be reported back.
Background
In a production environment, migrating to OpenConfig based configuration from a CLI based configuration is a potentially risky activity. When a feature is migrated to OpenConfig, the migration should functionally be a no-op, however, there isn't a guarantee that the OpenConfig matches exactly with its CLI equivalent. The OpenConfig may be accepted and return success. However, a success could mean:
- Config was applied and is exactly equivalent to the configuration currently on the device.
- Config changes resulting in immediate undesired behavior.
- No immediate/obvious changes, but small unknown changes are made.
Proper testing would provide a level of confidence for these migrations, however, it puts a burden on the tests being complete and comprehensive. In order to definitively validate that a feature works identically, test cases are required that exhaustively cover all edge cases. Whilst this is a desirable end state - the shorter-term requirement is to validate that existing behaviors have not changed.
Utilizing a defense-in-depth approach, relying on an additional config diff would provide more confidence to migrate configuration.
Additionally, this would be helpful during development of new OpenConfig config generators as developers would have an easy mechanism to compare their code output against existing CLI based config generators.
Proposal
A new mode could be supported within a gNMI.Set() to have the device perform a diff of the provided configuration against the existing configuration. This would result in two outcomes:
- Zero configuration changes on the device.
- The device describes what the diff would be if applied.
In either case, a configuration change is NEVER allowed to be applied to a device in this mode.
Specifically, the proposal of the mechanism to achieve this is to add an "impact" extension to the gNMI.SetRequest. It is suggested to utilize the gNMI.Set() RPC because an important need is to use the exact details within the SetRequest message to define the candidate release. This ensures the configuration sent in the normal mode or in this new proposed mode are identical. The SetRequest message could be reused in another RPC, but that seems more complex than simply having a new impact extension within the existing gNMI.Set().