Hi,
Following the guide in “28.4.2. Storing ConfD configuration parameters in CDB”, I write a YANG model as below, in order to allow operator modify the maximum CLI/netconf session number in runtime.
While I encounter a problem that deleting the /yang-server/session-limits/session-limit/max-cli-sessions cause the /yang-server/session-limits/session-limit/max-netconf-sessions is deleted as well.
My model is as below.
container yang-server {
presence "";
description "YANG server configuration.";
container session-limits {
presence "";
container session-limit{
presence "";
leaf max-cli-sessions {
type dyncfg:limitType;
tailf:link "/dyncfg:confdConfig/sessionLimits/sessionLimit[context='cli']/maxSessions";
}
leaf max-netconf-sessions {
type dyncfg:limitType;
tailf:link "/dyncfg:confdConfig/sessionLimits/sessionLimit[context='netconf']/maxSessions";
}
}
container config-session-limit{
presence "";
leaf max-cli-sessions {
type dyncfg:limitType;
tailf:link "/dyncfg:confdConfig/sessionLimits/configSessionLimit[context='cli']/maxSessions";
}
leaf max-netconf-sessions {
type dyncfg:limitType;
tailf:link "/dyncfg:confdConfig/sessionLimits/configSessionLimit[context='netconf']/maxSessions";
}
}
}
}
–
And I write the confd_dyncfg_init.xml as below.
<config xmlns="http://tail-f.com/ns/config/1.0">
<confdConfig xmlns="http://tail-f.com/ns/confd_dyncfg/1.0">
<sessionLimits>
<sessionLimit>
<context>cli</context>
<maxSessions>16</maxSessions>
</sessionLimit>
<sessionLimit>
<context>netconf</context>
<maxSessions>16</maxSessions>
</sessionLimit>
<configSessionLimit>
<context>cli</context>
<maxSessions>16</maxSessions>
</configSessionLimit>
<configSessionLimit>
<context>netconf</context>
<maxSessions>16</maxSessions>
</configSessionLimit>
</sessionLimits>
</confdConfig>
</config>
I firstly change the yang-server/session-limits/session-limit/max-cli-sessions to 8, the problem is not only the yang-server/session-limits/session-limit/max-cli-sessions is shown to user as the new configuration, but also the yang-server/session-limits/session-limit/max-netconf-sessions is shown to user, even though I do not explicitly configure the max-netconf-sessions.
My operation on Confd_cli is as below.
test# show running-config
confdConfig sessionLimits sessionLimit netconf
maxSessions 16
!
confdConfig sessionLimits configSessionLimit cli
maxSessions 16
!
confdConfig sessionLimits configSessionLimit netconf
maxSessions 16
!
confdConfig cli
test# config
Entering configuration mode terminal
test(config)# yang-server session-limits session-limit max-cli-sessions 8
test(config)# show configuration
yang-server session-limits session-limit max-cli-sessions 8
yang-server session-limits session-limit max-netconf-sessions 16
test(config)# commit
Commit complete.
test(config)# end
test# show running-config
confdConfig sessionLimits sessionLimit cli
maxSessions 8
!
confdConfig sessionLimits sessionLimit netconf
maxSessions 16
!
confdConfig sessionLimits configSessionLimit cli
maxSessions 16
!
confdConfig sessionLimits configSessionLimit netconf
maxSessions 16
!
confdConfig cli
yang-server session-limits session-limit max-cli-sessions 8
yang-server session-limits session-limit max-netconf-sessions 16
–
You can see that even though the max-netconf-sessions is not configured, it’s displayed as running configuration after I configure the max-cli-sessions.
Then I delete the max-cli-sessions, the problem is the max-netconf-sessions is deleted as well even though I do not delete max-netconf-sessions.
test# config
Entering configuration mode terminal
test(config)# no yang-server session-limits session-limit max-cli-sessions
test(config)# show configuration
no yang-server session-limits session-limit max-cli-sessions 8
no yang-server session-limits session-limit max-netconf-sessions 16
test(config)# commit
Commit complete.
test(config)# end
test# show running-config
confdConfig sessionLimits sessionLimit cli
maxSessions 8
!
confdConfig sessionLimits sessionLimit netconf
maxSessions 16
!
confdConfig sessionLimits configSessionLimit cli
maxSessions 16
!
confdConfig sessionLimits configSessionLimit netconf
maxSessions 16
!
confdConfig cli
yang-server session-limits
–
Could you help on this? How could I separate the configuration on /yang-server/session-limits/session-limit/max-cli-sessions/ with the /yang-server/session-limits/session-limit/max-netconf-sessions/