Service activation
After a client has ordered and paid for the service, BILLmanager will start the activation process that includes several steps:
Selecting a processing module
If several processing modules are connected to the tariff plan:
- The system selects the processing module with the smallest priority.
- If the service creation procedure fails, the system will try to use the next processing module. When changing the module, the system will choose the one integrated with the same IPmanager as the previous one. The module with the smallest priority will be selected first.
If the system tried to configure all of the processing modules, but the virtual server was not created, a new task will be created for the department responsible for manual operations.
Searching a server in the pool
The billing system searches for the server with the required parameters in the pool. If the server is found, it will be activated for the client. Otherwise, the system will create a new virtual machine.
Assigning the IP address
BILLmanager sends the API request to IPmanager to search for a free IP address. The IP will be used as the primary IP address of the virtual server.
Preliminary steps
Before creating a virtual server, the system performs the following operations:
- Creates a new user in VMmanager.
- Creates a new user in DNSmanager. It will be used for the "Name server" addon.
- If the "Control panel license" addon is configured, orders a license for server management.
- Generates a free domain name (if the client didn't specify a name during the order).
- If the name server for a free domain name is configured, creates a domain record for the free domain.
The operations are running in parallel. Operation timeout is 5 minutes. If the timeout is exceeded, the step and the service operation fail, and a new processing module cannot be selected.
Creating a server
BILLmanager sends the API request (vm.edit) to create a virtual machine in VMmanager.
In case of error, the next processing module is selected. If other processing modules are not set up, the service activation fails. In a few minutes, the billing system will perform several attempts to create a virtual machine on the processing module server before setting the module to manual configuration.
If the VM creation request is successful, BILLmanager will wait for OS deployment to complete. Now the server is ready.
OS deployment on VMmanager KVM and Cloud may take up to several dozens of minutes. If some parameters in VMmanager are configured incorrectly, the operation may take endless time. OS deployment timeout is 30 minutes. You can change it in Integrations → Processing module → Parameters → Installation timeout.
If OS deployment cannot finish during the specified period, BILLmanager will send a request to delete the server in VMmanager, and the service activation will fail. In a few minutes, the billing system will perform several attempts to create a virtual machine on the processing module server before setting the module to manual configuration.
Checking the server
BILLmanager sends the API request to VMmanager to check the server state. It calls the 'vm' function with the 'elid=<service id>' parameter.
The "Completion of server setup" parameter of the processing module defines when a server is ready: after the OS deployment process is finished and no errors occurred, or after the recipe is installed successfully on the server.
The server state is defined by the XML-file that the processing module returns:
- The 'installing' or 'installos' parameters in the XML indicates the OS installation is currently running on the server.
- recipe_run or recipe_run 'on' — recipe installation in progress.
- 'recipe_fail' 'on' — recipe installation field.
- 'state' 'error' — server creation failed.
Saving server parameters
BILLmanager receives VM parameters from VMmanager:
Password of the server superuser. It is specified in the service activation email.
Cluster node, where the virtual machine is created. This parameter is saved in the billing system database. The "Cluster node" button in BILLmanager can be activated in the Table settings form → select the Cluster node checkbox.
Additional steps for VMmanager OVZ
ISPmanager is installed on the server, BILLmanager sends the API requests to ISPmanager to perform the following operations:
- Update license status: 'func=license.info&clicked_button=update_license&sok=ok'. Since ISPmanager is built into the OS template, after the container is created from the image, you need to update the license status. If the commercial ISPmanager license is ordered for the server IP address, the system will find it and bind to the server. Otherwise, ISPmanager will stop working.
- Get ISPmanager and DNSmanager integration parameters: 'func=afterinstall&out=xml&xset.up=on’. Theses data are used in the service activation email.
Activating the service
After the server is created successfully and additional operations are performed, the service status will change into "Active", and the client will receive the activation email.
Statistics
VMmanager processing module collects statistics for some resources. Statistics is always collected for the previous day.
The process starts with the cron job statdaily.cron.
Logs
Log of interaction between the billing system and VMmanager is saved into the'/usr/local/mgr5/var/pmvmmgr.log' file ('/usr/local/mgr5/var/pmvemgr.log' if you use VMmanager OVZ)
You can identify certain operations in the log by using the following records:
'processing/pmvmmgr --runningoperation <current operation id> --command open' — service actiovation
'processing/pmvmmgr --runningoperation <current operation id> --command close' — service de-activation
'processing/pmvmmgr --command sync_server --module <processing module id>' — data synchronization
'processing/pmvmmgr --command stat --module <processing module id>' — statistics collection
'processing/pmvmmgr --command fixip --module <processing module id>' — synchronization of IP addresses