Re: [Netconf] Does <discard-changes> do the same thing as <copy-config>-ing 'running' to 'candidate'?

Ariel Otilibili Anieli <otilibil@eurecom.fr> Fri, 25 May 2018 10:21 UTC

Return-Path: <otilibil@eurecom.fr>
X-Original-To: netconf@ietfa.amsl.com
Delivered-To: netconf@ietfa.amsl.com
Received: from localhost (localhost [127.0.0.1]) by ietfa.amsl.com (Postfix) with ESMTP id 38FCC12D95D for <netconf@ietfa.amsl.com>; Fri, 25 May 2018 03:21:53 -0700 (PDT)
X-Virus-Scanned: amavisd-new at amsl.com
X-Spam-Flag: NO
X-Spam-Score: -1.901
X-Spam-Level:
X-Spam-Status: No, score=-1.901 tagged_above=-999 required=5 tests=[BAYES_00=-1.9, RCVD_IN_DNSWL_NONE=-0.0001, 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 Rp54NPq4NF0A for <netconf@ietfa.amsl.com>; Fri, 25 May 2018 03:21:50 -0700 (PDT)
Received: from smtp2.eurecom.fr (smtp2.eurecom.fr [193.55.113.211]) by ietfa.amsl.com (Postfix) with ESMTP id 5696B124D68 for <netconf@ietf.org>; Fri, 25 May 2018 03:21:50 -0700 (PDT)
X-IronPort-AV: E=Sophos;i="5.49,439,1520895600"; d="scan'208";a="8120447"
Received: from thorgal.eurecom.fr ([10.3.2.220]) by drago2i.eurecom.fr with ESMTP; 25 May 2018 12:21:49 +0200
Received: (from apache@localhost) by thorgal.eurecom.fr (8.14.4+Sun/8.14.4/Submit) id w4PALm77010459; Fri, 25 May 2018 12:21:48 +0200 (CEST)
X-Authentication-Warning: thorgal.eurecom.fr: apache set sender to otilibil@eurecom.fr using -f
Received: from reverse.completel.net (reverse.completel.net [92.103.89.82]) by webmail.eurecom.fr (Horde MIME library) with HTTP; Fri, 25 May 2018 12:21:48 +0200
Message-ID: <20180525122148.jz296uxlw0w4448w@webmail.eurecom.fr>
Date: Fri, 25 May 2018 12:21:48 +0200
From: Ariel Otilibili Anieli <otilibil@eurecom.fr>
To: Attila Vangel <vangel.attila@gmail.com>
Cc: netconf@ietf.org
References: <CAGSQd2-_S+5-ZmzbPB10DBch7ns8M=X8w5-0H4j+7TRk7USJpA@mail.gmail.com>
In-Reply-To: <CAGSQd2-_S+5-ZmzbPB10DBch7ns8M=X8w5-0H4j+7TRk7USJpA@mail.gmail.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="ISO-8859-1"; DelSp="Yes"; format="flowed"
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable
User-Agent: Internet Messaging Program (IMP) H3 (4.1.4)
X-Originating-IP: 92.103.89.82
X-Remote-Browser: Mozilla/5.0 (X11; Linux x86_64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/62.0.3202.89 Safari/537.36
Archived-At: <https://mailarchive.ietf.org/arch/msg/netconf/8Y7YgIDIi9Iun46ek76q82HFCtA>
Subject: Re: [Netconf] Does <discard-changes> do the same thing as <copy-config>-ing 'running' to 'candidate'?
X-BeenThere: netconf@ietf.org
X-Mailman-Version: 2.1.22
Precedence: list
List-Id: Network Configuration WG mailing list <netconf.ietf.org>
List-Unsubscribe: <https://www.ietf.org/mailman/options/netconf>, <mailto:netconf-request@ietf.org?subject=unsubscribe>
List-Archive: <https://mailarchive.ietf.org/arch/browse/netconf/>
List-Post: <mailto:netconf@ietf.org>
List-Help: <mailto:netconf-request@ietf.org?subject=help>
List-Subscribe: <https://www.ietf.org/mailman/listinfo/netconf>, <mailto:netconf-request@ietf.org?subject=subscribe>
X-List-Received-Date: Fri, 25 May 2018 10:21:53 -0000

Hi Attila,

Comments below.

Regards,
Ariel

Quoting Attila Vangel <vangel.attila@gmail.com>:

> Hi,
>
> N00b question on netconf. Could somebody please clarify?
>
> 1. Does <discard-changes> (
> https://tools.ietf.org/html/rfc6241#section-8.3.4.2) have totally the same
> effect as <copy-config>-ing 'running' to 'candidate'?
No.
>
> "This operation discards any uncommitted changes by resetting the
>    candidate configuration with the content of the running
>    configuration."
>
> If so, was it introduced as a shorter alternative of copying?
> If not, what is the difference between them?
<copy-config> copies the content of a datastore to another, whatever  
it is; <discard-changes> discards the changes made on the 'candidate'  
datastore.
>
> 2. I got confused because I watched a tutorial on youtube which used both
> commands, first <discard-changes> before locking any config datastores, and
> <copy-config>-ing 'running' to 'candidate' after locking these datastores.
> (The assumption in this example is that the device supports 'candidate'.)
I suppose they wanted to edit 'candidate' from 'running', that's why  
they <copy-config> before edition.
>
> 3. For the first time I was puzzled why to do <discard-changes> before
> doing any locking, but then I read in the RFC that lock would fail if
> 'candidate' was "dirty" (https://tools.ietf.org/html/rfc6241#section-7.5):
>
> A lock MUST NOT be granted if any of the following conditions is
>       true:
>
>       *  A lock is already held by any NETCONF session or another
>          entity.
>
>       *  The target configuration is <candidate>, it has already been
>          modified, and these changes have not been committed or rolled
>          back.
>
>       <...>
>
Another thing on <lock>
> But still I am not sure about 1. If these commands do the same thing, using
> <copy-config> in this tutorial was just for showcasing doing it yet another
> way in 2.?
>
> (I was not sure whether to share the link for the tutorial, maybe it
> would look like as advertising the company/author who did the
> tutorial.)
>
> Best regards,
> Attila
>



-------------------------------------------------------------------------------
This message was sent using EURECOM Webmail: http://webmail.eurecom.fr