Skip to content

Provision a Device

How to provision a new device, remove an existing device from the system, and retrieve the agent configuration file for a device that has already been provisioned.

Provision a new device

Always preview with --dry-run first to validate the serial number and customer code:

tlm-cli pms provisioning provision SN-001234 --customer ACME --dry-run

The dry run displays a table with: Serial Number, Customer, resolved Tenant ID, planned Config Path, and whether the Device Exists. If everything looks correct, provision for real:

tlm-cli pms provisioning provision SN-001234 --customer ACME

The agent configuration file is written to ./SN-001234/agent.env by default. Write it to a specific directory:

tlm-cli pms provisioning provision SN-001234 --customer ACME --output-dir /opt/device-configs

The file will be at /opt/device-configs/SN-001234/agent.env.

Retrieve an existing device's configuration file

Use this to retrieve the agent configuration file for an already-provisioned device. The content of agent.env is stable and will not change between calls — only unprovisioning and reprovisioning the device would produce a different file:

tlm-cli pms provisioning get-certificate SN-001234

Write to a specific directory:

tlm-cli pms provisioning get-certificate SN-001234 --output-dir /opt/device-configs

Unprovision a device

Danger

Unprovisioning permanently deletes all records for the device. This cannot be undone.

Inspect the device state first:

tlm-cli pms provisioning unprovision SN-001234 --dry-run

Unprovision with the confirmation prompt:

tlm-cli pms provisioning unprovision SN-001234

Skip the confirmation prompt (for scripted use):

tlm-cli pms provisioning unprovision SN-001234 --yes

Troubleshooting

Error Likely cause
Device already exists The serial number is already registered in PMS. Use show to inspect it, or unprovision if it needs to be re-created.
Customer not found The customer code does not exist or has no tenant ID. Verify with tlm-cli admin customers show CODE.
Device not found (get-certificate) The serial number is not registered in PMS. Provision it first.