The Blesta module (version 0.1.0) creates the customer's panel account and server, follows suspensions, cancellations and package changes, and adds a Server tab for clients and staff.
Requirements#
- Blesta 6.x on PHP 8.1 or later, with cURL.
- The panel reachable over HTTPS with a valid certificate.
- A panel API key as described in API key for a billing system.
Install#
- Get the package
vmstack-blesta-<version>.zip(see Integrations). From the source,php build.phpchecks every file and writes it todist/. - Unpack it into
<blesta>/components/modules/, so thatcomponents/modules/vmstack/vmstack.phpexists. - In Blesta go to Settings › Modules › Available and install VMStack.
Connect to the panel#
- On the module's page, press Add panel.
- Fill in Name, Panel address (such as
panel.example.com; no scheme needed) and API key (vmk_…). - Press Save and test the connection.
Saving calls the panel's GET /me. It is refused when the key belongs to a user or misses a scope the module uses; on success it shows the summary (account, key, scopes and a placement note). The key is stored encrypted; when editing the panel, leave the key empty to keep the stored one. You can add several panels; for a panel group the module uses the first panel.
Package setup#
- Packages › Add package, module VMStack, choose the panel.
- Fill in the package fields. Lists are read from the panel; if it cannot be reached the page warns and shows text inputs for the IDs.
| Field | Default | Meaning |
|---|---|---|
| Plan | – (required) | the panel plan |
| Placement | – (required) | "Location: …", "Group …" or "Node: …" (groups and nodes only for an administrator's key with infrastructure:read) |
| Default image | – | required unless Customer sets up the server is ticked |
| Hostname pattern | empty | {serviceid}, {clientid}, {domain}. Empty: the hostname typed at the order, else the panel picks one |
| Reseller for new accounts (administrator keys) | empty | panel ID of the reseller new accounts go under |
| Customer sets up the server | off | the server waits for the customer (customer setup) |
| Send welcome password | off | the root password is kept (encrypted) for the welcome mail; needs servers:secrets |
| Allow the client to create servers in the panel | off | ticks May create and delete servers on new accounts |
| Delete the panel account on cancel | off | deletes the panel account after its server is deleted |
| Single sign-on | on | Open control panel on the client tab |
| Bind sign-in links to the client's address | on | sign-in and console links work only from the client's address |
Welcome email tags: {module.server_name}, {module.host}, {package.plan}, {package.placement}, {package.image}, {service.vmstack_hostname}, {service.vmstack_ip}, {service.vmstack_ips}, {service.vmstack_password}, {service.vmstack_server_id}.
Configurable options#
Option names are matched without regard to case, spaces or hyphens; values are ID or ID|Label.
| Option name | Effect |
|---|---|
plan |
overrides the package plan |
location |
overrides the placement, wins over node_group |
node_group |
overrides the placement |
operating_system (or os, image) |
overrides the default image |
application |
one-click application slug, or none |
extra_ipv4 (quantity) |
IPv4 addresses beyond the plan's |
The package ships vmstack/options.json, a group "VMStack server options" with these options, to import under Packages › Configurable options › Import. Replace the example values with your panel's IDs.
Order fields: Hostname (a full host name) and SSH public keys (one per line; with none, SSH password login is turned on). Staff also see VMStack server ID, which links an existing server to the service.
What the module does#
| Blesta | Panel |
|---|---|
| Add service (with "use module") | finds or creates the client's account, creates the server, adds extra IPv4. If the server was made but a later step failed, the server ID is kept and a notice says what is left. |
| Suspend / Unsuspend | suspends ("Overdue invoice") / lifts the suspension |
| Cancel | deletes the server, optionally the account |
| Change package / edit service | upgrades the plan (downgrades refused), re-syncs extra IPv4 |
| Renew | nothing |
Admin Server tab: panel server and link, status, suspension, plan, location, node, addresses, external ID, traffic this month, and Start, Shut down, Reboot, Power off, rescue on and off, and Reset root password.
Client Server tab: status, application, plan, resources, location, OS, addresses (or the NAT address and SSH port) and traffic; Start, Shut down, Reboot, Power off; Start and End rescue with Show password; Console; Open control panel; reverse DNS; Reinstall (confirmed by typing the hostname); Reset root password; Set up your server while it awaits setup.
Limitations#
- Client-area actions are sent with the key's own rights, not on behalf of the customer: the plan's customer permissions and reinstall limits are not applied in Blesta's Server tab (they still apply in the panel).
- Only extra IPv4 as an add-on; no extra IPv6, disks, snapshots, traffic or port forwards. Port forwards are managed in the panel.
- No usage billing (Blesta has no module interface for it).
- A changed client email is not sent to the panel.
- Extra IPv4 can be added only once the server is built; run the action again if the server was still building.