draft-ietf-netconf-partial-lock-09.txt   draft-ietf-netconf-partial-lock-10.txt 
NETCONF B. Lengyel NETCONF B. Lengyel
Internet-Draft Ericsson Internet-Draft Ericsson
Intended status: Standards Track M. Bjorklund Intended status: Standards Track M. Bjorklund
Expires: January 3, 2010 Tail-f Systems Expires: April 22, 2010 Tail-f Systems
July 02, 2009 October 19, 2009
Partial Lock RPC for NETCONF Partial Lock RPC for NETCONF
draft-ietf-netconf-partial-lock-09 draft-ietf-netconf-partial-lock-10
Status of this Memo Status of this Memo
This Internet-Draft is submitted to IETF in full conformance with the This Internet-Draft is submitted to IETF in full conformance with the
provisions of BCP 78 and BCP 79. This document may contain material provisions of BCP 78 and BCP 79. This document may contain material
from IETF Documents or IETF Contributions published or made publicly from IETF Documents or IETF Contributions published or made publicly
available before November 10, 2008. The person(s) controlling the available before November 10, 2008. The person(s) controlling the
copyright in some of this material may not have granted the IETF copyright in some of this material may not have granted the IETF
Trust the right to allow modifications of such material outside the Trust the right to allow modifications of such material outside the
IETF Standards Process. Without obtaining an adequate license from IETF Standards Process. Without obtaining an adequate license from
skipping to change at page 1, line 43 skipping to change at page 1, line 43
and may be updated, replaced, or obsoleted by other documents at any and may be updated, replaced, or obsoleted by other documents at any
time. It is inappropriate to use Internet-Drafts as reference time. It is inappropriate to use Internet-Drafts as reference
material or to cite them other than as "work in progress." material or to cite them other than as "work in progress."
The list of current Internet-Drafts can be accessed at The list of current Internet-Drafts can be accessed at
http://www.ietf.org/ietf/1id-abstracts.txt. http://www.ietf.org/ietf/1id-abstracts.txt.
The list of Internet-Draft Shadow Directories can be accessed at The list of Internet-Draft Shadow Directories can be accessed at
http://www.ietf.org/shadow.html. http://www.ietf.org/shadow.html.
This Internet-Draft will expire on January 3, 2010. This Internet-Draft will expire on April 22, 2010.
Copyright Notice Copyright Notice
Copyright (c) 2009 IETF Trust and the persons identified as the Copyright (c) 2009 IETF Trust and the persons identified as the
document authors. All rights reserved. document authors. All rights reserved.
This document is subject to BCP 78 and the IETF Trust's Legal This document is subject to BCP 78 and the IETF Trust's Legal
Provisions Relating to IETF Documents in effect on the date of Provisions Relating to IETF Documents in effect on the date of
publication of this document (http://trustee.ietf.org/license-info). publication of this document (http://trustee.ietf.org/license-info).
Please review these documents carefully, as they describe your rights Please review these documents carefully, as they describe your rights
skipping to change at page 3, line 12 skipping to change at page 3, line 12
defines a capability-based extension to the NETCONF protocol for defines a capability-based extension to the NETCONF protocol for
locking portions of a configuration datastore. locking portions of a configuration datastore.
Table of Contents Table of Contents
1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4 1. Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 4
1.1. Definition of Terms . . . . . . . . . . . . . . . . . . . 4 1.1. Definition of Terms . . . . . . . . . . . . . . . . . . . 4
2. Partial Locking Capability . . . . . . . . . . . . . . . . . . 4 2. Partial Locking Capability . . . . . . . . . . . . . . . . . . 4
2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 4 2.1. Overview . . . . . . . . . . . . . . . . . . . . . . . . . 4
2.1.1. Usage Scenarios . . . . . . . . . . . . . . . . . . . 5 2.1.1. Usage Scenarios . . . . . . . . . . . . . . . . . . . 5
2.2. Dependencies . . . . . . . . . . . . . . . . . . . . . . . 7 2.2. Dependencies . . . . . . . . . . . . . . . . . . . . . . . 6
2.3. Capability Identifier . . . . . . . . . . . . . . . . . . 7 2.3. Capability Identifier . . . . . . . . . . . . . . . . . . 6
2.4. New Operations . . . . . . . . . . . . . . . . . . . . . . 7 2.4. New Operations . . . . . . . . . . . . . . . . . . . . . . 6
2.4.1. <partial-lock> . . . . . . . . . . . . . . . . . . . . 7 2.4.1. <partial-lock> . . . . . . . . . . . . . . . . . . . . 6
2.4.2. <partial-unlock> . . . . . . . . . . . . . . . . . . . 12 2.4.2. <partial-unlock> . . . . . . . . . . . . . . . . . . . 10
2.5. Modifications to Existing Operations . . . . . . . . . . . 13 2.5. Modifications to Existing Operations . . . . . . . . . . . 11
2.6. Interactions with Other Capabilities . . . . . . . . . . . 14 2.6. Interactions with Other Capabilities . . . . . . . . . . . 12
2.6.1. Candidate Configuration Capability . . . . . . . . . . 14 2.6.1. Candidate Configuration Capability . . . . . . . . . . 12
2.6.2. Confirmed Commit Capability . . . . . . . . . . . . . 14 2.6.2. Confirmed Commit Capability . . . . . . . . . . . . . 12
2.6.3. Distinct Startup Capability . . . . . . . . . . . . . 14 2.6.3. Distinct Startup Capability . . . . . . . . . . . . . 12
3. Security Considerations . . . . . . . . . . . . . . . . . . . 14 3. Security Considerations . . . . . . . . . . . . . . . . . . . 12
4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 15 4. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 13
5. Appendix A - XML Schema for Partial Locking (normative) . . 16 5. Appendix A - XML Schema for Partial Locking (normative) . . 15
6. Appendix B - YANG Module for Partial Locking 6. Appendix B - YANG Module for Partial Locking
(non-normative) . . . . . . . . . . . . . . . . . . . . . . . 20 (non-normative) . . . . . . . . . . . . . . . . . . . . . . . 18
7. Appendix C - Usage Example - Reserving nodes for future 7. Appendix C - Usage Example - Reserving nodes for future
editing (non-normative) . . . . . . . . . . . . . . . . . . . 23 editing (non-normative) . . . . . . . . . . . . . . . . . . . 20
8. Appendix D - Change Log . . . . . . . . . . . . . . . . . . 28 8. Appendix D - Change Log . . . . . . . . . . . . . . . . . . 24
8.1. 08-09 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 8.1. 09-10 . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.2. 07-08 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 8.2. 08-09 . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.3. 06-07 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 8.3. 07-08 . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.4. 05-06 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 8.4. 06-07 . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.5. 04-05 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 8.5. 05-06 . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.6. 03-04 . . . . . . . . . . . . . . . . . . . . . . . . . . 28 8.6. 04-05 . . . . . . . . . . . . . . . . . . . . . . . . . . 24
8.7. 02-03 . . . . . . . . . . . . . . . . . . . . . . . . . . 29 8.7. 03-04 . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.8. 01-02 . . . . . . . . . . . . . . . . . . . . . . . . . . 29 8.8. 02-03 . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.9. 00-01 . . . . . . . . . . . . . . . . . . . . . . . . . . 29 8.9. 01-02 . . . . . . . . . . . . . . . . . . . . . . . . . . 25
8.10. -00 . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 8.10. 00-01 . . . . . . . . . . . . . . . . . . . . . . . . . . 25
9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 30 8.11. -00 . . . . . . . . . . . . . . . . . . . . . . . . . . . 25
10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 31 9. Acknowledgements . . . . . . . . . . . . . . . . . . . . . . . 26
10.1. Normative References . . . . . . . . . . . . . . . . . . . 31 10. References . . . . . . . . . . . . . . . . . . . . . . . . . . 27
10.2. Informative References . . . . . . . . . . . . . . . . . . 31 10.1. Normative References . . . . . . . . . . . . . . . . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 32 10.2. Informative References . . . . . . . . . . . . . . . . . . 27
Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . . 28
1. Introduction 1. Introduction
The [NETCONF] protocol describes the lock and unlock operations that The [NETCONF] protocol describes the lock and unlock operations that
operate on entire configuration datastores. Often, multiple operate on entire configuration datastores. Often, multiple
management sessions need to be able to modify the configuration of a management sessions need to be able to modify the configuration of a
managed device in parallel. In these cases, locking only parts of a managed device in parallel. In these cases, locking only parts of a
configuration datastore is needed. This document defines a configuration datastore is needed. This document defines a
capability based extension to the NETCONF protocol to support partial capability based extension to the NETCONF protocol to support partial
locking of NETCONF datastores using a mechanism based on the existing locking of the NETCONF running datastore using a mechanism based on
XPath filtering mechanisms. the existing XPath filtering mechanisms.
1.1. Definition of Terms 1.1. Definition of Terms
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and
"OPTIONAL" in this document are to be interpreted as described in BCP "OPTIONAL" in this document are to be interpreted as described in BCP
14, [RFC2119]. 14, [RFC2119].
Additionally the following terms are defined: Additionally the following terms are defined:
o Instance Identifier: an XPath expression identifying a specific o Instance Identifier: an XPath expression identifying a specific
node in the conceptual XML datastore. It contains an absolute node in the conceptual XML datastore. It contains an absolute
path expression in abbreviated syntax, where predicates are used path expression in abbreviated syntax, where predicates are used
only to specify values for nodes defined as keys to distinguish only to specify values for nodes defined as keys to distinguish
multiple instances. multiple instances.
o Scope of the lock: initially the set of nodes returned by the o Scope of the lock: initially the set of nodes returned by the
XPath expressions in a successful partial-lock operation. The set XPath expressions in a successful partial-lock operation. The set
might be modified if some of the nodes are deleted. might be modified if some of the nodes are deleted by the session
owning the lock.
o Protected area: the set of nodes that are protected from o Protected area: the set of nodes that are protected from
modification by the lock. This set consists of nodes in the scope modification by the lock. This set consists of nodes in the scope
of the lock and nodes in subtrees under them. of the lock and nodes in subtrees under them.
2. Partial Locking Capability 2. Partial Locking Capability
2.1. Overview 2.1. Overview
The :partial-lock capability indicates that the device supports the The :partial-lock capability indicates that the device supports the
locking of its configuration with a more limited scope than a locking of its configuration with a more limited scope than a
complete configuration datastore. The scope to be locked is complete configuration datastore. The scope to be locked is
specified by using restricted or full XPath expressions. Partial specified by using restricted or full XPath expressions. Partial
locking only affects configuration data. locking only affects configuration data and only the running
datastore. The candidate or the start-up datastore are not affected.
The system MUST ensure that configuration resources covered by the The system MUST ensure that configuration resources covered by the
lock are not modified by other NETCONF or non-NETCONF management lock are not modified by other NETCONF or non-NETCONF management
operations such as SNMP and the CLI. operations such as SNMP and the CLI.
The duration of the partial lock begins when the partial lock is The duration of the partial lock begins when the partial lock is
granted and lasts until (1) either the corresponding <partial-unlock> granted and lasts until (1) either the corresponding <partial-unlock>
operation succeeds or (2) the NETCONF session terminates. operation succeeds or (2) the NETCONF session terminates.
A NETCONF session MAY have multiple parts of one or more datastores A NETCONF session MAY have multiple parts of the running datastore
(running, candidate, startup) locked using partial lock operations. locked using partial lock operations.
The <partial-lock> operation returns a lock-id to identify each The <partial-lock> operation returns a lock-id to identify each
successfully acquired lock. The lock-id is unique for a NETCONF successfully acquired lock. The lock-id is unique for a NETCONF
server for all partial-locks granted to any NETCONF or non-NETCONF server for all partial-locks granted to any NETCONF or non-NETCONF
sessions. sessions.
2.1.1. Usage Scenarios 2.1.1. Usage Scenarios
In the following we describe a few scenarios for partial locking. In the following we describe a few scenarios for partial locking.
Partial locking is primarily useful towards the running Besides the two described here, there are many other usage scenarios
configuration. However it can be used to lock parts of a candidate possible.
datastore as well. While scenarios using the running datastore are
seen as the most important, as an example a scenario involving the
candidate datastore is also presented. Besides the three described
here, there are many other usage scenarios possible.
2.1.1.1. Multiple managers handling the writable running datastore with 2.1.1.1. Multiple managers handling the writable running datastore with
overlapping sections overlapping sections
Multiple managers are handling the same NETCONF agent simultaneously. Multiple managers are handling the same NETCONF agent simultaneously.
The agent is handled via the writable running datastore. Each The agent is handled via the writable running datastore. Each
manager has his or her own task, which might involve the modification manager has his or her own task, which might involve the modification
of overlapping sections of the datastore. of overlapping sections of the datastore.
After collecting and analyzing input and preparing the NETCONF After collecting and analyzing input and preparing the NETCONF
skipping to change at page 6, line 17 skipping to change at page 6, line 16
Each manager has his or her own task, which does not involve the Each manager has his or her own task, which does not involve the
modification of overlapping sections of the datastore. modification of overlapping sections of the datastore.
The manager locks his area with a <partial-lock> operation, uses a The manager locks his area with a <partial-lock> operation, uses a
number of <edit-config> commands to modify it, later releases the number of <edit-config> commands to modify it, later releases the
lock. As each manager has his functional area assigned to him, and lock. As each manager has his functional area assigned to him, and
he locks only that area, multiple managers can edit the configuration he locks only that area, multiple managers can edit the configuration
simultaneously. Locks can be held for extended periods (e.g. simultaneously. Locks can be held for extended periods (e.g.
minutes, hours), as this will not hinder other managers. minutes, hours), as this will not hinder other managers.
This scenario assumes, that the global lock operation from [NETCONF] This scenario assumes that the global lock operation from [NETCONF]
is not used. is not used.
2.1.1.3. Multiple managers handling the candidate datastore in a semi-
coordinated work mode
Multiple managers are handling the same NETCONF agent simultaneously.
The agent is handled via the candidate datastore. Each manager has
his or her own task which might involve the modification of
overlapping sections of the datastore.
After collecting and analyzing input and preparing the NETCONF
operations off-line, the manager locks the areas that are important
for his task using one single <partial-lock> operation in both the
candidate and the running datastore. He executes a number of <edit-
config> operations to modify the configuration, then releases the
partial-lock. The lock should only be held for the shortest possible
time (e.g. seconds rather then minutes).
Operators coordinate with each other. When all of them finish their
tasks one of them orders commit. If any of the operators are still
working, and holds a lock, the commit will fail, and will need to be
repeated after all managers finish.
Warning: When multiple managers use the candidate configuration in
parallel, there is a risk that the interaction of access control
(which is still implementation specific at the time of this writing)
and the commit operation might result in a manager becoming unable
both to commit or discard changes, as illustrated by the following
sequence.
Manager A only has access to the interfaces branch in the model,
and edits it in candidate
Manager B only has access to the routing branch in the model, and
edits it in candidate
Manager A terminates it's session
Now Manager B can not issue <commit> because it can not modify
interfaces in the running datastore
Manager B can not issue <discard-changes> because it can not
modify interfaces in the candidate datastore
The situation is not a result of partial locking as a lock can be
easily removed; it is the result of a potential interaction between
access control, which by nature is specific for different parts of
the datastore and the global nature of the commit operation.
2.2. Dependencies 2.2. Dependencies
The device MUST support restricted XPath expressions in the select The device MUST support restricted XPath expressions in the select
element, as described in Section 2.4.1. Optionally, if the :xpath element, as described in Section 2.4.1. Optionally, if the :xpath
capability is also supported (as defined in [NETCONF] chapter 8.9. capability is also supported (as defined in [NETCONF] chapter 8.9.
XPath Capability), the device MUST also support using any XPath 1.0 XPath Capability), the device MUST also support using any XPath 1.0
expression in the select element. expression in the select element.
2.3. Capability Identifier 2.3. Capability Identifier
urn:ietf:params:netconf:capability:partial-lock:1.0 urn:ietf:params:netconf:capability:partial-lock:1.0
2.4. New Operations 2.4. New Operations
2.4.1. <partial-lock> 2.4.1. <partial-lock>
The <partial-lock> operation allows the client to lock a portion of The <partial-lock> operation allows the client to lock a portion of
one or more datastores. The portion to lock is specified with XPath the running datastore. The portion to lock is specified with XPath
expressions in the "select" elements and the list of datastores in expressions in the "select" elements in the <partial-lock> operation.
the "target" elements in the <partial-lock> operation. Each XPath Each XPath expression MUST return a node set.
expression MUST return a node set.
When a NETCONF session holds a lock on a node, no other session or When a NETCONF session holds a lock on a node, no other session or
non-NETCONF mechanism of the system can change that node or any node non-NETCONF mechanism of the system can change that node or any node
in the hierarchy of nodes beneath it. in the hierarchy of nodes beneath it.
Locking a node protects the node itself and the complete subtree Locking a node protects the node itself and the complete subtree
under the node from modification by others. The set of locked nodes under the node from modification by others. The set of locked nodes
is called the scope of the lock, while all the locked nodes and the is called the scope of the lock, while all the locked nodes and the
nodes in the subtrees under them make up the protected area. nodes in the subtrees under them make up the protected area.
In some situations it is desirable that the same set of nodes are
locked in more than one datastore. For example, if an interface is
configured in the candidate datastore, it is dangerous for it to be
configured by someone else in a possibly conflicting manner in the
running datastore. For this reason <partial-lock> allows the locking
of the same sections of the management data in multiple datastores.
The XPath expressions are evaluated only once at lock time. The XPath expressions are evaluated only once at lock time.
Thereafter, the scope of the lock is maintained as a set of nodes, Thereafter, the scope of the lock is maintained as a set of nodes,
i.e. the returned nodeset, and not by the XPath expression. If the i.e. the returned nodeset, and not by the XPath expression. If the
configuration data is later altered in a way that would make the configuration data is later altered in a way that would make the
original XPath expressions evaluate to a different set of nodes, this original XPath expressions evaluate to a different set of nodes, this
does not affect the scope of the partial lock. does not affect the scope of the partial lock.
Let's say the agent's data model includes a list of interface nodes. Let's say the agent's data model includes a list of interface nodes.
If the XPath expression in the partial lock operation covers all If the XPath expression in the partial lock operation covers all
interface nodes at locking, the scope of the lock will be maintained interface nodes at locking, the scope of the lock will be maintained
as the list of interface nodes at the time when the lock was granted. as the list of interface nodes at the time when the lock was granted.
If someone later creates a new interface, this new interface will not If someone later creates a new interface, this new interface will not
be included in the locked-nodes list created previously, the new be included in the locked-nodes list created previously so the new
interface will not be locked. interface will not be locked.
A <partial-lock> operation MUST be handled atomically by the NETCONF A <partial-lock> operation MUST be handled atomically by the NETCONF
server. The server either locks all requested parts of the server. The server either locks all requested parts of the datastore
datastore(s) or none. If during the <partial-lock> operation one of or none. If during the <partial-lock> operation one of the requested
the requested parts cannot be locked, the server MUST unlock all parts cannot be locked, the server MUST unlock all parts that have
parts that have already been locked during that operation. already been locked during that operation.
If a node in the scope of the lock is deleted, it is removed from the If a node in the scope of the lock is deleted by the session owning
scope of the lock, so any other session or non-NETCONF mechanism can the lock, it is removed from the scope of the lock, so any other
recreate it. If all nodes in the scope of the lock are deleted, the session or non-NETCONF mechanism can recreate it. If all nodes in
lock will still be present. However, its scope will become empty the scope of the lock are deleted, the lock will still be present.
(since the lock will not cover any nodes). However, its scope will become empty (since the lock will not cover
any nodes).
A NETCONF server MUST be able to grant multiple simultaneous partial A NETCONF server that supports partial locking MUST be able to grant
locks to a single NETCONF session. If the protected area of the multiple simultaneous partial locks to a single NETCONF session. If
individual locks overlaps, nodes in the common area MUST be protected the protected area of the individual locks overlap, nodes in the
until all of the locks are released. common area MUST be protected until all of the overlapping locks are
released.
A partial lock operation MUST fail if: A partial lock operation MUST fail if:
o Any NETCONF session (including the current session) owns the o Any NETCONF session (including the current session) owns the
global lock on any target datastore. global lock on the running datastore.
o Any part of the area to be protected is already locked (or o Any part of the area to be protected is already locked (or
protected by partial locking) by another management session, protected by partial locking) by another management session,
including other NETCONF sessions using <partial-lock> or any other including other NETCONF sessions using <partial-lock> or any other
non-NETCONF management method. non-NETCONF management method.
o The requesting user is not successfully authenticated.
o The NETCONF server implements access control, and the locking user o The NETCONF server implements access control, and the locking user
does not have sufficient access rights. The exact handling of does not have sufficient access rights. The exact handling of
access rights is outside the scope of this document, but it is access rights is outside the scope of this document, but it is
assumed that there is an access control system that MAY deny or assumed that there is an access control system that MAY deny or
allow the partial lock operation. allow the partial lock operation.
The <partial-lock> operation is designed for simplicity, so when a The <partial-lock> operation is designed for simplicity, so when a
partial lock is executed you get what you asked for: a set of nodes partial lock is executed you get what you asked for: a set of nodes
that are locked for writing. As a consequence users must observe the that are locked for writing. As a consequence users must observe the
following: following:
o Locking does not affect read operations. o Locking does not affect read operations.
o If part of a datastore is locked, this has no effect on any o If part of the running datastore is locked, this has no effect on
unlocked parts of the datastore. If this is a problem (e.g., any unlocked parts of the datastore. If this is a problem (e.g.,
changes depend on data values or nodes outside the protected part changes depend on data values or nodes outside the protected part
of the datastore), these nodes SHOULD be included in the protected of the datastore), these nodes SHOULD be included in the protected
area of the lock. area of the lock.
o Configuration data can be edited both inside and outside the o Configuration data can be edited both inside and outside the
protected area of a lock. It is the responsibility of the NETCONF protected area of a lock. It is the responsibility of the NETCONF
client application to lock all relevant parts of a datastore that client application to lock all relevant parts of the datastore
are crucial for a specific management action. that are crucial for a specific management action.
Note: The <partial-lock> operation does not modify the global <lock> Note: The <partial-lock> operation does not modify the global <lock>
operation defined in the base NETCONF Protocol [NETCONF]. If part of operation defined in the base NETCONF Protocol [NETCONF]. If part of
a datastore is already locked by <partial-lock>, then a global lock the running datastore is already locked by <partial-lock>, then a
for that datastore MUST fail even if the global lock is requested by global lock for the running datastore MUST fail even if the global
the NETCONF session that owns the partial lock. lock is requested by the NETCONF session that owns the partial lock.
2.4.1.1. Parameters, Result, Examples 2.4.1.1. Parameters, Result, Examples
Parameters: Parameters:
target: Name of one or more configuration datastores of which a part
shall be locked. If multiple datastores are specified the same
select parameter(s) are evaluated for each of them.
select: One or more 'select' elements, each containing an XPath select: One or more 'select' elements, each containing an XPath
expression. The XPath expression is evaluated in a context where expression. The XPath expression is evaluated in a context where
the context node is the root of the server's conceptual data the context node is the root of the server's conceptual data
model, and the set of namespace declarations are those in scope model, and the set of namespace declarations are those in scope
on the select element. on the select element.
Each select expression is evaluated for each targeted datastore.
The nodes returned from the select expressions are reported in The nodes returned from the select expressions are reported in
the rpc-reply message. the rpc-reply message.
Note that if some of the requested nodes exist only in some of
the targeted datastores, the lock is granted on different nodes
in different datastores.
Each select expression MUST return a node set, and at least one Each select expression MUST return a node set, and at least one
of the node sets for one of the specified datastores MUST be non- of the node sets MUST be non-empty.
empty.
If the device supports the :xpath capability, any valid XPath 1.0 If the device supports the :xpath capability, any valid XPath 1.0
expression can be used. If the device does not support the expression can be used. If the device does not support the
:xpath capability, the XPath expression MUST be limited to an :xpath capability, the XPath expression MUST be limited to an
Instance Identifier expression. An Instance Identifier is an Instance Identifier expression. An Instance Identifier is an
absolute path expression in abbreviated syntax, where predicates absolute path expression in abbreviated syntax, where predicates
are used only to specify values for nodes defined as keys to are used only to specify values for nodes defined as keys to
distinguish multiple instances. distinguish multiple instances.
Example: Lock virtual router 1 and interface eth1 Example: Lock virtual router 1 and interface eth1
<nc:rpc <nc:rpc
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="135"> message-id="135">
<partial-lock> <partial-lock>
<target>
<running/>
</target>
<select xmlns:rte="http://example.com/ns/route"> <select xmlns:rte="http://example.com/ns/route">
/rte:routing/rte:virtualRouter[rte:routerName='router1'] /rte:routing/rte:virtualRouter[rte:routerName='router1']
</select> </select>
<select xmlns:if="http://example.com/ns/interface"> <select xmlns:if="http://example.com/ns/interface">
/if:interfaces/if:interface[if:id='eth1'] /if:interfaces/if:interface[if:id='eth1']
</select> </select>
</partial-lock> </partial-lock>
</nc:rpc> </nc:rpc>
<nc:rpc-reply <nc:rpc-reply
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
message-id="135"> message-id="135">
<lock-id>127</lock-id> <lock-id>127</lock-id>
<running> <locked-node xmlns:rte="http://example.com/ns/route">
<locked-node xmlns:rte="http://example.com/ns/route"> /rte:routing/rte:virtualRouter[rte:routerName='router1']
/rte:routing/rte:virtualRouter[rte:routerName='router1'] </locked-node>
</locked-node> <locked-node xmlns:if="http://example.com/ns/interface">
<locked-node xmlns:if="http://example.com/ns/interface"> /if:interfaces/if:interface[if:id='eth1']
/if:interfaces/if:interface[if:id='eth1'] </locked-node>
</locked-node>
</running>
</nc:rpc-reply> </nc:rpc-reply>
Note: The XML Schema in [NETCONF] has a known bug which requires the
<data> XML element in a <rpc-reply>. This means that the above
examples will not validate using the XML Schema found in [NETCONF].
Positive Response: Positive Response:
If the device was able to satisfy the request, an <rpc-reply> is sent If the device was able to satisfy the request, an <rpc-reply> is sent
with a <lock-id> element (lock identifier) in the <rpc-reply> with a <lock-id> element (lock identifier) in the <rpc-reply>
element. A list of locked nodes per datastore is also returned in element. A list of locked nodes is also returned in Instance
Instance Identifier format. Identifier format.
Negative Response: Negative Response:
If a lock is already held by another session on any node within the
subtrees to be locked, the <error-tag> element is 'lock-denied' and
the <error-info> element includes the <session-id> of the lock owner.
If the lock is held by a non-NETCONF session, a <session-id> of 0
(zero) is included. If needed the returned session-id may be used to
<kill-session> the NETCONF session holding the lock. The same error
response is returned if the requesting session already holds the
(global) lock for the same datastore.
If any select expression is an invalid XPath expression, the <error- If any select expression is an invalid XPath expression, the <error-
tag> is 'invalid-value'. tag> is 'invalid-value'.
If any select expression returns something other than a node set, the If any select expression returns something other than a node set, the
<error-tag> is 'invalid-value', and the <error-app-tag> is 'not-a- <error-tag> is 'invalid-value', and the <error-app-tag> is 'not-a-
node-set'. node-set'.
If all the select expressions return an empty node set, the <error- If all the select expressions return an empty node set, the <error-
tag> is 'operation-failed', and the <error-app-tag> is 'no-matches'. tag> is 'operation-failed', and the <error-app-tag> is 'no-matches'.
If any of the target datastores does not exist, the <error-tag> is
'invalid-value', the <error-app-tag> is 'invalid-lock-specification'
If the :xpath capability is not supported and the XPath expression is If the :xpath capability is not supported and the XPath expression is
not an Instance Identifier, the <error-tag> is 'invalid-value', the not an Instance Identifier, the <error-tag> is 'invalid-value', the
<error-app-tag> is 'invalid-lock-specification'. <error-app-tag> is 'invalid-lock-specification'.
If access control denies the partial lock, the <error-tag> is If access control denies the partial lock, the <error-tag> is
'access-denied'. 'access-denied'. Access control SHOULD be checked before checking
for conflicting locks to avoid giving out information about other
sessions to an unauthorized client.
If a lock is already held by another session on any node within the
subtrees to be locked, the <error-tag> element is 'lock-denied' and
the <error-info> element includes the <session-id> of the lock owner.
If the lock is held by a non-NETCONF session, a <session-id> of 0
(zero) SHOULD be included. The same error response is returned if
the requesting session already holds the (global) lock for the
running datastore.
If needed the returned session-id may be used to <kill-session> the
NETCONF session holding the lock.
2.4.1.2. Deadlock Avoidance 2.4.1.2. Deadlock Avoidance
As with most locking systems, it is possible that two management As with most locking systems, it is possible that two management
sessions trying to lock different parts of the configuration could sessions trying to lock different parts of the configuration could
become dead-locked. To avoid this situation, clients SHOULD lock become dead-locked. To avoid this situation, clients SHOULD lock
everything they need in one operation. If locking fails, the client everything they need in one operation. If locking fails, the client
MUST back-off, release any previously acquired locks, and SHOULD MUST back-off, release any previously acquired locks, and SHOULD
retry the procedure after waiting some randomized time interval. retry the procedure after waiting some randomized time interval.
2.4.2. <partial-unlock> 2.4.2. <partial-unlock>
The operation unlocks the parts of the datastores that were The operation unlocks the parts of the running datastore that were
previously locked using <partial-lock> during the same session. previously locked using <partial-lock> during the same session. The
operation unlocks the parts that are covered by the lock identified
by the lock-id parameter. In case of multiple potentially
overlapping locks, only the lock identified by the lock-id is
removed.
Parameters: Parameters:
lock-id: Identity of the lock to be unlocked. This lock-id MUST lock-id: Identity of the lock to be unlocked. This lock-id MUST
have been received as a response to a lock request by the manager have been received as a response to a lock request by the manager
during the current session, and MUST NOT have been sent in a during the current session, and MUST NOT have been sent in a
previous unlock request. previous unlock request.
Example: Unlock a previously created lock Example: Unlock a previously created lock
skipping to change at page 13, line 19 skipping to change at page 11, line 24
message-id="136"> message-id="136">
<partial-unlock> <partial-unlock>
<lock-id>127</lock-id> <lock-id>127</lock-id>
</partial-unlock> </partial-unlock>
</nc:rpc> </nc:rpc>
Positive Response: Positive Response:
If the device was able to satisfy the request, an <rpc-reply> is sent If the device was able to satisfy the request, an <rpc-reply> is sent
that contains an <ok> element. A positive response MUST be sent even that contains an <ok> element. A positive response MUST be sent even
if all of the locked parts of the datastore(s) have already been if all of the locked parts of the datastore have already been
deleted. deleted.
Negative Response: Negative Response:
If the <lock-id> parameter does not identify a lock which is owned by If the <lock-id> parameter does not identify a lock which is owned by
the session, an 'invalid-value' error is returned. the session, an 'invalid-value' error is returned.
2.5. Modifications to Existing Operations 2.5. Modifications to Existing Operations
A successful partial lock will cause a subsequent operation to fail A successful partial lock will cause a subsequent operation to fail
if that attempts to modify nodes in the protected area of the lock if that operation attempts to modify nodes in the protected area of
and is executed in a NETCONF session other than the session that has the lock and is executed in a NETCONF session other than the session
been granted the lock. The <error-tag> 'in-use' and the <error-app- that has been granted the lock. The <error-tag> 'in-use' and the
tag> 'locked' is returned. All operations that modify the datastore <error-app-tag> 'locked' is returned. All operations that modify the
are affected, including: <edit-config>, <copy-config>, <delete- running datastore are affected, including: <edit-config>, <copy-
config>, <commit> and <discard-changes>. If partial lock prevents config>, <delete-config>, <commit> and <discard-changes>. If partial
<edit-config> modifying some data, but the operation includes the lock prevents <edit-config> modifying some data, but the operation
continue-on-error option, modification of other parts of the includes the continue-on-error option, modification of other parts of
datastore, which are not protected by partial locking, might still the datastore, which are not protected by partial locking, might
succeed. still succeed.
If a datastore contains nodes locked by partial lock, this will cause If the datastore contains nodes locked by partial lock, this will
the (global) <lock> operation to fail. The <error-tag> element cause the (global) <lock> operation to fail. The <error-tag> element
'lock-denied' and an <error-info> element including the <session-id> 'lock-denied' and an <error-info> element including the <session-id>
of the lock owner will be returned. If the lock is held by a non- of the lock owner will be returned. If the lock is held by a non-
NETCONF session, a <session-id> of 0 (zero) is returned. NETCONF session, a <session-id> of 0 (zero) is returned.
All of these operations are affected only if they are targeting the All of these operations are affected only if they are targeting the
same datastore. running datastore.
2.6. Interactions with Other Capabilities 2.6. Interactions with Other Capabilities
2.6.1. Candidate Configuration Capability 2.6.1. Candidate Configuration Capability
Partial locking of the candidate datastore can only be done if the The candidate datastore can not be locked using the <partial-lock>
:candidate capability is supported by the device. Partial locking of operation.
the candidate datastore does not depend on whether the datastore was
modified or not.
2.6.2. Confirmed Commit Capability 2.6.2. Confirmed Commit Capability
If: If:
o a partial lock is requested for the running datastore, and o a partial lock is requested for the running datastore, and
o the NETCONF server implements the :confirmed-commit capability, o the NETCONF server implements the :confirmed-commit capability,
and and
skipping to change at page 14, line 35 skipping to change at page 12, line 37
then the lock MUST be denied, because if the confirmation does not then the lock MUST be denied, because if the confirmation does not
arrive, the running datastore MUST be rolled back to its state before arrive, the running datastore MUST be rolled back to its state before
the commit. The NETCONF server might therefore need to modify the the commit. The NETCONF server might therefore need to modify the
configuration. configuration.
In this case the <error-tag> 'in-use' and the <error-app-tag> In this case the <error-tag> 'in-use' and the <error-app-tag>
'outstanding-confirmed-commit' is returned. 'outstanding-confirmed-commit' is returned.
2.6.3. Distinct Startup Capability 2.6.3. Distinct Startup Capability
Partial locking of the startup datastore can only be done if the The startup datastore can not be locked using the <partial-lock>
:startup capability is supported by the device. operation.
3. Security Considerations 3. Security Considerations
The same considerations are relevant as for the base NETCONF Protocol The same considerations are relevant as for the base NETCONF Protocol
[NETCONF]. It is assumed that the <partial-lock> and <partial- [NETCONF]. <partial-lock> and <partial-unlock> RPCs MUST only be
unlock> RPCs are only allowed for an authenticated user after passing allowed for an authenticated user. <partial-lock> and <partial-
some access control mechanism. unlock> RPCs SHOULD only be allowed for an authorized user. However
as NETCONF access control is not standardized and not a mandatory
part of a NETCONF implementation, it is strongly recommended, but
OPTIONAL. (although nearly all implementations include some kind of
access control)
A lock (either a partial lock or a global lock) might prevent other A lock (either a partial lock or a global lock) might prevent other
users from configuring the system. The following mechanisms are in users from configuring the system. The following mechanisms are in
place to prevent the misuse of this possibility: place to prevent the misuse of this possibility:
Only an authenticated and authorized user can request a partial A user, that is not successfully authenticated, MUST NOT be
lock. granted a partial lock.
Only an authorized user SHOULD be able to request a partial lock.
The partial lock is automatically released when a session is The partial lock is automatically released when a session is
terminated regardless of how the session ends. terminated regardless of how the session ends.
The <kill-session> operation makes it possible to terminate other The <kill-session> operation makes it possible to terminate other
users's sessions. users's sessions.
The NETCONF server may log partial lock requests in an audit The NETCONF server MAY log partial lock requests in an audit
trail. trail.
A lock that is hung for some reason (e.g., a broken TCP connection A lock that is hung for some reason (e.g., a broken TCP connection
that the server has not yet recognised) can be released using another that the server has not yet recognised) can be released using another
NETCONF session by explicitly killing the session owning that lock NETCONF session by explicitly killing the session owning that lock
using the <kill-session> operation. using the <kill-session> operation.
Partial locking is not an authorization mechanism; it SHOULD NOT be Partial locking is not an authorization mechanism; it SHOULD NOT be
used to provide security or access control. Partial locking SHOULD used to provide security or access control. Partial locking SHOULD
only be used as a mechanism for providing consistency when multiple only be used as a mechanism for providing consistency when multiple
skipping to change at page 16, line 10 skipping to change at page 15, line 10
Registrant Contact: The IESG. Registrant Contact: The IESG.
XML: N/A, the requested URI is an XML namespace. XML: N/A, the requested URI is an XML namespace.
5. Appendix A - XML Schema for Partial Locking (normative) 5. Appendix A - XML Schema for Partial Locking (normative)
The following XML Schema defines the <partial-lock> and <partial- The following XML Schema defines the <partial-lock> and <partial-
unlock> operations: unlock> operations:
-- RFC Ed.: Insert license information for code as appropriate
<CODE BEGINS>
<?xml version="1.0" encoding="UTF-8"?> <?xml version="1.0" encoding="UTF-8"?>
<xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema" <xs:schema xmlns:xs="http://www.w3.org/2001/XMLSchema"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
targetNamespace="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" targetNamespace="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
elementFormDefault="qualified" attributeFormDefault="unqualified"> elementFormDefault="qualified" attributeFormDefault="unqualified">
<xs:annotation>
<xs:documentation>
Schema defining the partial-lock and unlock operations.
organization "IETF NETCONF Working Group"
contact
Netconf Working Group
Mailing list: netconf@ietf.org
Web: http://www.ietf.org/html.charters/netconf-charter.html
Balazs Lengyel
balazs.lengyel@ericsson.com"
revision 2009-02-19
description Initial version, published as RFC yyyy.
-- RFC Ed.: replace yyyy with actual RFC number and remove this note.
</xs:documentation>
</xs:annotation>
<xs:import namespace="urn:ietf:params:xml:ns:netconf:base:1.0"
schemaLocation="urn:ietf:params:xml:ns:netconf:base:1.0"/>
<xs:simpleType name="lock-id-type">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
A number identifying a specific Schema defining the partial-lock and unlock operations.
partial-lock granted to a session. organization "IETF NETCONF Working Group"
It is allocated by the system, and SHOULD
be used in the unlock operation.
</xs:documentation>
</xs:annotation>
<xs:restriction base="xs:unsignedInt"/>
</xs:simpleType>
<xs:complexType name="configNameType"/> contact
<xs:element name="config-name" Netconf Working Group
type="configNameType" abstract="true"/> Mailing list: netconf@ietf.org
<xs:element name="startup" type="configNameType" Web: http://www.ietf.org/html.charters/netconf-charter.html
substitutionGroup="config-name"/>
<xs:element name="candidate" type="configNameType"
substitutionGroup="config-name"/>
<xs:element name="running" type="configNameType"
substitutionGroup="config-name"/>
<xs:complexType name="partialLockType"> Balazs Lengyel
<xs:annotation> balazs.lengyel@ericsson.com"
<xs:documentation>
A NETCONF operation that locks part of one or more datastores.
</xs:documentation>
</xs:annotation>
<xs:complexContent>
<xs:extension base="nc:rpcOperationType">
<xs:sequence>
<xs:element name="target" maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
A list of one or more datastore names for NETCONF.
Each target element MUST contain a different
datastore name.
</xs:documentation>
</xs:annotation>
<xs:complexType>
<xs:sequence>
<xs:element ref="config-name"/>
</xs:sequence>
</xs:complexType>
</xs:element>
<xs:element name="select" type="xs:string"
maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
XPath expression that specifies the scope of the lock.
An Instance Identifier expression must be used unless
the :xpath capability is supported in which case any
XPath 1.0 expression is allowed.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="partialUnLockType"> revision 2009-10-19
<xs:annotation> description Initial version, published as RFC yyyy.
<xs:documentation> -- RFC Ed.: replace yyyy with actual RFC number and remove this note.
A NETCONF operation that releases a previously acquired </xs:documentation>
partial-lock.
</xs:documentation>
</xs:annotation> </xs:annotation>
<xs:complexContent>
<xs:extension base="nc:rpcOperationType">
<xs:sequence>
<xs:element name="lock-id" type="lock-id-type">
<xs:annotation>
<xs:documentation>
Identifies the lock to be released. MUST be the value
received in the response to the partial-lock operation.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- <partial-lock> operation -->
<xs:element name="partial-lock" type="partialLockType"
substitutionGroup="nc:rpcOperation"/>
<!-- <partial-unlock> operation --> <xs:import namespace="urn:ietf:params:xml:ns:netconf:base:1.0"
<xs:element name="partial-unlock" type="partialUnLockType" schemaLocation="urn:ietf:params:xml:ns:netconf:base:1.0"/>
substitutionGroup="nc:rpcOperation"/>
<!-- reply to <partial-lock> -->
<xs:complexType name="contentPartInPartialLockReplyType"> <xs:simpleType name="lock-id-type">
<xs:annotation>
<xs:documentation>
The content of the reply to a successful
partial-lock request MUST conform to this complex type.
</xs:documentation>
</xs:annotation>
<xs:sequence>
<xs:element name="lock-id" type="lock-id-type">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
Identifies the lock to be released. Must be the value A number identifying a specific
received in the response to the partial-lock operation. partial-lock granted to a session.
</xs:documentation> It is allocated by the system, and SHOULD
be used in the unlock operation.
</xs:documentation>
</xs:annotation> </xs:annotation>
</xs:element> <xs:restriction base="xs:unsignedInt"/>
<xs:element name="running" minOccurs="0"> </xs:simpleType>
<xs:complexType name="partialLockType">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
List of locked nodes in the running datastore. A NETCONF operation that locks parts of
</xs:documentation> the running datastore.
</xs:documentation>
</xs:annotation> </xs:annotation>
<xs:complexType> <xs:complexContent>
<xs:sequence> <xs:extension base="nc:rpcOperationType">
<xs:element name="locked-node" type="xs:string" <xs:sequence>
maxOccurs="unbounded"> <xs:element name="select" type="xs:string"
</xs:element> maxOccurs="unbounded">
</xs:sequence> <xs:annotation>
</xs:complexType> <xs:documentation>
</xs:element> XPath expression that specifies the scope
<xs:element name="candidate" minOccurs="0"> of the lock. An Instance Identifier
expression must be used unless the :xpath
capability is supported in which case any
XPath 1.0 expression is allowed.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<xs:complexType name="partialUnLockType">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
List of locked nodes in the candidate datastore. A NETCONF operation that releases a previously acquired
</xs:documentation> partial-lock.
</xs:documentation>
</xs:annotation> </xs:annotation>
<xs:complexType> <xs:complexContent>
<xs:sequence> <xs:extension base="nc:rpcOperationType">
<xs:element name="locked-node" type="xs:string" <xs:sequence>
maxOccurs="unbounded"> <xs:element name="lock-id" type="lock-id-type">
</xs:element> <xs:annotation>
</xs:sequence> <xs:documentation>
</xs:complexType> Identifies the lock to be released. MUST
</xs:element> be the value received in the response to
<xs:element name="startup" minOccurs="0"> the partial-lock operation.
</xs:documentation>
</xs:annotation>
</xs:element>
</xs:sequence>
</xs:extension>
</xs:complexContent>
</xs:complexType>
<!-- <partial-lock> operation -->
<xs:element name="partial-lock" type="partialLockType"
substitutionGroup="nc:rpcOperation"/>
<!-- <partial-unlock> operation -->
<xs:element name="partial-unlock" type="partialUnLockType"
substitutionGroup="nc:rpcOperation"/>
<!-- reply to <partial-lock> -->
<xs:complexType name="contentPartInPartialLockReplyType">
<xs:annotation> <xs:annotation>
<xs:documentation> <xs:documentation>
List of locked nodes in the startup datastore. The content of the reply to a successful
</xs:documentation> partial-lock request MUST conform to this complex type.
</xs:documentation>
</xs:annotation> </xs:annotation>
<xs:complexType> <xs:sequence>
<xs:sequence> <xs:element name="lock-id" type="lock-id-type">
<xs:annotation>
<xs:documentation>
Identifies the lock to be released. Must be the value
received in the response to a partial-lock operation.
</xs:documentation>
</xs:annotation>
</xs:element>
<xs:element name="locked-node" type="xs:string" <xs:element name="locked-node" type="xs:string"
maxOccurs="unbounded"> maxOccurs="unbounded">
<xs:annotation>
<xs:documentation>
List of locked nodes in the running datastore.
</xs:documentation>
</xs:annotation>
</xs:element> </xs:element>
</xs:sequence> </xs:sequence>
</xs:complexType> </xs:complexType>
</xs:element>
</xs:sequence>
</xs:complexType>
</xs:schema> </xs:schema>
<CODE ENDS>
6. Appendix B - YANG Module for Partial Locking (non-normative) 6. Appendix B - YANG Module for Partial Locking (non-normative)
The following YANG module defines the <partial-lock> and <partial- The following YANG module defines the <partial-lock> and <partial-
unlock> operations. The YANG language is defined in unlock> operations. The YANG language is defined in
[I-D.ietf-netmod-yang]. [I-D.ietf-netmod-yang].
-- RFC Ed.: Insert license information for code as appropriate
<CODE BEGINS>
module ietf-netconf-partial-lock { module ietf-netconf-partial-lock {
namespace urn:ietf:params:xml:ns:netconf:partial-lock:1.0; namespace urn:ietf:params:xml:ns:netconf:partial-lock:1.0;
prefix pl; prefix pl;
organization "IETF Network Configuration (netconf) Working Group"; organization "IETF Network Configuration (netconf) Working Group";
contact contact
"Netconf Working Group "Netconf Working Group
Mailing list: netconf@ietf.org Mailing list: netconf@ietf.org
Web: http://www.ietf.org/html.charters/netconf-charter.html Web: http://www.ietf.org/html.charters/netconf-charter.html
Balazs Lengyel Balazs Lengyel
Ericsson Ericsson
balazs.lengyel@ericsson.com"; balazs.lengyel@ericsson.com";
description description
"This YANG module defines the <partial-lock> and "This YANG module defines the <partial-lock> and
<partial-unlock> operations."; <partial-unlock> operations.";
revision 2009-02-19 { revision 2009-10-19 {
description description
"Initial version, published as RFC yyyy."; "Initial version, published as RFC yyyy.";
// RFC Ed.: replace yyyy with actual RFC number & remove this note. // RFC Ed.: replace yyyy with actual RFC number & remove this note.
} }
typedef lock-id-type { typedef lock-id-type {
type uint32; type uint32;
description description
"A number identifying a specific partial-lock granted to a session. "A number identifying a specific partial-lock granted to a session.
It is allocated by the system, and SHOULD be used in the It is allocated by the system, and SHOULD be used in the
partial-unlock operation."; partial-unlock operation.";
} }
rpc partial-lock { rpc partial-lock {
description description
"A NETCONF operation that locks part of one or more datastores."; "A NETCONF operation that locks parts of the running datastore.";
input { input {
list target {
min-elements 1;
description
"A list of one or more datastore names.
Each list entry must contain a different datastore name.";
choice datastore {
leaf running { type empty; }
leaf candidate { type empty; }
leaf startup { type empty; }
}
}
leaf-list select { leaf-list select {
type string; type string;
min-elements 1; min-elements 1;
description description
"XPath expression that specifies the scope of the lock. "XPath expression that specifies the scope of the lock.
An Instance Identifier expression MUST be used unless the An Instance Identifier expression MUST be used unless the
:xpath capability is supported, in which case any XPath 1.0 :xpath capability is supported, in which case any XPath 1.0
expression is allowed."; expression is allowed.";
} }
} }
output { output {
leaf lock-id { leaf lock-id {
type lock-id-type; type lock-id-type;
description description
"Identifies the lock, if granted. The lock-id SHOULD be "Identifies the lock, if granted. The lock-id SHOULD be
used in the partial-unlock rpc."; used in the partial-unlock rpc.";
} }
container running { leaf-list locked-node {
leaf-list locked-node { type instance-identifier;
type instance-identifier; min-elements 1;
min-elements 1; description
description "List of locked nodes in the running datastore";
"List of locked nodes in the running datastore";
}
}
container candidate {
leaf-list locked-node {
type instance-identifier;
min-elements 1;
description
"List of locked nodes in the candidate datastore";
}
}
container startup {
leaf-list locked-node {
type instance-identifier;
min-elements 1;
description
"List of locked nodes in the startup datastore";
}
} }
} }
} }
rpc partial-unlock { rpc partial-unlock {
description description
"A NETCONF operation that releases a previously acquired "A NETCONF operation that releases a previously acquired
partial-lock."; partial-lock.";
input { input {
leaf lock-id { leaf lock-id {
type lock-id-type; type lock-id-type;
skipping to change at page 22, line 17 skipping to change at page 19, line 38
rpc partial-unlock { rpc partial-unlock {
description description
"A NETCONF operation that releases a previously acquired "A NETCONF operation that releases a previously acquired
partial-lock."; partial-lock.";
input { input {
leaf lock-id { leaf lock-id {
type lock-id-type; type lock-id-type;
description description
"Identifies the lock to be released. MUST be the value "Identifies the lock to be released. MUST be the value
received in the response to the partial-lock operation."; received in the response to a partial-lock operation.";
} }
} }
} }
} }
<CODE ENDS>
7. Appendix C - Usage Example - Reserving nodes for future editing 7. Appendix C - Usage Example - Reserving nodes for future editing
(non-normative) (non-normative)
Partial lock cannot be used to lock non-existent nodes, which would Partial lock cannot be used to lock non-existent nodes, which would
effectively attempt to reserve them for future use. To guarantee effectively attempt to reserve them for future use. To guarantee
that a node cannot be created by some other session, the parent node that a node cannot be created by some other session, the parent node
should be locked, the top level node of the new subtree created, and should be locked, the top level node of the new subtree created, and
then locked with another <partial-lock> operation. After this, the then locked with another <partial-lock> operation. After this, the
lock on the parent node should be removed. lock on the parent node should be removed.
In this chapter an example illustrating the above is given. In this chapter an example illustrating the above is given.
We want to create <user> Joe under <users>, and start editing it. We want to create <user> Joe under <users>, and start editing it.
Editing might take a number of minutes. We want to immediately lock Editing might take a number of minutes. We want to immediately lock
Joe so no one will touch it before we are finished with the editing. Joe so no one will touch it before we are finished with the editing.
We also want to minimize locking other parts of the datastore as We also want to minimize locking other parts of the running datastore
multiple managers might be adding users near simultaneously. as multiple managers might be adding users near simultaneously.
First we check what users are already defined. First we check what users are already defined.
Step 1 - Read existing users Step 1 - Read existing users
<rpc message-id="101" <rpc message-id="101"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<get-config> <get-config>
<source> <source>
<running/> <running/>
skipping to change at page 24, line 37 skipping to change at page 21, line 37
new user "Joe", which we will create after locking. So we rather new user "Joe", which we will create after locking. So we rather
have to lock the <users> node. have to lock the <users> node.
Step 3 - Lock users Step 3 - Lock users
<nc:rpc <nc:rpc
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
message-id="102"> message-id="102">
<partial-lock> <partial-lock>
<target>
<running/>
</target>
<select xmlns:usr="http://example.com/users"> <select xmlns:usr="http://example.com/users">
/usr:top/usr:users /usr:top/usr:users
</select> </select>
</partial-lock> </partial-lock>
</nc:rpc> </nc:rpc>
The NETCONF server grants the partial lock. The scope of the lock The NETCONF server grants the partial lock. The scope of the lock
includes only the <users> node. The lock protects the <users> node includes only the <users> node. The lock protects the <users> node
and all <user> nodes below it from modification (by other sessions). and all <user> nodes below it from modification (by other sessions).
Step 4 - Receive lock Step 4 - Receive lock
<nc:rpc-reply <nc:rpc-reply
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
message-id="102"> message-id="102">
<lock-id>1</lock-id> <lock-id>1</lock-id>
<running> <locked-node xmlns:usr="http://example.com/users">
<locked-node xmlns:usr="http://example.com/users"> /usr:top/usr:users
/usr:top/usr:users </locked-node>
</locked-node>
</running>
</nc:rpc-reply> </nc:rpc-reply>
Next we create user Joe. Joe is protected by the lock received above, Next we create user Joe. Joe is protected by the lock received above,
as it is under the sub-tree rooted at the <users> node. as it is under the sub-tree rooted at the <users> node.
Step 5 - Create user Joe Step 5 - Create user Joe
<rpc message-id="103" <rpc message-id="103"
xmlns="urn:ietf:params:xml:ns:netconf:base:1.0"> xmlns="urn:ietf:params:xml:ns:netconf:base:1.0">
<edit-config> <edit-config>
skipping to change at page 26, line 12 skipping to change at page 23, line 12
on the <users> node. This will allow other managers to create on the <users> node. This will allow other managers to create
additional new users. additional new users.
Step 6 - Lock user Joe Step 6 - Lock user Joe
<nc:rpc <nc:rpc
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
message-id="104"> message-id="104">
<partial-lock> <partial-lock>
<target>
<running/>
</target>
<select xmlns:usr="http://example.com/users"> <select xmlns:usr="http://example.com/users">
/usr:top/usr:users/user[usr:name="Joe"]" /usr:top/usr:users/user[usr:name="Joe"]"
</select> </select>
</partial-lock> </partial-lock>
</nc:rpc> </nc:rpc>
The NETCONF server grants the partial lock. The scope of this second The NETCONF server grants the partial lock. The scope of this second
lock includes only the <user> node with name Joe. The lock protects lock includes only the <user> node with name Joe. The lock protects
all data below this particular <user> node. all data below this particular <user> node.
Step 7 - Receive lock Step 7 - Receive lock
<nc:rpc-reply <nc:rpc-reply
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
message-id="104"> message-id="104">
<lock-id>2</lock-id> <lock-id>2</lock-id>
<running> <locked-node xmlns:usr="http://example.com/users">
<locked-node xmlns:usr="http://example.com/users"> /usr:top/usr:users/user[usr:name="Joe"]"
/usr:top/usr:users/user[usr:name="Joe"]" </locked-node>
</locked-node>
</running>
</nc:rpc-reply> </nc:rpc-reply>
The scope of the second lock is the <user> node Joe. It protects this The scope of the second lock is the <user> node Joe. It protects this
<user> node and any data below it (e.g. phone number). At this point <user> node and any data below it (e.g. phone number). At this point
of time these nodes are protected both by the first and second lock. of time these nodes are protected both by the first and second lock.
Next we unlock the other <user>s and the <users> node, to allow other Next we unlock the other <user>s and the <users> node, to allow other
managers to work on them. We still keep the second lock, so the managers to work on them. We still keep the second lock, so the
<user> node Joe and the sub-tree below is still protected. <user> node Joe and the sub-tree below is still protected.
Step 8 - Release lock on <users> Step 8 - Release lock on <users>
skipping to change at page 28, line 7 skipping to change at page 24, line 7
<nc:rpc xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0" <nc:rpc xmlns="urn:ietf:params:xml:ns:netconf:partial-lock:1.0"
xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0" xmlns:nc="urn:ietf:params:xml:ns:netconf:base:1.0"
message-id="105"> message-id="105">
<partial-unlock> <partial-unlock>
<lock-id>1</lock-id> <lock-id>1</lock-id>
</partial-unlock> </partial-unlock>
</nc:rpc> </nc:rpc>
8. Appendix D - Change Log 8. Appendix D - Change Log
8.1. 08-09 8.1. 09-10
Clarifications Clarifications
8.2. 07-08 Only the running datastore can be locked
8.2. 08-09
Clarifications Clarifications
8.3. 06-07 8.3. 07-08
Clarifications
8.4. 06-07
Changed XSD and YANG to allow additional proprietary datastores to be Changed XSD and YANG to allow additional proprietary datastores to be
locked. locked.
8.4. 05-06 8.5. 05-06
Added usage example Added usage example
Clarified error messages Clarified error messages
Clarified interaction with edit-config continue-on-error Clarified interaction with edit-config continue-on-error
Improved YANG: indentation, canonical order, contact info Improved YANG: indentation, canonical order, contact info
Added usage example in appendix C Added usage example in appendix C
Synchronized YANG and XSD Synchronized YANG and XSD
8.5. 04-05 8.6. 04-05
Language and editorial updates Language and editorial updates
all app-tags are with dashes without spaces all app-tags are with dashes without spaces
Added usage scenarios Added usage scenarios
Changed encoding Changed encoding
Clarified definitions, separated scope of lock and protected area Clarified definitions, separated scope of lock and protected area
8.6. 03-04 8.7. 03-04
Minor clarifications Minor clarifications
Added list of locked-nodes to the output of partial-lock. Added list of locked-nodes to the output of partial-lock.
Added <target> wrapper around datastore names. Added <target> wrapper around datastore names.
Allowed atomic/one operation locking of datastore parts in multiple Allowed atomic/one operation locking of datastore parts in multiple
datastores. datastores.
Improved English (hopefully) Improved English (hopefully)
Removed the <data> element from rpc-reply following the text of Removed the <data> element from rpc-reply following the text of
rfc4741. rfc4741.
8.7. 02-03 8.8. 02-03
Minor clarifications Minor clarifications
Same descriptions in XSD and YANG. Same descriptions in XSD and YANG.
8.8. 01-02 8.9. 01-02
Made XSD normative Made XSD normative
Clarified that no specific access control is assumed. Clarified that no specific access control is assumed.
Clarified that non-existing nodes are NOT covered by the lock, even Clarified that non-existing nodes are NOT covered by the lock, even
if they where existing and covered by the lock when it was originally if they where existing and covered by the lock when it was originally
granted. granted.
Some rewording Some rewording
Added app-tags for two of the error cases. Added app-tags for two of the error cases.
Made YANG an informative reference Made YANG an informative reference
Enhanced security considerations. Enhanced security considerations.
8.9. 00-01 8.10. 00-01
Added YANG module. Added YANG module.
8.10. -00 8.11. -00
Created from draft-lengyel-ngo-partial-lock-01.txt Created from draft-lengyel-ngo-partial-lock-01.txt
9. Acknowledgements 9. Acknowledgements
Thanks to Andy Bierman, Sharon Chisholm, Phil Shafer , David Thanks to Andy Bierman, Sharon Chisholm, Phil Shafer , David
Harrington, Mehmet Ersue, Wes Hardaker, Juergen Schoenwaelder, Washam Harrington, Mehmet Ersue, Wes Hardaker, Juergen Schoenwaelder, Washam
Fan and many other members of the NETCONF WG for providing important Fan and many other members of the NETCONF WG for providing important
input to this document. input to this document.
skipping to change at page 31, line 22 skipping to change at page 27, line 22
[RFC2119] Bradner, S., "Key words for use in RFCs to Indicate [RFC2119] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", BCP 14, RFC 2119, March 1997. Requirement Levels", BCP 14, RFC 2119, March 1997.
[RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688, [RFC3688] Mealling, M., "The IETF XML Registry", BCP 81, RFC 3688,
January 2004. January 2004.
10.2. Informative References 10.2. Informative References
[I-D.ietf-netmod-yang] [I-D.ietf-netmod-yang]
Bjorklund, M., "YANG - A data modeling language for Bjorklund, M., "YANG - A data modeling language for
NETCONF", draft-ietf-netmod-yang-06 (work in progress), NETCONF", draft-ietf-netmod-yang-07 (work in progress),
June 2009. July 2009.
Authors' Addresses Authors' Addresses
Balazs Lengyel Balazs Lengyel
Ericsson Ericsson
Email: balazs.lengyel@ericsson.com Email: balazs.lengyel@ericsson.com
Martin Bjorklund Martin Bjorklund
Tail-f Systems Tail-f Systems
 End of changes. 90 change blocks. 
428 lines changed or deleted 292 lines changed or added

This html diff was produced by rfcdiff 1.37a. The latest version is available from http://tools.ietf.org/tools/rfcdiff/