Self Service
Self Service allows end users to build and destroy virtual servers within a set of defined limits.
There are two variations to self service:
- Hourly Billing - VirtFusion will track server usage from start to end and supports credit balance billing (top up).
- Resource Packs - Packs of resources (memory, disk etc...) are allocated to a user and servers can be built within those limits.
User may also have a mixture of traditional and self service virtual servers. A user cannot delete a traditional virtual server.
- No integrations are currently available for hourly billing purposes (resource packs only WHMCS is supported at the moment), although all required API endpoints exists.
- For hourly billing, Tax cannot be shown correctly for package pricing. Prices can only state inclusive or exclusive of tax. This is to be addressed in future versions.
- Token value changes will alter the current billing period.
Configuration
General System Setup
To use hourly billing, specifically the credit balance system, VirtFusion must be configured to monitor balances and credits. This is done by activating schedulers on the control server via SSH:
vfcli-ctrl app:schedule-manager self-service start
This scheduler should not be disabled for a prolonged period of time if any users are configured with credit balance billing.
Hourly Pricing
You only need to add pricing to your packages for hourly billing. Resource Packs are not tracked and won't be displayed in any usage statistics.
Select Settings
under the Self Service
category from the admin menu.
Most of the settings are self-explanatory, it's the currencies section (at the bottom of the page) that needs to be configured.
Click the Add Currency
button.
In the popup, select the currency code you would like. We will use USD as an example. Enter a Token Value
of 0.01
and a Prefix
of $
, select Default
and Save.
It should look like this once added.
You can repeat the process for other currencies, but it's probably worth coming back later once you understand the token concept...
Packages
The standard VirtFusion server packages are used for Self Service, but require a token value setting.
Select a server package or create a new one and edit the package. You will see section at the bottom called Self Service
an input field call Token Value
.
The value entered here is important. Remember we set a Token Value
of 0.01
for USD
(equates to 1 cent) which means if we set a value of 199
in the package field, the price will be $1.99/month
. Enter the value you would like and save the settings.
Continue the process for the other packages you would like to use as self service packages.
Take note of the other self service options in the package settings. Most of these settings will help refine how the package is displayed to the user.
Self Service Package Groups
Package Groups are essentially groups of server packages. You can name them what you like.
Select Package Groups
under the Self Service
category from the admin menu.
Click Create Group
and enter a name in the popup.
Once created, you can add the packages you created or modified for self service to this group. They will be displayed to the user in the order they are added.
Don't forget to click the Update
button once you've finished configuring the group.
Self Service Groups
You need atleast one self service group. Groups are essentially groups of hypervisor groups. You can name them what you like.
Select Groups
under the Self Service
category from the admin menu.
Click Create Group
and enter a name in the popup.
Once created, you have the option to enable the group as a Resource Group
. If this is enabled, prices won't show to the end user and/or the packages won't show up in hourly billed groups.
It's optional to add a Description
and it will only be shown if an end user has access to more than one group.
The next step is to add your hypervisor groups to this group and add the package groups you created to each of the hypervisor groups. Note that the hypervisors and package groups will be displayed in the order they are added.
Take note of the other options in the group settings. Most of these settings will help refine how the package is displayed to the user.
Self Service Group Profiles
You need atleast one self service group profile. Group profiles are groups of self service groups (like you just created in the previous step). You can name them what you like.
Select Group Proofiles
under the Self Service
category from the admin menu.
Click Create Profile
and enter a name in the popup.
Once created, you have the option to enable the profile as a Resource Group
and enable/disable access.
The next step is to add the self service groups you created previously to this profile.
Resource Packs
Resource Packs make it easy to give end users a set of resource limits that can be changed globally at any point. You will need to create a resource pack for hourly billing.
Select Resource Packs
under the Self Service
category from the admin menu.
Click Create Pack
and enter a name in the popup. You should select Hourly Only
if this is to be used for hourly billing.
On the next page you can enter the limits for the profile. If a limit is left blank, it will default to unlimited.
Users
End users don't have access to self service by default. It will need to be enabled and configured on a per user basis.
When editing a user from the admin area, you have several options.
- Group Profiles - Hourly - You can select the Group Profiles that were created for hourly billing.
- Group Profiles - Resource - You can select the Group Profiles that were created for resource billing.
- Resource Pack - Hourly - The resource pack for hourly billing.
- Access - Enable/disable access to the specific self service options.
- Hourly Credit Balance Billing - Select this to add the user to balance based billing (top up).
Once configured, the user will have the ability to create servers within their hourly limits and/or resource packs.
Addons
Addons are used for hourly billing only. Addons allow you to define a set of extras that can be assigned to a server. i.e IP addresses or backups.
To create an addon, select Addons
under the Self Service
category from the admin menu.
Click Create Addon
and enter a name in the popup.
On the next page you can enter the token value for the addon, enable it and add a description. The token value is the same system we used when configuring a package. A value of 100
will translate to $1.00
if using the USD
currency set at 0.01
.
End User Build Forms
All build forms are automatically created based on the group assigned to a user and the resources added within that group.
Here's an example of a fully loaded form that supports hourly billing and resource packs.
Addons
All addons will be listed in the usage reports and are billed accordingly.
Assigning
Multiple addons can be assigned to a server. To assign an addon, navigate to the server and click the Self Service
tab.
Click the Add
button on the right of the Addons
section. and select one of the defined addons.
Cancelling
To cancel an addon, click the yellow cross button at the end of the table for the assigned addon. Cancelled addons are billed up to the date they are cancelled.
Deleting
Addons should not be deleted unless they were added by mistake.
If an addon is deleted, all accounting for the addon is lost.
Custom Token Values
By default, pricing is defined by a package or addon. However, token values can be defined on a per server or server addon basis.
Server
To define a token value, navigate to the server and click the Self Service
tab.
Enter a custom value in the Tokens
field and tick Override Package Token
then click the Update
button.
Addon
To define a token value, navigate to the server and click the Self Service
tab.
Click the edit icon (pencil in a box) from the list of assigned addons.
In the popup, enter a custom value in the Custom Token Value
field and tick Enable Custom Token
then click the Save
button.
Usage Accounting
Usage accounting is only performed on hourly billing. End users have access their usage via a widget on the dashboard or a dedicated usage page.
Administrators can also see (and download JSON) reports per user by selecting Reports
under the Self Service
category from the admin menu.
Credit Balance Billing
The recommended way to bill your users for hourly servers is via the credit balance system. Credits are added to the user account and the user may use their credit.
- Top up credits have to be added manually by administrators until billing modules become available. This can be done via the UI or API.
- No actions are taken on a negative credit balance.
Enabling
Credit balance billing can be enabled via the self service settings (Admin -> Self Service -> Settings).
It must also be enabled for each user you would like to use the credit system (Admin -> Users -> [selected user] -> Self Service).
Adding Credits
As explained above, No billing modules currently exist. This means top ups for users must be added via the admin UI or API.
To add credits for a user, navigate to Admin -> Self Service -> Balance & Credits
and select the Credits
tab.
Click the Add Credit
button in the top bar.
Select the user and enter a Token Amount
. It will translate under the field to currencies added on the system. You don't need to add any references, both are optional and will be used at a later date for automation.
Click Apply Credit
and the credit will be added to the user.
Removing Credits
Removing a credit may result in a negative balance.
To remove (unapply) a credit, click the yellow cross icon at the end of the credit entry.
It will be removed from the users balance but will remain in the list as unapplied
.
API
Self service can be integrated with external billing systems for hourly billing and resource packs. Endpoints are available in the API based on user relational ID's.