Get Virtualizor

WHMCS Module

Overview

Softaculous Virtualizor supports the remote creation of Virtual Machines / VPS. WHMCS can be configured to create the VPS as soon as you accept the Order (Automatically or Manually). We provide a module for WHMCS to enable you to do so. Setting it up is really easy. You can create, delete, or suspend a VPS with this module.

The endusers can also manage their VPS through the WHMCS(Old UI) interface without actually logging into Virtualizor.

Note: This module (version 2) requires Virtualizor 2.8.0+ on the master.
The existing plans created on "WHMCS Module 1" will be backward compatible. For any VM that is created from WHMCS module, we recommend that to do not make any changes from the Virtualizor Panel. It will affect the integrity. Like adding multiple disks from the Virtualizor panel.

Compatible with WHMCS 8

Download

Download the Virtualizor WHMCS module (2.8.0) from HERE. (Last updated: 9th Sept, 2024)
Unzip it and upload the folder virtualizor (the folder itself), in your /path/to/whmcs/modules/servers/ Directory.
Please make sure that the upload was done properly and following folder exists :
/path/to/whmcs/modules/servers/virtualizor

Ports

Virtualizor uses ports from 4081 - 4085. If there is any firewall restricting this, you will need to allow these ports.

Features

VPS Information View in WHMCS Client Panel




VPS information View in WHMCS Admin Panel



Servers Key

Virtualizor generates a Unique Key and Key Pass when its installed on the server.
You will need the servers Key and Key Pass to add the server to WHMCS.
This information can be found from the Virtualizor Admin Panel -> Configuration -> Server Info

Adding Server to WHMCS

Note : Only Master server needs to be added on WHMCS.

To add the Virtualizor Server to WHMCS login to WHMCS Admin Panel Then go to WHMCS Admin Panel -> Setup -> Servers -> Add New Server
Fill the form as shown in the below images :

Creating a Product

Now, you will need to create a product.

Product

To do so go to WHMCS Admin Panel -> Setup -> Products/Services -> Create a New Product
Fill in the details as per the following image and specify the Products Name of your choice .

Module Settings

The WHMCS module has been updated to a new and simple version. It includes selecting the module name and setting up the fields as shown in the image below:

The Fields are:

  • Virtualizor Server : Select the type of virtualizor server where you want to create your VPS.
  • Type : Select the type of Virtualization being used.
  • Select Plan : Select plan which you have created on virtualizor panel.
  • Default Node/Group: Select the Server or node Group or any individual server. (NOTE : [G] denotes the group)
  1. Select the Virtualizor server and then type of virtualization.
  2. After selecting above two fields you have to click on Save Changes. Once the changes are saved, you will get the list of Plans. Until then Plans will be empty.
  3. Select Virtualizor Plan (as created on your Virtualizor Master) and Default Node/Group.
    If you haven't created a Virtualizor Plan you will need to do so as following :

If you want to know more about adding a Plan click on this link Add a Plan

Custom Fields

Now Click on the Custom Fields Tab and fill in the form as per the following image


Just for your information the vpsid is the VPS ID as per the Virtualizor Database and needs to be stored for any future action like Terminate, Suspend, etc. Please fill it as per the above Image.

The OS field is the List of Operating System Templates on your server. Virtualizor provides templates to its users. Its a COMMA seperated value. This will allow the USER to choose the OS when he is signing up for the VPS. Also the list should be the names as listed in the Virtualizor Admin Panel -> Media -> OS Templates. Again, use the Name and not Filename as seen in the Virtualizor Admin.

The ISO field is to display list of ISO images to your clients. This field will allow users to choose the ISO image while signing up for any plan.

NOTE: While creating a VM Operating System MUST be provided for VM provisioning. So if you want to use Configurable Option for OS selection then you can remove the above custom field of "OS". Either of them MUST be present while placing order.

The node_ram_select field is an optional field. This field is useful when you want to choose servers (where your VPSs are going to be created) based on FREE RAM among your servers.

NOTE : Please add 'none' value when you add ISO and OS field. (Please refer the screenshot above)

NOTE : ISO option is not supported for OpenVZ and XEN-PV VPS.

Configurable Options [OPTIONAL]

You can add the Configurable Options as per your requirements or exclude one or more of the options below if you do not need it.

Note : The order of preference for selection of Configurable Options is first i.e. If a Product/Service has (lets say) Ram defined as 512 MB and you have also created a Configurable Option with variable Ram options, then the users chosen Ram value from configurable options will be used and not the ram value in Product/Service.

Following are the Configurable Options available in Virtualizor WHMCS module.

  • Number of IPs
  • Number of IPv6 Address
  • Number of IPv6 Subnet
  • Number of Internal IP Address
  • Space
  • RAM
  • Bandwidth
  • CPU Cores
  • Network Speed
  • CPU Percent
  • Operating System
  • Control Panel
  • Managed by Admin
  • Server - Slave Server's ID in Virtualizor. Set the same values as you would with the Slave Server described in Module Settings
  • Region - Server Groups ID in Virtualizor. Set the same values as you would with the Server Group described in Module Settings

Additional Params : (Since 3.0.0+)

If these parameters are added as configurable option then VM(s) will be created with Plan Value + Configurable option value.
For e.g. If VPS plan has space defined as 5GB and additional_space configurable option is added as 20GB, and while ordering if this 20GB option is selected, then VM will be created with 25GB.
You can use the following parameters as additional param :

  • additional_ram
  • additional_space
  • additional_bandwidth
  • additional_cores
  • additional_num_ips
  • additional_num_ips_int
  • additional_num_ips6
  • additional_num_ips6_subnet

Other Advance Configurable Options

  • hostname
  • swapram
  • virtio
  • nic_type
  • vif_type
  • osreinstall_limit
  • kvm_cache
  • io_mode
  • iso - ISO
  • sec_iso - Secondary ISO
  • mgs - Media Groups (NOTE : Put ID of the Media Group for this configurable option.
    You can get it from Virtualizor Admin panel-> Media -> Media Groups )
  • stid - Storage to use
  • ippoolid - IP Pool ID, for selecting IPs from particular IP Pool. (NOTE: You can specify multiple IP Pool Ids with comma separated)
  • dnsplid - Setting DNS Plans
  • Total I/Os per sec
  • Read Mega Bytes/s
  • Write Mega Bytes/s
  • topology_sockets
  • topology_cores
  • topology_threads
  • rdp
  • bpid - This is for assigning backup plans to the VPS. You can get the backup plan ID from Admin Panel -> List Backup Plans.
  • upload_speed - This option will help in upgrading/downgrading upload speed.
  • recipe - This is for recipe which you want to get executed when VM is provisioned. You can get the recipe ID from Admin panel -> Recipes -> List Recipes. You can set the recipe as 1|Recipe Name
  • ha - This option will help to create vps with HA enabled, assuming HA nodes are already configured.
    Value of this option should be 1 to enable HA for the vps.
  • disable_password - This option will disable the root login for the newly created VMs. User will not be able to login using root password. (Since 3.1.2.4)
  • ssh_options - If you want the users to login using private keys then you can use this option. Its values MUST be "generate_keys" to enable key base login for the newly created VMs. (Since 3.1.2.4)
  • disable_guest_agent - Since 3.1.9.1, guest agent is enabled by default. If you want to disable it then you can use this option and set its value to 1 to disable it.

To add, go to WHMCS Admin Panel -> Setup -> Products/Services -> Configurable Options.
Then click on Create a new Group .

Now, click on the Add New Configurable Option button. A new window will open.

Number of IPs: Add a configurable option for Number of IPs as below:

Space : Add a configurable option for Space (It will be in GIGABYTES e.g 10 = 10GB) as below:

RAM :  Add a configurable option for RAM (It will be in MEGABYTES e.g. 512 = 512MB) as below:

Bandwidth : Add a configurable option for Bandwidth (It will be in GIGABYTES e.g. 10 = 10GB) as below:

CPU Cores : Add a configurable option for CPU Cores as below:

Network Speed : Add a configurable option for Network Speed (It will be in KILOBYTES e.g. 128 = 128KB/s) as below:

CPU Percent : Add a configurable option for CPU Percent as below:

Operating System : Add a configurable option for Operating System as below:

Storage Type : Add a configurable option for stid as below:

Virtio: Add a configurable option for Virtio as below:

Virtual Network Interface Type :  Similarly, add a configurable option for the Virtual Network Interface Type as below

default will be taken as Realtek 8139
e1000 is for Intel e1000 and if you set none then Virtio will be set.

Virtual Network Interface Emulation Type : Similarly, add a configurable option for the Virtual Network Interface Emulation Type as below:

OS Re-Install Limit : Similarly, add a configurable option for the OS Re-Install Limit as below:

KVM Cache : Similarly, add a configurable option for the KVM Cache as below:

I/O Policy : Similarly, add a configurable option for the I/O Policy as below:

DNS Plans : Similarly, add a configuration option for the DNS Plan as below:

VNC Console Keymap : Similarly, add a configurable option for the VNC Console Keymap as below:

Managed by Admin : admin_managed needs to be set as option name with 1 or 0 as the values shown below :

BuycPanel Licensing : Control Panel Configurable option for BuycPanel licensing :

You can assign cPanel installation for your Virtualizor VPS. The above option allows you to display a dropdown of control panel list which can be selected by the user and the license will be automatically activated by BuycPanel.

NOTE : You must enter the BuycPanel Login and API Key in virtualizor_conf.php file.

Control Panel : Control Panel as an individual Configurable Option :

The above will just have the control panel installed in the newly created VPS. It will not license the Control Panel. Please do not confuse with the BuycPanel option described above.

NOTE : The configurable option values should be exactly as mentioned in each configurable option above, if you want to add a description to the Configurable option then you need to add a "|" (pipe) after the value followed by the description. For example for a configurable option of disk space if you want to add a description like GB or TB it should look like "10 | 10 GB".

Custom Code Integration

If you want to add your custom code as a hook to execute after order processing, you can do it by putting your code custom.php. You have to put your code in virtualizor module directory (i.e. /path/to/whmcs/modules/servers/virtualizor/custom.php)
While handling the error please use the variable $custom_error

Callback

The callback feature (Admin Panel -> Configuration -> Master Settings -> Callback Settings) allows Virtualizor to notify WHMCS when a specific action is performed.

NOTE : This functionality requires Virtualizor version 2.8.5

The following callback actions are supported for VPS(s):

  • Suspend - It will set VM as suspended in WHMCS.
  • Unsuspend - It will set VM as unsuspende in WHMCS.
  • Terminate - It will set VM as Terminated in WHMCS.
  • Change Hostname - It will change the Hostname in WHMCS for VM.
  • Change IP(s) - It will change the IPs (Assigned IPs as well) in WHMCS for VM.
  • Enable login for WHMCS User - It will enable the user to login with same credential WHMCS credential in Virtualizor cloud panel login.
  • Enable WHMCS Invoicing - This will create the Cloud user invoice in WHMCS.

1) For callbacks to work edit the callback.php script within the /path/to/WHMCS/modules/servers/virtualizor/ folder on your WHMCS installation.
2) Edit the script and set the 3 required security variables:

// Any Admin User in WHMCS
   $admin_user = "admin";

   // The Hash Key in WHMCS (As shown in Virtualizor Admin Panel -> Configuration -> Master Settings -> Callback Settings)
   $hash_key = array();

   // The Virtualizor Master IP
   $connection_ip = array();


3) For more security rename the script to a filename of your choice.

Now you can add multiple servers, for example:

$hash_key = array( 'KEY1', 'KEY2', ..... , 'KEYn');
$connection_ip = array('IP1', 'IP2' , ..... ,'IPn');

NOTE: If you are enabling an option Enable login for WHMCS User, you will need to configure the file named as perform_actions.php same as callback.php
Please do not change the filename to any other file name. It must be perform_actions.php only.

If you see the tasks as pending on Virtualizor panel then make sure no cronm process is stuck on Master server :

ps aux |grep cronm

Disable Enduser Operations

Admin can disable many options available to Enduser panel. These settings are available at Virtualizor Admin Panel -> Configuration -> Master Settings -> Enduser Setting section. There you will see that there are many option to disable access to enduser panel. Once disable user will not be able to see that option in WHMCS client area.

Email Templates

The following email template can be used in WHMCS to send details of the newly created VM :

Dear {$client_name},

We are glad to inform you that the virtual machine you ordered has been set up.

Manager Details
=============================
URL: https://your.master.domain.com:4083
Username: {$service_username}
Password: {$service_password}

Server Details
=============================
Hostname: {$service_domain}
Main IP: {$service_dedicated_ip} 
Root Password: {$service_password}
{if $service_assigned_ips}
IP Address Allotted:
{$service_assigned_ips}
{/if}

You can access your server over SSH. 
If you are a Windows user, you can use a free SSH client called Putty which can be downloaded from :
http://www.chiark.greenend.org.uk/~sgtatham/putty/download.html

{$signature}

Webuzo

NOTE : Supported since 3.0.4.8+

Now you can install webuzo scripts from WHMCS. to install webuzo scripts you need to add following configurable options.

  • webuzo_script
  • webuzo_stack
  • php
  • mysql
  • webuzo_os

webuzo_script

You need to add scripts you want to install in the below format.
ID | SCRIPTNAME

NOTE : http://api.softaculous.com/_scripts.php"> You can get the ID of the script and minimum PHP version required for that script from this link -> http://api.softaculous.com/_scripts.php



webuzo_stack

You need to add stacks you want to install in the below format.
STACKVALUE | STACKNAME
available stacks : lamp, lemp, llmp


webserver

NOTE : This option is supported only if Stack is LAMP.

webserver option will let you select the apache's version. Use below format to add different apache versions.
APACHEVERSIONVALUE | APACHEVERSIONNAME
eg: apache2 | Apache2.4

php

PHP version to be installed. Use below format to add different PHP versions.
PHPVALUE | PHPNAME
eg: php56 | PHP 5.6

mysql

MySQL version to be installed. use the below format to add different MySQL versions.
MYSQLVALUE | MYSQLNAME
eg: mysql56 | MySQL 5.6

webuzo_os

Webuzo OS to be installed. use the below format to add different webuzo OS.
OSID | OSNAME
you can find the OSID from virtualizor panel : Media -> OS Templates

Firewall Port

Please make sure, that the whmcs server , master server and the slave servers have ports 4081,4082,4083,4084 and 4085 opened.

Virtualizor Configuration

You can change the configuration in the virtualizor_conf.php. You can find this file at /path/to/whmcs/modules/servers/virtualizor/

Following variables can be set either 0 or 1.
Disable = 0
Enable = 1

$virtualizor_conf['client_ui']['control_panel_install'] 
$virtualizor_conf['client_ui']['os_reinstall']
$virtualizor_conf['client_ui']['backups']
$virtualizor_conf['client_ui']['hostname']
$virtualizor_conf['client_ui']['novnc']
$virtualizor_conf['client_ui']['openvz_ram_graph_hide']
$virtualizor_conf['admin_ui']['disable_terminate']
$virtualizor_conf['admin_ui']['preserve_info']
$virtualizor_conf['loglevel']
$virtualizor_conf['client_ui']['direct_login']
$virtualizor_conf['client_ui']['disable_sso']
$virtualizor_conf['no_virt_plans']
$virtualizor_conf['client_ui']['hide_sidebar']
$virtualizor_conf['use_sso_on_80']

$virtualizor_conf['ram_in_gb']

Following variables are for cpanel licence activation / deactivation.

$virtualizor_conf['cp']['cpanel_manage2_username']
$virtualizor_conf['cp']['cpanel_manage2_password']
$virtualizor_conf['cp']['cpanel_manage2_group']
$virtualizor_conf['cp']['cpanel_manage2_pkg']

Following variables are to purchase cpanel license using buycpanel.

$virtualizor_conf['cp']['buy_cpanel_login']
$virtualizor_conf['cp']['buy_cpanel_apikey']

troubleshooting

Connection issues

Only Virtualizor master server needs to be added on WHMCS panel.
If you receive error for ports while clicking on test connection for Virtualizor server on WHMCS then make sure you have allowed 4085/TCP and 4083/TCP ports and Virtualizor Master IP on WHMCS firewall.
If its already allowed then try to curl from WHMCS ssh :

curl -kv “https://virt-master:4085”
curl -kv “https://virt-master:4083”


It should return 302.

Optionally, if you have set callback on WHMCS then try to curl from Virtualizor master ssh (ignore hash error in output) :
curl -kv “https://path/to/WHMCS/modules/servers/virtualizor/callback.php”


Note : If it's on shared hosting then mostly they won’t allow the required ports so test connection will always fail.

Plans do not load

1) Try clicking on save in module settings after choosing correct virt type in dropdown and if it doesn’t help then make sure the correct domain is added for the Virtualizor server on WHMCS panel. If you do not have any domain then you can leave it blank in hostname/domain field.
Apostrophe (eg jevins server) should not be there in name added for virtualizor server on WHMCS panel.

2) Make sure the domain/hostname added for Virtualizor server on WHMCS panel is getting resovled from WHMCS server.
Suppose you have added the Virtualizor server with domain as example.com then it should resolve to a Virtualizor server's IP from WHMCS server else plans will not load on WHMCS.

VNC issue on WHMCS

If WHMCS is being accessed on SSL then the Virtualizor panel also needs to have ssl and also make sure the correct hostname/domain is added for the Virtualizor server on WHMCS panel.


Support

If you need any assistance then please contact Softaculous Virtualizor Support. Please send us a screenshot of the Module Settings and the Custom Fields you added to the Product.

Hi,

The Virtualizor Team has released Virtualizor 3.2.0
In this version, we have some New Professional features and fixes.

Here is the complete change list:


1. [Feature] Added Firewall for Enduser panel. Endusers can apply the firewall rules for their machines from enduser panel

2. [Feature] Added Sorting on the List Servers Page on the admin panel

3. [Feature] A New theme has been added as 2024 for Enduser panel. This theme is in Beta.

4. [Feature] Now enduser can add their recipes from enduser panel

5. [Feature] Added option to add SRV record in PDNS management

6. [Bugfix] While adding a user from an API call allowed virtualizations were not assigned properly. This is fixed.

7. [Bugfix] Reducing SWAP to 0 was causing issues. Now an error will be shown saying that SWAP can not be reduced to 0.

8. [Bugfix] Unsuspension calls from WHMCS were failing because a proper response was not coming from the API call. This is fixed.

9. [Bugfix] On rebuilding the VM, VM password was not saved properly. This is fixed.

10. [Bugfix] On reboot of Node having proxmox 8 as base node OS, VNC was not working for VMs. This is fixed.

11. [Bugfix] RTC setting was not working for proxmox KVM machines. This is fixed.

12. [Bugfix] For KVM guests if guest-agent was enabled, at that time disk usage was showing 0 in enduser panel. This is fixed.

13. [Bugfix] Backup disks were showing as orphaned disk(s). Now backup disks will not be shown in the Orphan disk list.

14. [Bugfix] In the cloud user panel (Billing enabled) after making a payment suspension notice was still shown. This is fixed.

15. [Bugfix] While migrating the VM having more than 250 IPs it resulted in failed Migration. This is fixed.

16. [Bugfix] While adding user(s) from API if the user plan ID was posted, at that time user resources were not getting applied. This is fixed.

17. [Task] Now Cloud users can select recipes while creating VM(s).

18. [Task] Improved listvs API response.

19. [Task] If a VPS plan was created for a load balancer and the destination server did not have a Professional license, at that time it was creating a VM as a normal VM. Added error check for a professional license for such a scenario.

------------------------------ Patch 1 ------------------------------
20. [Bugfix] The QR Code was not shown while enabling the two-factor Authentication. This is fixed.
21. [Bugfix] New theme was not getting enabled. This is fixed.
22. [Bugfix] For CEPH block storage, if a VM disk size was created for more than 1000 GB at that time on every edit of the VM, a disk resize task was created which was causing the issue. This is fixed.
23. [Bugfix] LDAP login was not working for slave panels. This is fixed.
24. [Task] Improvements for new UI.

------------------------------ Patch 2 ------------------------------

25. [Feature]  Added Windows templates to Template Browser on Admin Panel

26. [Feature]  Now NoVNC will be Enabled/Disabled without Stop and Start of the Machine (For KVM)

27. [Tasks]  Improved Firewall rules

28. [Tasks]  Improved API response for List VS page on enduser panel

------------------------------ Patch 3 ------------------------------
29. [Bugfix] Bulk Firewall changes were not applied properly. This is fixed.
30. [Bugfix] API statistic call was not working for previous months data. This is fixed.
31. [Bugfix] The RDNS option was shown on enduser panel even though the setting was disabled from Admin panel and only PDNS was enabled. This is fixed.
32. [Feature] QCOW2 support added for templates. At the moment only Virtualizor templates will work. Soon will be added for cloud images.

------------------------------ Patch 4 ------------------------------

33. [Task]  Now for Master Only server, while creating VM it will select the first available node, instead of showing warning that you can not create VM on masteronly node.

34. [Task]  Firewall will be available for all endusers.

35. [Task]  Minor UI changes for 2024 theme

36. [Bugfix]  If any internal IP pool was assigned to the user, at that time free public IP pool was not showing up for the same user. This is fixed.

37. [Bugfix] Rescue mode was not working for qcow2 disk storage. This is fixed.

38. [Bugfix]  VM password were not getting reset if the VM was rebuilt from Linux to Windows or vice versa. This is fixed.

39. [Bugfix]  If VM was created using SSH keys at that time while rebuilding it was giving error. Now added option to remove old ssh keys and add new keys.

40. [Bugfix]  On Xenserver 8, DHCP entries were not written correct, due to which VM were not able to start. This is fixed.
------------------------------ Patch 5 ------------------------------
41. [BugFix] On masteronly server, other servers were not getting selected. This was introduced in 3.2.0.4. This is fixed.

Please let us know if you face any issues / have any suggestions. We are available on Virtualizor live chat at https://virtualizor.com

Regards,
Virtualizor Team

    Was this page helpful?
    Newsletter Subscription
    Subscribing you to the mailing list