Skip to main content
Version: 4.1

WHMCS Direct Provisioning

The WHMCS Direct Provisioning module is a simple module that can create, terminate, suspend and unsuspend servers with a direct login bridge between WHMCS and VirtFusion.

How it works

When a customer orders a server, they use the standard ordering system of WHMCS but don't have all the confusing options of choosing a root password, operating system etc... they just order and make payment.

Once payment is complete, they have an option to directly login to VirtFusion to set up their server.

api

Which takes them straight to the setup page.

api

Download & Install

Download the latest version of the module.

VersionReleasedLinkNotes
2.32022-08-18downloadRequires VirtFusion v1.7.3 or higher
2.22022-07-01obsolete
2.02022-06-05obsoleteRequires VirtFusion v1.6.1 or higher
1.42022-04-06download
1.32022-02-02obsolete
1.22022-01-03obsolete
1.12021-12-16obsolete
1.02021-11-29obsolete

Once downloaded, extract the archive and upload the contents of the upload directory to the root of your WHMCS installation.

Configuration

VirtFusion API credentials

As a VirtFusion administrator, create a new global API token (System > API > Create Token)

api

Fill in the Name field and enter the IP of your WHMCS installation in the Access field (This is optional, entering an IP will lock requests to the specified IP). Then click Create.

api

Copy the generated API key to a safe place. We will need it later.

WHMCS setup

Create a server

As a WHMCS administrator, add a new server (System settings > Servers).

servers

  • Give it a Name
  • Enter the hostname of your VirtFusion management UI
  • Select Module VirtFusion Direct Provisioning
  • Enter the VirtFusion API token in the Password field
  • Tick Secure
  • Save

Create a server group

Create a new Server Group and add the previously created server to it.

servers

Create a product group

Create a new Product Group (System settings > Products/Services).

servers

Create a product

Create a new Product.

servers

  • Product Type Other
  • Product Group should be the one you just created
  • Product Name
  • Module VirtFusion Direct Provisioning

Once the product is created, click the Module Settings tab.

servers

  • Server Group select the server group you created earlier
  • Hypervisor Group ID can be found in VirtFusion (Compute Resources > Hypervisor Groups > ID (table column))
  • Package ID can be found in VirtFusion (Packages > ID (table column))

Continue to configure the product as normal.

Configurable Options

The following configurable options are available.

NameDescription
IPv4The amount of IPv4 address to be added to the server on creation. This will override the default IPv4 specified in the product module settings.
PackageThe ID of a package in VirtFusion. This will override the default package specified in the product module settings.
LocationThe ID of a hypervisor group in VirtFusion. This will override the default hypervisor group specified in the product module settings.
StorageAn amount of storage in GB for the primary disk. This will override the storage value for the specified package.
MemoryAn amount of memory in MB. This will override the memory value for the specified package.
BandwidthAn amount of traffic in GB. This will override the traffic value for the specified package.
Inbound Network SpeedThe inbound network speed in kB/s in the range of 0 - 9999999999 (0 = unlimited). This will override the inbound network speed value for the specified package.
Outbound Network SpeedThe outbound network speed in kB/s in the range of 0 - 9999999999 (0 = unlimited). This will override the outbound network speed value for the specified package.
CPU CoresAn amount of CPU cores. This will override the CPU cores value for the specified package.
Network TypeThe ID of a network profile. This will override the network profile for the specified package.
Storage TypeThe ID of a storage profile. This will override the storage profile for the specified package.

You must use the exact name specified for a configurable option to work, however, the names can be overridden using configurable option mapping.

To use config option mapping you may rename ConfigOptionMapping-example.php in the config folder to ConfigOptionMapping.php (it won't be overwritten on updates) and edit the values in the array to match your configurable option names.

return [
'ipv4' => 'IPv4',
'packageId' => 'Package',
'hypervisorId' => 'Location',
'storage' => 'Storage',
'memory' => 'Memory',
'traffic' => 'Bandwidth',
'networkSpeedInbound' => 'Inbound Network Speed',
'networkSpeedOutbound' => 'Outbound Network Speed',
'cpuCores' => 'CPU Cores',
'networkProfile' => 'Network Type',
'storageProfile' => 'Storage Type',
];

Do not edit the array keys, these must remain as specified in the script.

Examples
Location selector (optional)

You may use configurable options to enable a location selector for your order forms. A Location configurable option will override the default Hypervisor Group ID configured in the package.

options

The option name must be Location (if you are not overriding the default name) and options must use the format Hypervisor Group ID|Friendly Name.

IPv4 selector (optional)

You may use configurable options to enable a IPv4 selector for your order forms. A IPv4 configurable option will override the Default IPv4 configured in the package.

options

The option name must be IPv4.