Provisiond

This document describes the end result of an in progress project to finish splitting provisiond from configd. The code may not reflect this design at this time.


Like many long lived systems DANOS has a fair amount of legacy code. Provisiond is a VCI component that allows this legacy code to continue to function and interact with other VCI Components.

With the introduction of VCI (Vyatta Component Infrastructure) there is a continuing need to manage the legacy configuration that has not been componentised.  This is done by a legacy provisioning manager, - "provisiond", which is implemented as a VCI component.

Responsibilities of provisiond

YANG files

Provisiond owns all YANG files that are not explicitly owned by any other VCI component. The provisiond ".component" file uses the "DefaultComponent" option to indicate this is the default component that should be assigned all unowned YANG files.  VCI checks that there is no more than one default component at boot time.

configd scripts and extensions

With legacy functionality moved into provisiond, there are changes to the availability of configd YANG extensions. These are done by convention (that is, not enforced by the YANG compiler).

provisiond-only extensions

The following configd extensions are handled by provisiond and cannot be used by other VCI components.  In the case of action scripts, this is because they represent legacy functionality that goes against the whole concept of the VCI configuration model.  "RPC" and operational state information is accessed over the VCI bus in a way that makes "call-rpc" and "get-state" redundant. Both "call-rpc" and "get-state" actions will be called by provisiond for legacy parts of the system. Provisiond implements this functionality as a component on behalf of the legacy code. This encapsulates the legacy behavior behind the component interface.

Extension

Description

Extension

Description

begin

Script called before changing configuration block

end

Script called after changing configuration block

create

Script called when creating a configuration entry

update

Script called when amending a configuration entry

delete

Script called when deleting a configuration entry

priority

Value used to indicate relative priority of different parts of the configuration

defer-actions

Script used to defer actions

call-rpc

Script called to implement YANG RPC.

get-state

Script called to implement operational state retrieval.

error-message

Seemingly only used in range and pattern statements which support YANG error-message statement, so should just be deprecated

validate

Implemented for new VCI components via Check() call over DBUS

Configuration

provisiond is responsible for any configuration associated with the YANG files it owns. Provisiond runs the legacy commit algorithm using the new tree it has been sent as a "candidate" configuration for the "github.com/danos/config/commit" library.

The "Config/Check" VCI method will run the legacy "validate" algorithm.

The "Config/Set" VCI method will run the legacy "commit" algorithm.

Operational State

Provisiond also implements the "State/Get" component interface for components it manages and returns the tree as generated by calling all "get-state" scripts.

RPCs

When the provisiond component is registered, it locates all RPC calls in the YANG modules assigned to the default component and wraps calls to the "call-rpc" scripts into functions that are accessible over the VCI bus. 

Interaction with other VCI components

provisiond is the "default" VCI component, picking up all unowned YANG files. The Configuration for Provisiond is applied "After" all other component's config. Components are able to choose to go "After" provisiond via their ".component" file.

Diagram

Related Source Code

GitHub - danos/provisiond