PUQ Mautic Skip to main content

Basic concepts and requirements

 Order now | Dowload | FAQ

Requirements for the successfull operation of the module

  • Minimal WHMCS version 8+
  • Minimal Proxmox server or cluster version 7+
  • Continuous and stable network availability between systems
  • In the case of using static IP addresses, it is necessary to have the required number of free IP addresses that will be reserved for use in virtual machine services.
  • If you are using a DHCP server in your virtual machine network, you will additional need to configure it properly.
  • If you use VLAN in your network, then you need to correctly configure your internal network so that the VLAN is available on all nodes of the cluster.
  • In order for the noVNC console to work correctly, it is necessary to configure the VNC Web proxy on a separate installation (for example, a virtual machine) that will have access to the Internet and to the secure network of the Proxmox cluster / server.
  • You need to set up a DNS API proxy. To synchronize forward and reverse DNS records.

If the module is set to use the DHCP server, the module does not manage the allocation of IP addresses and firewall rules, but only the throughput and setting the appropriate bridge and vlan settings on the network card

In the case of using one Proxmox server, a Directory or NFS data store is required.

In the case of using a Proxmox cluster, the cluster must have a shared network storage.

  • On one network storage, there should be both templates of virtual machines and disks of virtual machines. A configuration is allowed when the virtual machine template has 2 disks that can be stored on different network storages. For example, the system disk of the virtual machine is stored on the fast storage, and an additional disk is stored on the slow storage, designed for backups inside the virtual machine.
  • For ISO images, you can use another network storage
  • For backups to work, network storage is also required. You can use Proxmox Backup and Your server must still be available to all nodes in the cluster.

The configuration of datastores intended for backups must be configured in advance so that they do not rotate backup copies. Or the rotation has been configured so that it does not interfere with the number of spare copies in the client's package.

If you want to use firewall rules that will protect against IP address spoofing in virtual machines, You need in advance to properly configure the firewall on your server/cluster. The policy for incoming and outgoing traffic must be "DENY". The module adds permissive firewall rules on a virtual machine with the IP address of this machine.

The logic of the module.

Creating a new Virtual Machine.
  1. After the client ordered and paid for the virtual machine services
    • An available IP address is selected from the list in the server settings. !!! If the service is in the Terminated state, its assigned IP address will be taken into account when creating new machines and can be used for a new machine.!!!
    • The available virtual machine ID is selected in such a way that it is unique in the WHMCS system and on the Proxmox server.
    • The fields with the domain name and the name of the virtual machine are generated and filled. The procedure uses the data supplied in the virtual machine package.
    • Starts the process of cloning a virtual machine from the desired virtual machine template. 
  2. Notifications are sent to the client that the virtual machine is in the process of being created (Welcome email)
  3. Internal cron process monitors and cares about proper installation procedure.
  4. Each time cron is executed, the module tries to continue setting up the virtual machine if the cloning process is completed, virtual machine configuration steps in crontab job:
    • Write the MAC address of the network card VM in the WHMCS database
    • Set CPU and RAM
    • Set system disk size
    • Set system disk bandwidth
    • Created additional disk if needed
    • Set additional disk size if needed
    • Set additional disk bandwidth if needed
    • Set network bridge and VLAN and bandwidth
    • Set Firewall rules
    • Configure cloud-nit (user, password, network configuration)
    • Start VM
    • Notify the client by e-mail that the virtual machine has been created, and the access parameters IP, user, password

An example of output from crontab log upon successful creation of a virtual machine

===========================================
VM_id: 2001
Service_id: 4785
User_id: 1
VMSetDedicatedIp: The local status should be creation
VMClone: The local status should be set_ip
VMSetCpuRam: success
VMSetSystemDiskSize: success
VMSetSystemDiskBandwidth: success
VMSetCreatedAdditionalDisk: success
VMSetAdditionalDiskSize: success
VMSetAdditionalDiskBandwidth: success
VMSetNetwork: success
VMSetFirewall: success
VMSetCloudinit: success
VMStart: success
Remote_status: running
Local_status: ready
ServiceSendEmailVMReady: OK

 

Reinstalling the Virtual Machine.

It is possible to reinstall VM from WHMCS panel.

The reinstallation process removes the virtual machine and recreate it using the parameters and characteristics and the actual data of the package.

  1. After the reinstallation option has been chosen and run the virtual machine is removed. Backups are not deleted. After removal, the process of cloning the virtual machine from the selected virtual machine template is started.
  2. Each time cron is executed, the module tries to continue setting up the virtual machine if the cloning process is completed, virtual machine configuration steps in crontab job:
    • Set CPU and RAM
    • Set system disk size
    • Set system disk bandwidth
    • Created additional disk if needed
    • Set additional disk size if needed
    • Set additional disk bandwidth if needed
    • Set network Bridge and VLAN and bandwidth and MAC address
    • Set Firewall rules
    • Configure cloud-nit (user, password, network configuration)
    • Start VM
    • Notify the client by e-mail that the virtual machine has been ready, and provide access parameters IP, user, password

 

Snapshots
  1. The client has the ability to create/delete/restore snapshots of his virtual machine.
  2. The number of snapshots is limited in the package configuration.
  3. Snapshot lifetime is configured in the package configuration (is it in the range of 1-10 days maximum)
  4. Snapshots are automatically deleted when their lifetime expires (using crontab jobs)
 
Backups
  1. The client has direct ability to create/delete/restore backups of his virtual machine.
  2. The number of backups is limited in the package configuration.
  3. In the case of a schedule configuration for creating automatic backups, the client has the opportunity to select only the day on which the backup should be created. Backup times are generated automatically and randomly each time an automatic backup task is saved.
  4. How automatic backups work.
    • during cron execution, it checks which virtual machine has a schedule for today, and if the execution time of the scheduled copy is younger than the moment at which the crona job is running
    • checks if there is no today's backup then
    • checks if there is a free slot for a backup and if not, it deletes the oldest backup
    • creates a backup
Backup recovery
  1. Before restoring a backup, the virtual machine must be in a powered off state.
  2. After a successful backup restore, the module does the following processes with the virtual machine.
    • Set CPU and RAM if needed
    • Set system disk size if needed
    • Set system disk bandwidth if needed
    • Created additional disk if needed
    • Set additional disk size if needed
    • Set additional disk bandwidth if needed
    • Set network bridge and VLAN and bandwidth and MAC address if needed
    • Start VM
    • Notify the client by e-mail that the virtual machine restoring the  backup ready
  3. If for some reason it was not possible to restore the virtual machine from the backup, then the client is given the opportunity to try to restore the backup again or reinstall the virtual machine

During the creation and restoration of a backup, all operations for managing the virtual machine are suspended

 
Reset password

The password reset procedure will work if the packages that are responsible for the operation of cloud-init have not been removed from the virtual machine

  1. Before reset password, the virtual machine must be in a powered off state.
  2. Processes that occur during the password change procedure
    • a new random password is generated and recorded in the client's service settings
    • Configure cloud-nit (user, password, network configuration)
    • Start VM
 
Mounting ISO image

ISO images are configured and stored in standard Proxmox way. You need to prepare storage (shared storage in case of Proxmox cluster) and upload ISO images to it in advance.

To organize and facilitate image selection, the module uses a display method that follows the file name formatting convention. Module displays ISO images names taken from Proxmox in WHMCS panel. One should pay attention to the correct naming of the image files.

ISO images are cataloged and sorted by the symbol "-" in the name of the ISO image.

For the name of the directory, the first occurrence is matched up to the symbol "-"
If the name of the ISO image does not have a symbol "-" then such an image will be cataloged in the OTHER directory.

image-1662726572502.png