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:
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:
The agent configuration file is written to ./SN-001234/agent.env by default. Write it to a specific directory:
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:
Write to a specific directory:
Unprovision a device¶
Danger
Unprovisioning permanently deletes all records for the device. This cannot be undone.
Inspect the device state first:
Unprovision with the confirmation prompt:
Skip the confirmation prompt (for scripted use):
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. |