Skip to content

Device Management Server (DMS)

When dhops is executed using docker, each command needs to be executed from the working directory using the full path to the instance (e.g. dhops config node1/dms1).

Create an instance of the Device Management Server (DMS)

We can now create an instance of a Device Management Server (DMS) that will be deployed to its node. Start by creating a new instance using the cli:

1
2
3
4
5
$ dhops create dms [<path-to-node>/]<dms-instance-name> # e.g. dhops create dms node1/dms1
Created <workspace>/<node-name>/<dms-instance-name>/config.yaml
Created <workspace>/<node-name>/<dms-instance-name>/secrets.yaml
Encrypted <workspace>/<node>/<dms-instance-name>/secrets.yaml
Dms dms1 created into node node1

Configure the instance

Continue by configuring the instance:

1
$ dhops config [relative-path-to-dms-instance] # e.g. dhops config node1/dms1

Alternatively, you can directly open the config.yaml file inside the instance folder.

Configure the instance secrets

Then, edit the secrets of the instance using:

1
$ dhops secrets [relative-path-to-dms-instance] # e.g. dhops secrets node1/dms1

Alternatively, you can directly edit the secrets.yaml file using sops secrets.yaml

The relative path can be omitted if you are in the corresponding folder.

Template the instance

Finally, template the devicehub instance using its configuration and secrets using:

1
$ dhops template [relative-path-to-dms-instance] # e.g. dhops template node1/dms1

You can now find all templated files inside the .output/<node-name>/<dms-instance-name> folder from the workspace.

Deploy the instance

Finally, all templated files can be deployed to the node using:

1
$ dhops deploy [relative-path-to-dms-instance] # e.g. dhops deploy node1/dms1

Note that by default, the deploy command automatically template the files

Backup and Restore

It is good practice to perform a backup of each instance once a day.

Perform the backup as follows:

1
2
$ dhops backup [relative-path-to-dms-instance] # e.g. dhops backup node1/dms1
# backup-<dms-instance-name>-<date>.tar.gz

Note that this can be used inside a CRON job

When needed, the backup can be restored using:

1
2
$ dhops restore -i backup-<dms-instance-name>-<date>.tar.gz [relative-path-to-dms-instance]
# e.g. dhops restore -i backup-dms1-20210217-184530.tar.gz node1/dms1

Note that the backup contains only the data stored on the node. Meaning that all configuration files such as config.yaml and secrets.yaml are not part of the backup as they are intended to be stored inside a separate repository.

Workspace

At the end of this tutorial, your workspace should have the following tree structure:

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
.
├── keys
│   ├── webteam@leitwert.ch.pgp
│   ├── webteam@leitwert.ch.pgp.pub
│   ├── username@name.node.leitwert.ch.rsa
│   └── username@name.node.leitwert.ch.rsa.pub
├── node1
│   ├── config.yaml
│   ├── dms1
│   │   ├── config.yaml
│   │   └── secrets.yaml
│   └── secrets.yaml
└── dhops.yaml

Last update: 2022-03-31