Billing integrations

Blesta integration

Install the DCIM provisioning module, connect Blesta packages and expose dedicated-server management to customers.
The Blesta provisioning module connects one service to one DCIM server. Lifecycle commands update DCIM, while native service tabs provide persistent client and administrator management for power, provisioning and remote console access.
One Blesta API connection can be reused across several packages. Configure the datacenter on each package so separate packages expose different server pools without duplicating API credentials.
View the Blesta integration overview

Requirements

  • Blesta 5.13 (tested with 5.13.10).
  • PHP 7.4, 8.1, 8.2 or 8.3. PHP 8.3 is recommended for new deployments.
  • PHP cURL and JSON extensions enabled.
  • A reachable DCIM API base URL ending in /v1.
  • A dedicated DCIM API token with the ADMIN audience.
  • A public HTTPS/WSS URL for every agent used by customer remote console sessions.

API token scopes

Create a dedicated token in the DCIM dashboard with the ADMIN audience and these scopes:
SERVER_READSERVER_POWERSERVER_PROVISIONSERVER_REMOTE_CONSOLEPART_READSWITCH_PORT_MANAGEJOB_READLOG_READ
Restrict the token
Restrict the token to the Blesta server's public IP whenever possible. Do not reuse a dashboard or agent token.

Install the module

  1. 01Obtain dcim.tar.gz from the DCIM distribution package.
  2. 02Copy the archive to the Blesta server.
  3. 03Extract it into the Blesta application root.
  4. 04Confirm that components/modules/dcim/dcim.php exists.
  5. 05Open Settings > Company > Modules > Available and install DCIM.
Extract the Blesta module
tar -xzf dcim.tar.gz -C /path/to/blesta

Expected module path

The archive contains the complete Blesta-relative directory structure.
components/modules/dcim/dcim.php
Upgrading the module
Extract a newer archive over the same Blesta root. Existing server connections, package options and service assignments are stored by Blesta and remain in place.

Create the API connection

  1. 01Open Settings > Company > Modules > Installed and manage DCIM.
  2. 02Click Add API Connection and enter a descriptive name.
  3. 03Set DCIM API URL to the complete HTTPS URL, including /v1.
  4. 04Paste the dedicated ADMIN token into DCIM API Token and save.
  5. 05The module validates the connection and required scopes before storing it.

Connect a package

  1. 01Open Packages > Browse and create or edit a package.
  2. 02Select the DCIM module and the reusable API connection.
  3. 03Choose the datacenter for this package. Only STOCK servers from it are selectable.
  4. 04Select the required Create, Suspend, Unsuspend and Cancel actions.
  5. 05Complete the package group, pricing and email settings, then save.

Assign a service

  1. 01Add the service with status Pending and disable Use Module for the initial save.
  2. 02Use the searchable DCIM Server field to select a STOCK server.
  3. 03Set the module Main IP, hostname and root password fields.
  4. 04Open the pending service, choose Activate, enable Use Module and save.
  5. 05For service 123, confirm that BLESTA-123, the Main IP and configured lifecycle changes are applied.

Package lifecycle options

Create

  • Add service tag: for service 123, adds BLESTA-123 to the selected server.
  • Assign Main IP: assigns the module Main IP and marks it primary in DCIM.
  • Set status ACTIVE: changes the DCIM lifecycle status after assignment.

Suspend and Unsuspend

  • Disable switch port: disables the primary connected switch port.
  • Power off server: submits a DCIM power-off job.
  • Unsuspend provides the matching enable-port and power-on actions.

Cancel

  • Enable switch port: restores the natural enabled state before reuse.
  • Power off server: leaves the hardware off for the next provisioning.
  • Unassign all IPs: removes every DCIM IP assignment from the server.
  • Remove service tag: removes only the matching BLESTA service tag.
  • Return to STOCK: restores the inventory hostname and STOCK status.
Activate after the initial save
Blesta does not expose the permanent service ID to the module during a direct Active creation. Save the service as Pending without module provisioning, then activate it with Use Module enabled. This produces the unambiguous BLESTA-{service_id} ownership tag.
Natural termination state
The recommended termination flow enables the switch port first, powers the server off, removes IPs and the service tag, restores STOCK, then clears the DCIM server association. The next operator receives reachable networking when the server is powered on for provisioning.

Lifecycle behaviour

Blesta actionDCIM behaviour
ActivateRequires a STOCK server, assigns the module Main IP when enabled, adds BLESTA-{service_id} and can set ACTIVE.
SuspendDisables the primary switch port and can request server power-off.
UnsuspendEnables the primary switch port and can request server power-on.
CancelEnables the port, powers off, unassigns IPs, removes the service tag, returns the server to STOCK and clears the DCIM server association.
Power and switch operations are asynchronous. Blesta records success after DCIM accepts the job. An activation retry is idempotent when the matching service tag already exists.

Service server assignment

Each service receives a searchable DCIM Server field. It lists only STOCK servers from the package datacenter and stores the selected UUID in the dcim_server_id service field. The root password is stored separately using Blesta encryption.
IP assignment uses the module's Main IP service field. Populate it before activation, or disable the package's Assign Main IP option.

Customer management

Active services expose a Manage Server tab in Blesta. It provides device information, power actions, provisioning, live job progress and remote console access while retaining the native service navigation.
Dedicated server management available inside the Blesta service
Client access boundary
Inventory status, switch-port controls and discovery remain admin-only. Suspended, terminated and cancelled services cannot call DCIM management actions.
Automatic disk selection
The Auto storage option sends an empty disk-part list so DCIM can choose the system disk. Explicit disk and RAID choices send the selected DCIM part UUIDs.

Administrator management

Staff receive a native Manage Server tab alongside Basic Options and Advanced Options. It adds discovery, primary switch-port controls, inventory status and recent activity to the customer-safe management surface.

Remote console requirements

The customer browser connects directly to the DCIM agent. Its configured URL must use HTTPS, have a valid public certificate and be reachable by the customer. The WebSocket connection uses WSS.
No BMC credentials in Blesta
Blesta receives only a short-lived viewer session. Customers do not receive the BMC username or password.

Verify the integration

  1. 01The DCIM API connection saves without an error.
  2. 02The package shows a datacenter and lifecycle options.
  3. 03The service DCIM Server selector loads STOCK servers from that datacenter.
  4. 04Pending to Active assigns the selected server, service tag and Main IP as configured.
  5. 05Manage Server opens the DCIM page for both clients and administrators.

Troubleshooting

The API connection cannot be saved

Confirm the URL ends in /v1, the token uses the ADMIN audience and every required scope is present. Also confirm that the Blesta server can reach the DCIM HTTPS endpoint.

The DCIM Server list is empty

Select a datacenter on the package and confirm that it contains servers with STOCK status. Servers assigned to another billing service are rejected.

Activation reports that Main IP is missing

Populate the module Main IP field before activation, or disable the package's Assign Main IP option.

Manage Server does not open

Confirm that the service is Active and still has a valid DCIM Server assignment. Cancel removes that association only after DCIM cleanup succeeds.

Remote console does not connect

Verify the agent is online, its URL uses HTTPS, the certificate is valid and the customer network can open the agent WSS endpoint.