Locking and unlocking datastores

While performing edit-config operation, you may wish to lock the datastore temporarily to avoid conflicting changes being introduced from another source. YANG Suite makes it easy to do so while you have a session open to a device.

Locking a datastore(s)

  1. Before acquiring the lock, you must have an active NETCONF session with the device. First, choose a device and select “Open device window”. A window will be opened showing that there is not currently a session with this device.

    Screenshot showing the device session window with no active session.
  2. Click “Start Session” and after a moment you will see that a session is now active between YANG Suite and the given device.

    Screenshot showing a window indicating that NETCONF session has started.
  3. Once the session is open, you can acquire a lock on any datastore supported by the selected device, simply by clicking the appropriate button at the top of the window.

    Screenshot showing the "candidate", "running", and "startup" buttons.
  4. You will see a message reporting whether the lock was successful, and if it was, the button will now change appearance to reflect this change.

    Screenshot showing a log message indicating successful locking and the "running" button now showing a locked state.

Repeat steps 3-4 to lock an additional datastore with the same device. Once the required datastore is locked successfully, you can proceed with your get-config and edit-config operations.

If the selected datastore is already locked by some other user when you try to acquire the lock, YANG Suite will retry its attempt to gain the lock on the datastore till the specified retry timer expires or the lock is acquired. Below screenshot shows the lock retry messages being displayed.

Screenshot showing Lock retry messages.

Unlocking a datastore(s)

Any locks are automatically unlocked when the NETCONF session is ended, either by clicking the “End Session” button or by closing the session window.

If you wish to unlock a datastore while maintaining the session, simply click the locked datastore button to unlock it.

Screenshot showing the "candidate", "running", and "startup" buttons.

A message will be appended to the window showing whether the unlock operation was successful or not.

Screenshot showing the unlock message.