Re: [netmod] leafref to lists that contain system-controlled entries

Martin Bjorklund <> Mon, 16 October 2017 06:57 UTC

Return-Path: <>
Received: from localhost (localhost []) by (Postfix) with ESMTP id C47CF13431D for <>; Sun, 15 Oct 2017 23:57:29 -0700 (PDT)
X-Virus-Scanned: amavisd-new at
X-Spam-Flag: NO
X-Spam-Score: -1.9
X-Spam-Status: No, score=-1.9 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, SPF_PASS=-0.001, URIBL_BLOCKED=0.001] autolearn=ham autolearn_force=no
Received: from ([]) by localhost ( []) (amavisd-new, port 10024) with ESMTP id tsn6lwcZRvAo for <>; Sun, 15 Oct 2017 23:57:28 -0700 (PDT)
Received: from ( []) by (Postfix) with ESMTP id 066E3134316 for <>; Sun, 15 Oct 2017 23:57:27 -0700 (PDT)
Received: from localhost (unknown []) by (Postfix) with ESMTPSA id 5C8661AE02A7; Mon, 16 Oct 2017 08:57:26 +0200 (CEST)
Date: Mon, 16 Oct 2017 08:55:59 +0200 (CEST)
Message-Id: <>
From: Martin Bjorklund <>
In-Reply-To: <>
References: <>
X-Mailer: Mew version 6.7 on Emacs 24.5 / Mule 6.0 (HANACHIRUSATO)
Mime-Version: 1.0
Content-Type: Text/Plain; charset=us-ascii
Content-Transfer-Encoding: 7bit
Archived-At: <>
Subject: Re: [netmod] leafref to lists that contain system-controlled entries
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: NETMOD WG list <>
List-Unsubscribe: <>, <>
List-Archive: <>
List-Post: <>
List-Help: <>
List-Subscribe: <>, <>
X-List-Received-Date: Mon, 16 Oct 2017 06:57:30 -0000

"Sterne, Jason (Nokia - CA/Ottawa)" <> wrote:
> Hi all,
> There are a few threads on the mailing list that touch on the concept
> of system-controlled resources (mostly list entries):
> A few drafts & RFCs also refer to the concept:
> Several vendor implementations have list entries (instance data) that
> are populated by the server and can be referenced (leafref) from other
> places in the configuration.  These system entries are useful
> pre-created policies, interfaces, etc that can then be used (and
> referred-to) by operators in their explicit configuration.
> If those entries are only expected to exist in the <operational>
> datastore, then in theory any references to them in user created
> configuration will cause a validation problem in the candidate/running
> (missing leafref target).
> One solution discussed in the mailing lists is to change every
> reference to lists that could contain a system created entry to a
> "require-instance false" leafref.  But then some useful validation is
> lost.  In many cases the model is more correctly "require-instance
> true" but the set of targets includes the system create entries.
> Another solution discussed is to have the system created entries
> appear in the <intended> datastore (as part of template/expansion).
> That would make validation pass on the intended datastore, but then
> the candidate/running/startup datastores would not be valid (would be
> missing leafref targets if any part of the config refers to system
> created entries).  THis sounds similar to the problem that has been
> discussed in the past about the fact that templates (in the running)
> basically mean the running/candidate aren't necessarily valid (until
> after template expansion, which means only the intended would be
> valid).
> Another approach could be to actually have those system created
> entries show up in running/candidate.  That would ensure that
> references to those entries are valid.

This works if the "system created entries" behave just like any other
entry, i.e., a client (with proper access rigths) can modify and
delete them.

If this is not the case, the next question is what happens if the
client creates its own entry with the same name as a system created
entry?  Is this illegal, or will the user created entry override the
system created entry?

Another question to think about is what happpens with user config that
refers to such a system created entry if a new software image is
loaded where the system created entry is no longer present?