DCImanager Documentation

Integration with WHMCS

WHMCS is a billing system that allows providers to offer different services to their customers.  

With WHMCS, they can configure the automatic provisioning of dedicated servers to customers.

The billing system performs the following function

  • registers and bills customers; 
  • creates tariff plans; 
  • receives payments;  
  • automates service provisioning: activation, renewal, suspension. 

To integrate DCImanager with the billing system, log in to WHMCS and complete the steps below.

Note

The integration module was not tested with WHMCS 7.8.3 and later.

Installing the module


To install the integration modules, navigate to the Modules directory of WHMCS setup root directory and unpack the files:

cd /var/www/html/whmcs/modules/
wget http://download.ispsystem.com/extras/whmcs/7/whmcs_isp_dci.v.2.tar.gz
tar -xzvf whmcs_isp_dci.v.2.tar.gz

Open the WHMCS web-interface and activate the module in Setup → Addon Modules ISPsystem global module Activate

Integration


Click on Setup → Products/Services → Servers Add New Server.

Servers

  • Name — the name that will be used to connect to DCImanager; 
  • Hostname — the domain name of the server with DCImanager; 
  • IP address — the server IP address. 

Server Details

  • Type — the server type. Select  "DCImanager"; 
  • Username — enter the username in  DCImanager. Enter the credentials of the "Administrator" user. WHMCS will use this name to manage servers in DCImanager; 
  • Password — enter the user password. 

Configuring a tariff plan


Click on  Setup → Product/Services → Product/Services Create a New Product.

Details

  • Product Type —  the selected type defines how the service will be processed. Select "Dedicated/VPS Server"; 
  • Product Group —  select a service group that will include the tariff plan; 
  • Product Name.

Module Setting

  • Module Name — select "DCImanager"
  • Server Group; 
  • Package Name — the server configuration name in  DCImanager
  • Operation System — the OS template id from DCImanager. You can view a list of ids by calling the function <Domain or IP address of the control panel>/dcimgr?func=osmgr&out=xml; 
  • Recipe Name — a recipe that will be executed after OS installation. Enter  #local__<recipe name> for local recipes. The files of local recipes are located on the server with DCImanager in the /usr/local/mgr5/etc/recipes/local/ directory.  Enter  <repository name>__<recipe name> for the recipes from the repository. The recipe files from repository are located on the server with DCImanager in the /usr/local/mgr5/etc/recipes/repo/<repository name>/ directory
  • Dont wait the OS install — do not wait for the OS installation process to complete when activating a service
  • Domain template — if a client doesn't enter a domain name on the service order form, it will be generated based on the selected template.


Configurable options

Tariff options in WHMCS are additional resources that a client can order at an extra fee.  They are billed separately from the product. The client can choose the amount of additional resources on a service edit form. 

Configurable options can be grouped. Each group can be associated with several products. We recommend that you use a separate group of options for every connection to the control panel.  

Go to Setup → Products/Services → Configurable Options. Add the following options for your dedicated server tariff plan:

  • Operation system.   Enter "OS", "os" or "ostemplate" in Option Name. Other names are not supported; 
  • Per-installed software (recipes). Enter "recipe" in Option Name. Other names are not supported; 
  • IP addresses. In Option Name enter "IP" for IPv4-addresses and  "IPv6" for IPv6-addresses. Other names are not supported. 

How it works


Service activation

WHMCS checks if the client has active services ("Dedicated servers"). If he already has such services and accounts in DCImanager, every new server will be created within that account.

If the client orders a dedicated server for the first time, a new account will be registered in DCImanager. The account name in DCImanager is the same as in WHMCS. The password generated for the service (dedicated server) is used as the account password.

WHMCS creates a Pending service, and searches for an available server with the selected configuration in DCImanager. The server is considered available in DCImanager, provided that 

  • that server doesn't have the owner ;
  • its Hostname is free.ds;
  • the servers don't have hardware issues ;
  • server diagnostics is not running. 

The system can select the server configuration if the «Package Name» field name in the tariff configuration form has the same values as the «Configuration» or «Server type» fields in DCImanager.

The server is allocated IP addresses from the pool in DCImanager. During the OS installation, the ordered IP addresses will be added to the server network interface. 

The service status is changed into Active and the client can use it after:

  • OS installation has started on the server (the «Don't wait the OS install» checkbox is selected in tariff configuration form);
  • OS installation has completed successfully (the «Don't wait the OS install» checkbox is not selected in the tariff configuration form). The module waits for the OS installation for 720 seconds. If it wasn't completed during that time, WHMCS displays corresponding error messages, and the service remains Pending.

Service suspension

When the service is about to expire, the server is blocked in DCImanager. If the client doesn't renew the service during a certain period of time, the server will be considered available for use. 

Service deletion 

Deleting the service will release the server in DCImanager:

  • Its owner is changed into without owner;
  • Hostname is changed into free.ds;
  • The server IP addresses are released.

Logs

The log files can be found in Utilities → Logs → Module Log