Re: [netmod] Design-Time schema mount

Balazs Lengyel <balazs.lengyel@ericsson.com> Fri, 26 August 2016 17:25 UTC

Return-Path: <balazs.lengyel@ericsson.com>
X-Original-To: netmod@ietfa.amsl.com
Delivered-To: netmod@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 6494012D1DD for <netmod@ietfa.amsl.com>; Fri, 26 Aug 2016 10:25:10 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -3.497
X-Spam-Level:
X-Spam-Status: No, score=-3.497 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, HTML_MESSAGE=0.001, MIME_HTML_ONLY=0.723, RCVD_IN_DNSWL_MED=-2.3, RCVD_IN_MSPIKE_H3=-0.01, RCVD_IN_MSPIKE_WL=-0.01, SPF_PASS=-0.001] autolearn=ham autolearn_force=no
Received: from mail.ietf.org ([4.31.198.44]) by localhost (ietfa.amsl.com [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id YySKq4l7zu8R for <netmod@ietfa.amsl.com>; Fri, 26 Aug 2016 10:25:08 -0700 (PDT)
Received: from sessmg22.ericsson.net (sessmg22.ericsson.net [193.180.251.58]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ietfa.amsl.com (Postfix) with ESMTPS id EE11612D1DA for <netmod@ietf.org>; Fri, 26 Aug 2016 10:25:07 -0700 (PDT)
X-AuditID: c1b4fb3a-0618b980000009bd-cd-57c07b710715
Received: from ESESSHC002.ericsson.se (Unknown_Domain [153.88.183.24]) by (Symantec Mail Security) with SMTP id 4A.8B.02493.17B70C75; Fri, 26 Aug 2016 19:25:06 +0200 (CEST)
Received: from [159.107.197.196] (153.88.183.153) by smtp.internal.ericsson.com (153.88.183.26) with Microsoft SMTP Server id 14.3.301.0; Fri, 26 Aug 2016 19:25:04 +0200
To: Martin Bjorklund <mbj@tail-f.com>
References: <6d87e060-3c52-38f6-e499-da3d7c20a783@ericsson.com> <20160826.102122.372934259558220723.mbj@tail-f.com>
From: Balazs Lengyel <balazs.lengyel@ericsson.com>
Message-ID: <f0569260-8537-1ff4-2cf9-028449efc6eb@ericsson.com>
Date: Fri, 26 Aug 2016 19:25:04 +0200
User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:45.0) Gecko/20100101 Thunderbird/45.2.0
MIME-Version: 1.0
In-Reply-To: <20160826.102122.372934259558220723.mbj@tail-f.com>
Content-Type: text/html; charset="windows-1252"
Content-Transfer-Encoding: 8bit
X-Brightmail-Tracker: H4sIAAAAAAAAA+NgFtrCLMWRmVeSWpSXmKPExsUyM2K7hG5R9YFwgyttXBbd3c/YLeZfbGR1 YPJYsuQnk8fGX4tZApiiuGxSUnMyy1KL9O0SuDJeNF5jLXhlWjHly1qmBsa9ml2MnBwSAiYS bxZMZ+5i5OIQEljPKPF15wtWCGcto8TGRWdZQaqEBfQk7n3ZxwRiiwioSjzZuZYFxBYSKJWY t+o5O4jNLCAqsf7iJbAaNgEjian958FqeAXsJdrfP2QGsVmAere3tALFOThEBWIk1vclQJQI Spyc+QSsnFPAQaJ71ksWiJH6Etfv3GeFsOUlmrfOZoZYqyHx8MJf1gmMArOQtM9C0jILScsC RuZVjKLFqcXFuelGRnqpRZnJxcX5eXp5qSWbGIFheXDLb6sdjAefOx5iFOBgVOLhVTDaHy7E mlhWXJl7iFGCg1lJhLer4kC4EG9KYmVValF+fFFpTmrxIUZpDhYlcV7/l4rhQgLpiSWp2amp BalFMFkmDk6pBkZxHbM34q7Pr6dWHbYoEF16z0fbQObSlc+f+/nXev7j8Ne14K73sBR+XMvL M2/HHy4dtrbQExol/xhN4kWt6p0qtvi2Gga8fppcoJlas12uKztXwaeWe77cl1fVk35Hd26q ZVxjLHvof4nG9lyFTQavbx5wjljXZ3om66Xbv9XJiv5eT5ctVmIpzkg01GIuKk4EAOdHyMxH AgAA
Archived-At: <https://mailarchive.ietf.org/arch/msg/netmod/Yx6ipqHhQMCI7TK79Et8xWu-DoU>
Cc: netmod@ietf.org
Subject: Re: [netmod] Design-Time schema mount
X-BeenThere: netmod@ietf.org
X-Mailman-Version: 2.1.17
Precedence: list
List-Id: NETMOD WG list <netmod.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netmod>, <mailto:netmod-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netmod/>
List-Post: <mailto:netmod@ietf.org>
List-Help: <mailto:netmod-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netmod>, <mailto:netmod-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 26 Aug 2016 17:25:10 -0000

Hello Martin,
As I see in your answer, you do not question that the design time mount is an important and possibly frequent use-case, and I certainly think it is.
I also found this on the Juniper website: https://forums.juniper.net/t5/Automation/FAQ-YANG-Labs/ta-p/294330" rel="nofollow">What are the benefits of a Juniper devices publishing Junos YANG module off box?
See other comments below.
regards Balazs

On 2016-08-26 10:21, Martin Bjorklund wrote:
Hi,

[replying to the first post in this (old) thread; the thread got a bit
off-topic]

Balazs Lengyel <balazs.lengyel@ericsson.com> wrote:
Hello,

As I understand it, Schema-mount today does not support an important
use-case which we definitely need, but others also indicated they
want.

I want to specify off-line in design time which models will be mounted
where. Many of my nodes know in design-time what their model structure
will be, so I want a way to be able to document this in YANG.
I'd like to understand this use case in more detail.  You say that
that a "node knows in design-time" that YANG models it will use.  Thus
it seems natural to be able to specify which other modules to mount in
the YANG module itself.

The problem I see with this is that it is very limited to the use case
where each implementation defines its own YANG modules.  Suppose you
have such a model, for example:

   module A {
     ...
     mount ... {
       mount-module B;
       mount-module C;
     }
  }
      
[pseudo-code for module A that specifies that it mounts B and C]

Now, suppose you take this module A to another implementation, and it
needs to augment something into module C; essentially this means that
it would like to mount B, C and new module D.   This will not be
possible unless it modifies module A.
BALAZS: No you don't need to modify module A.   You can use a separate file 
to define mounting modD into modA.  Even my proposed solution allows this.
module mount-list {
   import moduleA { prefix moda; }
   import moduleD {}

   // indicate that moduleD is mounted somewhere
   schema-mount moduleD {  
      // indicate where it is mounted
      schema-mount-target /moda:baseContainer ;
   }
}

In
today's proposal the only way to find the Yang-Mounts is to read it
from the live node.

* OAM integrators or operators want to be able to write CLI scripts
  and Netconf messages without accessing (expensive) real nodes. For
  this they need to know the mounts
* We want to generate some fancy documentation from YANG automatically
  in design-time.
In a way this is no different from the situation today - in order to
learn what YANG modules a device supports you need to connect and
parse the <hello> message (or ietf-yang-library data in the near
future).  This info could also be made available off-line in a file.
BALAZS: actually it is made available in our case, also describing support for features

It should certainly be possible to define a file format that a device
somehow could "publish" off-line that contained all the info that is
available at run-time.  This file format could be exactly the same as
you would get if you did a NETCONF <get/> operation with some filter
to only retreive the ietf-yang-library data at the mount points.
BALAZS: That would be an INTERESTING idea for multiple reasons (and I know some implementations who already do this).
Some potential use-cases:
- Mount descriptors
- defining default security rules for Netconf-acm
- listing available notification streams
- listing supported modules & features from yang-library



/martin


* Many use cases need the possibility to mount schemas, but do not
  need the added complexity of schema changes in run-time.
  Notwithstanding the case of "YANG Features", for me the model schema
  is a mostly static description of a nodes capabilities. Most of the
  time I do not want to worry about the node changing its schema on
  the fly.


For this I propose 2 YANG extensions

extension schema-mount {
description "Indicates that a YANG Module is to be mounted into
another module.
The argument specifies the name of the module to be mounted.";
argument mounted-module;
}

extension schema-mount-target {
description "Specifies the target node under which a YANG module is to
be mounted.
The statement can only be used inside a schema-mount statement.
The argument follows the same rules as an augment statement's target.
argument target-node;
}

The two extension statements can be placed in a separate module or the
mounted module.

I don't insist on the solution, but I need the off-line/design-time
specification of yang-mount to be possible. IMHO the design-time mount
use-case is more important than the dynamic-mount.

regards Balazs
--
Balazs Lengyel                       Ericsson Hungary Ltd.
Senior Specialist
Mobile: +36-70-330-7909              email: Balazs.Lengyel@ericsson.com

    

-- 
Balazs Lengyel                       Ericsson Hungary Ltd.
Senior Specialist
Mobile: +36-70-330-7909              email: Balazs.Lengyel@ericsson.com