VorticPanel

API and billing

Blesta module

The VorticPanel module for Blesta runs the whole server lifecycle from Blesta: it creates a server when an order is paid, suspends it when an invoice is overdue, unsuspends it when it’s paid, deletes it when the service is canceled, and changes its package on an upgrade or downgrade. Clients see their server on the service’s page in Blesta, with its addresses, traffic and power buttons, and open the panel already signed in. It sells GPU instances the same way.

It works with Blesta 6 on PHP 8.2 or newer, with PHP’s curl extension (Blesta needs it too). Blesta has to reach your panel over HTTPS: the module only sends the API key over HTTPS.

Much of what the module does is the same in the WHMCS module, and is described once under The WHMCS and Blesta modules. This page covers installing it and what’s particular to Blesta.

1. Install the module

Download it from Downloads in your account on vorticpanel.com. It’s a zip with a components folder and a short README.

Unzip it into your Blesta folder, the one with index.php and the config folder in it, keeping its folders, so the module ends up in components/modules/vorticpanel. On a server you reach over SSH, with your Blesta folder in place of /var/www/html:

cd /var/www/html
unzip -o ~/vorticpanel-blesta-1.3.0.zip 'components/*'

In a control panel’s file manager, upload the zip to the folder with index.php, extract it there, and delete the README.txt it adds.

Then, in Blesta, go to Settings → Company → Modules, open the Available tab, and click Install next to VorticPanel.

To update the module later, unzip the new version over the old one (-o replaces the old files without asking), then click Upgrade next to VorticPanel on the Installed tab if Blesta offers it. Services and settings stay as they are.

2. Make an API key in the panel

  1. In the panel, go to Admin → API & webhooks, and under Panel API keys click New API key.
  2. Name it Blesta, and under Permissions click the Billing module preset.
  3. Under Allowed IP addresses, add your Blesta server’s IP address.
  4. Set Expires to No expiry. Create it, and copy the key (it starts with pnl_): it’s shown once.

More about panel API keys is under Create a key and in Authentication and tokens.

3. Add your panel in Blesta

On Settings → Company → Modules, click Manage next to VorticPanel, then Add Panel:

Field What to enter
Name Anything, such as VorticPanel
Panel address Your panel’s domain, such as panel.example.com. Blesta always connects over HTTPS.
Panel API key The key from step 2

Click Add Panel. Blesta checks the key against your panel before saving it, and says why if it can’t use it. The key is stored encrypted and isn’t shown again: to change it, edit the panel and paste the new one; leaving the field empty keeps the current key.

Back in the panel, set Billing link under Settings → General to your Blesta address, such as https://billing.example.com. Customers find it in the panel, and each customer’s page links to their client in Blesta.

4. Set up a package

Go to Packages → Browse and click Create Package (or open an existing package). Under Module Options, choose VorticPanel as the module and your panel. The module then lists what’s in your panel:

Setting What it does
Panel package The package the Blesta package sells, or a GPU offer for a GPU package
Location The node group its servers go in. Leave it on the first choice, The package’s only node group, or the client’s choice, when the panel package is in one node group, or when clients pick (see below).
Operating system What’s installed. The client chooses it in the panel, or a configurable option creates the server waiting for setup: the client picks the operating system when they first open it in the panel.

A panel package that gives its servers graphics cards (GPU servers) is sold the same way: pick it as the Panel package, and each server gets its cards as it’s made.

For servers to be made without anyone clicking, go to Settings → Company → Billing/Payment → Invoice and Charge Options and tick Automatically Provision Paid Pending Services. Blesta then activates each paid order at its next cron run.

The order form asks for the server’s Hostname and, optionally, the client’s SSH public key. Without a hostname, the server is named vps and the service’s number, such as vps42, and the client can change it in the panel. A server waiting for setup keeps the hostname typed on the order; without one, the client chooses it when they set the server up. For a GPU package, the order form asks for the Instance name instead.

Blesta bills each service its package’s price for the billing period. The module doesn’t add usage charges, such as traffic overage or GPU hours, to Blesta’s invoices.

Letting clients choose

A package sold in one node group, with one operating system, needs none of this. To let clients pick at order time, add configurable options with these names. The client’s choice wins over the package’s Module Options.

Option name Type Each value
location Dropdown A node group’s name, exactly as under Nodes → Node groups in the panel, such as US-East, or its ID. It’s always a node group, not a region: see Locations.
os Dropdown A template’s name as OS templates in the panel shows it: the distribution and version, such as Ubuntu 24.04, or its ID. For a GPU package, the container image’s name.
extra_ipv4 Quantity How many addresses the client wants on top of the package’s
backups Dropdown A backup plan’s name as Backup plans in the panel shows it, such as Daily, or its ID; None for no backups; or Package for the panel package’s own plan

Each Blesta option has a Label, which clients see, and a Name, which the module reads; each of its values likewise has a Name clients see and a Value the module gets. So the label can say “Data center” and a value’s name “New York”, while the option’s name is location and that value’s value is US-East.

In Blesta:

  1. Go to Packages → Configurable Options and create a group (such as VPS options), ticking the packages it’s for.
  2. Create an option in that group: Label Location, Name location, type Dropdown.
  3. Add a value per node group, such as name New York and value US-East, each with a price (0 for no extra charge), and save.
  4. Add another the same way, with Name os, a value per template, such as Debian 12 and Ubuntu 24.04.
  5. For extra addresses, add an option with Name extra_ipv4 and type Quantity, set the most a client can order, and price it per address.
  6. To sell backups, add an option with Name backups, type Dropdown, with a value per backup plan you offer (such as name Daily backups, value Daily) and one with value None, each with its price.

The option names have to match the table (capitals don’t matter, and extra ipv4 works as well as extra_ipv4). A value the panel doesn’t recognize, or a node group that isn’t one of the panel package’s, stops the activation with a message on the service. Only configurable options count, not anything the client types. Changing extra_ipv4 later adds or removes addresses to match, and changing backups moves the server to that plan. When the plan can’t be set on a new server, the server is still created and the service’s VorticPanel tab says why.

SSH keys on the order

What happens to a key pasted into SSH public key on the order form is under SSH keys from the order. The order form only takes a public key: a private key pasted by mistake is refused there, with a message asking for the .pub file instead, so it isn’t saved in Blesta or sent anywhere. When the panel turns a key down, the service’s VorticPanel tab says why. Once the server is made, the service no longer keeps the key.

What happens when

In Blesta In the panel
Activated (an order is paid, or staff activate it) The client gets a panel account, linked to their Blesta client ID (see Whose account a service uses). The server is created, and its ID, address, hostname and, when it’s built at once, root password are saved on the service.
Suspended (an invoice is overdue) The server is suspended, with Blesta’s suspension reason
Unsuspended (it’s paid) The server is unsuspended
Canceled The server is deleted and its addresses freed
Package changed (an upgrade or downgrade) The server moves to the new Blesta package’s panel package, and extra addresses follow the extra_ipv4 option. A downgrade without an extra_ipv4 option removes the addresses the bigger package added. With a backups option, the server’s backup plan follows it.

Each one can be run again safely. Suspending a suspended server or canceling one that’s gone counts as done, and an activation retried after a timeout doesn’t make a second server. When something stops an activation, such as a full node group, the service stays Pending with the reason, Blesta emails staff, and activating it again (on the service, or at the next cron run) carries on from there.

Emails

The panel emails the client when their server is ready to set up, and again when it’s built, with its address and root password (unless you’ve switched those emails off). Blesta’s own welcome email for the package can use these tags:

Tag What it is
{service.vorticpanel_hostname} The server’s hostname, or a GPU instance’s name
{service.vorticpanel_ip} Its main IPv4 address
{service.vorticpanel_server_id} Its ID in the panel, such as srv_8f2k1x7q
{service.vorticpanel_password} The root password it was built with; empty for a server waiting for setup, a server built with an SSH key, or a GPU instance

Upgrades and downgrades

Clients change package within the package’s group when Blesta allows it (Settings → Company → Billing/Payment, the client options for changing packages). When the change is paid, the server moves to the new package’s panel package, as under Upgrades and downgrades.

The client area

The service’s page in Blesta shows the server as it is now: its status, hostname, addresses, resources and this period’s traffic, and its Server tab shows the same. While the server is starting, stopping or being built, the page looks again every few seconds.

Its buttons are what the panel lets the client do with the server right now:

The server is Buttons
Running Restart, Shut down, Force off, Reset root password
Stopped Start
Waiting for setup Set up the server (Set up the instance for a GPU instance), which opens the panel to choose its operating system or image
Suspended, or busy (being built, reinstalled or moved) None

Shut down, Force off and Reset root password ask the client to confirm first, on the page. The buttons work only from the client’s own Blesta session, and only on a server whose panel account is the client’s own. After Reset root password, the new password is shown on the page once, and saved on the service. For a GPU instance, the buttons are Start, or Restart and Stop, with its SSH command and JupyterLab link. When the panel serves JupyterLab over HTTPS, Open JupyterLab signs the client in, as Open control panel does.

Open control panel opens your panel in a new tab, already signed in (see Signing in from the billing panel), and under In the control panel are the server’s own pages there, as far as the server allows: its Console, Addresses and reverse DNS, Reinstall, Snapshots and Backups (when its package has them), Firewall and Settings once it’s built. For a GPU instance, it’s Console and logs. Blesta shows a service’s tabs only while it’s active; a suspended service’s page still shows the server and why it’s suspended.

The VorticPanel tab

Each service has a VorticPanel tab in Blesta’s admin area; Blesta’s own Basic Options tab says which server the service is linked to, with a button to it. The VorticPanel tab shows the server: its name and status, addresses, plan, operating system, traffic and where it runs, with Open in VorticPanel, and its Panel account (see Whose account a service uses).

Its buttons are Start, Restart, Shut down, Force off and Reset root password (Start, Restart and Stop for a GPU instance), and Refresh details, which copies the server’s address and hostname from the panel onto the service. They’re always shown: what the server can’t do right now, such as Start while it’s running or anything while it waits for the client to set it up, is grayed out, and pointing at it says why. Force off, Shut down and Reset root password ask to confirm first. Under them are links to the server’s own pages in the panel: its console, addresses, hardware and GPUs, reinstall, snapshots, backups, firewall, jobs and settings.

To link the service to a server that already exists, enter the server’s ID under Server ID on this tab and click Save. Staff adding a service by hand (Add Service on the client) can enter the Server ID there too, to link that server instead of creating one. Only staff can link a server: an order that arrives with a Server ID is refused.

To link a client to a panel account that already has their email, enter the account’s ID under Client’s panel account on this tab, click Save, then activate the service again.

Client details

Name, email and company changes in Blesta reach the panel account Blesta made through the module’s cron task, VorticPanel: copy client details, which runs every 15 minutes (it’s listed under Settings → Company → Automation) and sends only what changed. See Client details.

Moving services from VirtFusion or Virtualizor

After the panel has imported a VirtFusion or Virtualizor panel’s servers, the services that sold them in Blesta still use the old panel’s module. The module’s Manage page (Settings → Company → Modules, Manage next to VorticPanel) has a Switch services from VirtFusion or Virtualizor section that moves them onto VorticPanel packages in one go. Each service keeps what the client pays, its term and its renewal date; it moves to the VorticPanel package and panel, and is linked to the server the import made.

  1. Make a VorticPanel package for each kind of server you sold, as in Set up a package, with a price for every term and currency its services renew on. The price itself doesn’t matter: each service keeps its own as an override.
  2. On the Manage page, the section lists every package that uses the VirtFusion or Virtualizor module. Beside each, choose the VorticPanel package its services move to, or leave it as it is. With more than one panel, choose the panel too.
  3. Click Preview. Each active or suspended service is listed with its server on VorticPanel, found by its ID on the old panel (VirtFusion’s server ID, Virtualizor’s VPS ID). Nothing has changed yet.
  4. Click Switch.

A service is left where it is when:

Shown Why
Not imported into VorticPanel Its server wasn’t part of an import, or was left out of it
The service has no VirtFusion server ID (or Virtualizor) The old module never recorded which server it was
… has no 1 month price in USD (or another term or currency) Add that price to the VorticPanel package, then preview again
More than one imported server has that ID You imported two panels of the same kind with the same IDs, and the service’s old panel in Blesta doesn’t say which. Link it by hand, below.
Services #… all point at the same imported server Two services have the same server ID on the same old panel. Correct the wrong one in Blesta, then preview again.
… is already linked to service #… Another service has that server

When the server’s panel account has a different email from the Blesta client, the service still switches, but the client’s buttons stay off until you link the account under Client’s panel account on the service’s VorticPanel tab. Configurable options stay on the service as they were.

Any service can also be switched by hand: change its package to the VorticPanel one, and enter the server’s ID (srv_…) as Server ID on its VorticPanel tab.

Once nothing uses the old packages, delete them, and the old panel’s module.

GPU instances

Choose a GPU offer as the package’s Panel package, and the container image as its Operating system. With The client chooses it in the panel, or a configurable option, the instance is created waiting for setup: its cards, ports and address are held, and the client picks the image (and the SSH keys root takes) when they first open it in the panel; the service’s page shows Set up the instance until then. Clients can paste an SSH key on the order (see SSH keys on the order) so they can sign in over SSH from the start; JupyterLab works without one. The service’s page shows the instance’s cards, its SSH command and its JupyterLab link. GPU instances sign in with SSH keys from the client’s panel account, so there’s no root password. Canceling one deletes it with its /workspace. An instance keeps its offer: to move to a bigger one, the client orders the other package.

Resellers

A reseller can run the module in their own Blesta, with a token from their own account; see Resellers. Their clients’ billing ID includes this Blesta’s own ID along with the client ID.

When something goes wrong

The message Blesta shows comes from the panel. Every call the module makes is listed in the panel under Administration → API requests, with what it sent and what the panel answered; filter by the token’s name to see only Blesta’s. In Blesta, Tools → Logs, on the Module tab, shows the same calls from Blesta’s side, without the key, passwords or sign-in links.

Message What to do
Couldn’t reach the panel Check the panel’s address on Settings → Company → Modules → VorticPanel, and that your Blesta server can reach the panel on 443
The panel’s address starts with http:// Edit the panel and type just its domain: Blesta connects over HTTPS
The panel already has an account for … that this Blesta didn’t make See Whose account a service uses
An existing server can only be linked by staff The service came with a Server ID from outside Blesta’s admin area. Link the server on the service’s VorticPanel tab instead.
That account’s email isn’t this client’s The account you’re linking has another email. If it’s the client’s, change their email in Blesta to the account’s first.
That didn’t work just now (shown to a client) The panel’s own answer is in Blesta’s module log
This token needs one of these permissions Make a new API key with the Billing module preset
This token can’t be used from … Add Blesta’s address to the key’s IP allowlist. Behind a proxy, see Authentication and tokens.
Open control panel shows the panel’s sign-in page The key doesn’t have Customers: sign-in links: make a new one with the Billing module preset
No node in … has room for … No node in that node group has room for the package: add a node or free space there, then activate the service again
No free IPv4 address Add addresses to the IP pools attached to the node group’s nodes, then activate the service again
The panel’s license needs attention See License. Activating, suspending, unsuspending and canceling keep working.

Other answers are listed under Why an order can be refused.

Every word has to appear. ↑ ↓ to move, Enter to open.